Change one user's profile fields
Change any field your application's configuration shows, for a person whose consent holds profile:edit: display name, gender, date of birth, locale and the shared custom fields your application may write, under fields. Your application's own fields, under private_fields, need no consent scope. Never the username or a picture. Needs profile_fields:write; a change beyond your own fields for a person who has not granted profile:edit is refused with profile_edit_not_consented, a custom field your application does not read with profile_field_not_found, and one it may not write with profile_field_read_only. Each change is recorded and sent as profile.updated.
Authorization
apiKey An API key, presented as Authorization: Bearer eitozx_…. Carries the Application's own authority rather than authority a user delegated to it, and reaches only users who currently hold a grant with that Application. An organization's key reaches every application the organization owns and names the one it acts on in the Onefold-Application header. Not interchangeable with an OAuth2 access token despite the shared scheme.
In: header
Path Parameters
^[1-9][0-9]{0,18}$Header Parameters
The id of the application this call acts on. Required with an organization API key, which reaches every application its organization owns; ignored with an application's own key, which always acts on its application.
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, api_key_application_required, profile_field_hidden, profile_field_invalid, profile_field_not_found, profile_field_read_only |
| 401 | not_authenticated, authentication_failed |
| 403 | permission_denied, api_key_scope_missing, profile_edit_not_consented |
| 404 | not_found, api_key_application_not_found |
| 429 | rate_limited |
Before you run the sample
- Replace
YOUR_API_KEYwith your API key. - The key needs the
profile_fields:writescope, or no scopes at all. - Set
user_id(shown asUSER_ID). - Fill in the request body.
curl -X PATCH "https://example.com/api/v1/manage/users/USER_ID/profile-fields/" \ -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"}Read or write this application's own record about a user PUT
An application-scoped sidecar keyed on (application, user) — never a field on the user. Invisible to every other application, absent from `/userinfo/` on every scope. It survives a revoked grant and is deleted when the user deletes their account. `PUT` replaces the document, `PATCH` merges into it. Reading needs `metadata:read`; writing needs `metadata:write`, so a key can hold one without the other.
Read one user's profile fields GET
The person's profile with your organization as their consent and your application's profile configuration disclose it: the same body `GET /api/v1/userinfo/profile/` returns for a token holding the scopes the person granted. Needs `profile_fields:read`.