Widget

Get avatar upload URL

Changed on

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.

post/agent/{id}/avatar/presigned-url

Request

  • Base URL
    https://api.smallest.ai/atoms/v1
  • URL
    https://api.smallest.ai/atoms/v1/agent/{id}/avatar/presigned-url
  • Auth
    HTTP bearer

Path parameters

idstring required

Agent ObjectId

Request body

fileNamestring required

Original file name (used to construct the S3 key)

contentTypestring required

MIME type. Must start with image/

fileSizenumber required

File size in bytes. Must be greater than 0 and at most 2 MB (2,097,152 bytes)

Response

Pre-signed upload URL and CDN URL

successboolean

Example response

{
  "success": true
}

Changes