Upload the person's avatar
A new avatar, re-encoded by this platform. Needs profile:edit and a configuration that shows the avatar. Refused over your plan's per-file upload limit with media_too_large, and an image this platform will not decode with unprocessable_image.
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
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
A new avatar. The four crop_* fields, all or none, select the part of the image to
keep, in the image's own pixels.
Response Body
application/json
application/json
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, unprocessable_image |
| 401 | not_authenticated, authentication_failed |
| 403 | permission_denied |
| 404 | not_found |
| 413 | media_too_large |
| 415 | unsupported_media_type |
| 429 | rate_limited |
Before you run the sample
- Replace
ACCESS_TOKENwith your user's access token. - Fill in the request body.
curl -X POST "https://example.com/api/v1/userinfo/profile/avatar/" \ -F avatar="null"{ "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 the social accounts the person connected for your application GET
Each social account your application's grants were made through, with the provider scopes it holds. Needs `profile:activity`; `profile_section_hidden` when your configuration hides the connections section.
Remove the person's avatar DELETE
Remove the avatar. Needs `profile:edit`.