---
title: "Get avatar upload URL"
method: POST
path: "/agent/{id}/avatar/presigned-url"
tags: ["Widget"]
deprecated: true
---

# Get avatar upload URL

`POST /agent/{id}/avatar/presigned-url`

> **Deprecated.**

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`.

## Path parameters

- `id` string, required

## Request body

- object
  - `fileName` string, required — Original file name (used to construct the S3 key)
  - `contentType` string, required — MIME type. Must start with `image/`
  - `fileSize` number, required — File size in bytes. Must be greater than 0 and at most 2 MB (2,097,152 bytes)

## Response `200`

Pre-signed upload URL and CDN URL

- object
  - `success` boolean
  - `data` object
    - `presignedUrl` string — S3 pre-signed PUT URL (expires in 300 s)
    - `cdnUrl` string — Final public CDN URL to save on the agent after upload
    - `key` string — S3 object key

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `404` — Agent not found
- `500` — Internal server error

## Changes

- **2026-08-13** `9fd13f607823` — 3 info
  - api tag `Widget` added
  - api tag `Agents` removed
  - endpoint deprecated
- **2026-06-22** `0eac753eb5dd` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/smallest-inc/apis/agent-management-api/changes/agent/:id/avatar/presigned-url/post.md)

---

[API](https://skmtc.dev/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.dev/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/04f7dfc02771/schema)
