Uploads an image and makes it the avatar of a contact in a user's personal address book, replacing the current one.Access follows the contact's own: Basic User, Advanced User, Simple User, Call Center Agent, and Call Center Supervisor can change the avatars of their own contacts only. Site Manager can change those of its own contacts and of users at its own site, Office Manager those of any user in its domain, Reseller those of users in domains of its territory, and Super User any user's. Any other address book returns 403.The contact must be in the address book the path names, or the call returns 404. A shared contact's avatar is under /domains/{domain}/contacts/{contact_id}/avatar.Send the image as multipart/form-data in a part named file. JPEG, PNG, GIF, and WebP are accepted, recognized from the file's content rather than its name or content type; a GIF keeps its first frame only. The image must be square, at most 20 MB, and at most 8,000 pixels on a side; the size is checked before the image is decoded. It is re-encoded as WebP, which drops embedded metadata, in two sizes: at most 256 by 256 pixels and 100 KB, and at most 48 by 48 pixels and 20 KB. A smaller image is not enlarged. file-modified-for-limits: yes means the image had to be scaled down or compressed further to fit. The request body is the image itself, so this page shows no request example.202 means the change was published over the service bus (SBUS), not yet applied. The image is stored, and the contact points at it, shortly after, so path can return 404 for a moment. The previous avatar is deleted the same way. If the change can't be published, the call returns 503 and nothing changes. POST and PUT on this path do the same thing.The image itself is served without authentication at path (at most 48 by 48 pixels), path-small (the same image), and path-large (at most 256 by 256 pixels), so anyone who has the filename can load it.
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params
Body Params multipart/form-dataRequired
Responses
🟢202Accepted
application/json
The upload was published over SBUS and is applied shortly after; see the description.
Bodyapplication/json
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Not Found
🔴500Server Error
🔴503Service Unavailable
🔴507Insufficient Storage
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request PUT 'https://awqacore01.crexendocloud.com/ns-api/v2/domains//users//contacts/5f2b7c9e1a4d8e3b6c0f9a2d7e1b4c8a/avatar' \
--header'Authorization: Bearer <token>' \
--form'file=@""'