Set User Picture
Give an active user their own picture, as they can on their account page. It shows instead of their sign-in provider's picture until it's removed, and your app gets it in the signed token's picture claim from their next request. Send the same picture again and nothing changes. Requires the endpoints:update permission in the active account.
Path parameters
uuid string (uuid) Req
The endpoint's
uuid from /endpoints.client_uuid string (uuid) Req
The user's
uuid. Resolved under this endpoint only.An integer id in the path is refused with 400 integer_id_unsupported (see public IDs). Use the uuid.
Request body
multipart/form-data with the picture in the field file: a PNG, JPG or WebP picture up to 256 KB.
Response (200 OK)
picture_source string
upload.width, height integer
The stored picture's size in pixels.
Download it with Get User Picture.
Errors
400 Bad Request
No file, or the file isn't a PNG, JPG or WebP picture up to 256 KB. The message says what to change.
401 Unauthorized
Missing or invalid auth.
403 Forbidden
Your role lacks
endpoints:update, or you are not a member of the active account.404 Not Found
Endpoint doesn't exist or doesn't belong to the calling account, or the user doesn't belong to this endpoint (
endpoint user not found).409 Conflict
The user isn't active.
429 Too Many Requests
Too many pictures for this user in a short time. Try again after
Retry-After seconds.503 Service Unavailable
Pictures can't be stored right now. Try again later.
Request
curl -X PUT \
"https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/picture" \
-H "X-API-KEY: <your_api_key>" \
-F "file=@maria.jpg"
Response
{
"picture_source": "upload",
"width": 256,
"height": 256
}
Was this helpful?