Atmee.aiDocs
APIAPI referenceAvatars

Create an upload

POST
/v1/uploads

Creates a one-time upload for a file you cannot send in the same request, for example from an MCP tool or a chat assistant. Once it is uploaded, pass upload:<uploadId> wherever a create or replace takes a file URL.

kindAccepts
portraitjpg, png or webp, up to 10 MB
voicea 10 to 60 second recording: mp3, wav, m4a, aac, ogg, flac, opus or webm, up to 12 MB
knowledgepdf, docx, doc, txt, md, html or csv up to 50 MB; audio or video up to 20 MB

Send the file one of two ways:

  • PUT it to uploadUrl with uploadHeaders (a Content-Type from allowedTypes if you declared none), at most maxBytes: curl -X PUT -H 'Content-Type: image/png' --data-binary @portrait.png '<uploadUrl>'.
  • Or give a person uploadPageUrl, a page that takes the file (or records a voice). It works for 15 minutes (uploadPageExpiresAt) and until the file arrives.

Then poll GET /v1/uploads/{uploadId} until status is uploaded. An upload is used once and expires an hour after it was created. contentType, when given, is the only type accepted.

Scopes: portrait and voice uploads (a clip's inputs) need generation:write or avatars:write; knowledge uploads need avatars:write. A key with generation:write alone can feed clips but still cannot create or change an avatar with the upload.

Authorization

headerX-Api-Key<token>

Your secret API key (sk_atmee_...; older keys start sk_live_), sent as X-Api-Key. Keep it on your server and never send it to a browser.

Request Body

application/json
  1. body
kind*UploadKind
Value in"portrait""voice""knowledge"
fileName?string

The file's name; a knowledge file is stored and described under it.

Lengthlength <= 255
contentType?string

The file's type, one this kind takes; the upload then accepts only it.

Lengthlength <= 255

Response Body

The upload, waiting for its file.

application/json
  1. response
uploadId*string
Formatuuid
kind*UploadKind
Value in"portrait""voice""knowledge"
status*"pending"
Value in"pending"
uploadUrl*string

The signed target to PUT the file's bytes to, before expiresAt.

Formaturi
uploadHeaders*

Headers the PUT must send. Without a declared contentType, send a Content-Type from allowedTypes.

maxBytes*integer

The most bytes the PUT takes. A knowledge upload declared as audio or video gets the media cap (20 MB), one declared as a document or with no type the document cap (50 MB).

Formatint64
allowedTypes*array<string>
expiresAt*string
Formatdate-time
uploadPageUrl?string

A page a person opens to upload the file (or record a voice). Absent where no page is served.

Formaturi
uploadPageExpiresAt?string
Formatdate-time
Example Request
curl -X POST 'https://api.atmanity.us/v1/uploads' \  -H 'Content-Type: application/json' \  -d '{  "kind": "portrait"}'
Example Response
{  "uploadId": "ef523ba8-509e-47af-8e2c-5fa751596497",  "kind": "portrait",  "status": "pending",  "uploadUrl": "http://example.com",  "uploadHeaders": {    "property1": "string",    "property2": "string"  },  "maxBytes": 0,  "allowedTypes": [    "string"  ],  "expiresAt": "2019-08-24T14:15:22Z",  "uploadPageUrl": "http://example.com",  "uploadPageExpiresAt": "2019-08-24T14:15:22Z"}