Change the person's profile
Change any field your application's configuration shows: display name, gender, date of birth, locale, the shared custom fields your application may write under fields and its own under private_fields. Never the username. Needs profile:edit. A hidden core field is refused with profile_field_hidden, a custom field your application does not read with profile_field_not_found, one it may not write with profile_field_read_only, and a value that does not fit its field with profile_field_invalid. Each change is recorded and sent as profile.updated.
Authorization
oauth2 An OAuth2 access token issued through the authorization flow. Acts on a user's behalf, and reads only what that user's granted scopes disclose. A token whose user has since been deactivated or soft-deleted is rejected.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
The profile fields to change. Send only what changes; a field left out keeps its value.
fields sets values of the organization's shared fields by key, private_fields values
of your application's own fields, and a blank value removes one. A value sent back
unchanged is not judged again. A custom field your application does not read is refused
with profile_field_not_found, one it reads and may not write with
profile_field_read_only, and a core field that is hidden with profile_field_hidden.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
Error codes
Every error response carries one of these in its code field. Branch on the code, never on the detail text.
| Status | code |
|---|---|
| 400 | validation_failed, parse_error, profile_field_hidden, profile_field_invalid, profile_field_not_found, profile_field_read_only |
| 401 | not_authenticated, authentication_failed |
| 403 | permission_denied |
| 404 | not_found |
| 429 | rate_limited |
Before you run the sample
- Replace
ACCESS_TOKENwith your user's access token. - Fill in the request body.
curl -X PATCH "https://example.com/api/v1/userinfo/profile/" \ -H "Content-Type: application/json" \ -d '{}'{ "avatar_url": "string", "banner_url": "string", "date_of_birth": "2019-08-24", "display_name": "string", "family_name": "string", "fields": { "property1": null, "property2": null }, "form": { "core": { "property1": "hidden", "property2": "hidden" }, "custom": [ { "class": "shared", "field_type": "short_text", "help_text": "string", "key": "string", "label": "string", "max_length": 0, "options": [ "string" ], "placeholder": "string", "required": true, "user_editable": true, "writable": true } ] }, "gender": "string", "given_name": "string", "locale": "string", "middle_name": "string", "nickname": "string", "private_fields": { "property1": null, "property2": null }, "sub": "string", "website": "string"}Remove the person's banner DELETE
Remove the banner. Needs `profile:edit`.
Read the person's profile GET
The person's profile with your organization: the form your application may fill in and the values your scopes read, narrowed by your application's profile configuration. Needs `profile` or `profile:edit`; date of birth and locale need `profile:edit`. Custom values are the shared fields your application is granted, under `fields`, and your application's own fields, under `private_fields`. A field your application does not read is absent.