Get avatar upload URL

View as Markdown

Generates a pre-signed S3 upload URL for the agent’s widget avatar image. Upload the image directly to S3 using the returned presignedUrl, then save cdnUrl as the agent’s avatar via PATCH /agent/{id}/widget-config.

Authentication

AuthorizationBearer

API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

Path parameters

idstringRequired
Agent ObjectId

Request

This endpoint expects an object.
fileNamestringRequired

Original file name (used to construct the S3 key)

contentTypestringRequired

MIME type — must start with image/

fileSizedoubleRequired

File size in bytes — must be > 0 and ≤ 2 MB (2,097,152 bytes)

Response

Pre-signed upload URL and CDN URL

successboolean
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
500
Internal Server Error