Upload an end-user avatar.
POST
/api/admin/users/{id}/avatar
Code sample: Shell / cURL
curl --request POST \ --url https://auth.example.com/api/admin/users/example/avatar \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form avatar=@fileUpload and validate an end-user avatar image, store it in R2, and update the user’s picture URL in canonical PII storage.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Header Parameters
Section titled “Header Parameters ” X-Tenant-Id
string
Tenant selector for multi-tenant admin requests.
Request Body
Section titled “Request Body ” Media type multipart/form-data
object
avatar
required
JPEG, PNG, GIF, or WebP file up to 5 MiB.
string format: binary
key
additional properties
Responses
Section titled “ Responses ”User avatar upload response.
Media type application/json
object
success
required
boolean
avatarUrl
required
string format: uri
message
required
string
key
additional properties
Example
{ "success": true, "avatarUrl": "https://auth.example.com/avatars/user_123.png", "message": "Avatar uploaded successfully"}Error response.
Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{ "error": "example", "message": "example", "error_description": "example"}Error response.
Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{ "error": "example", "message": "example", "error_description": "example"}