Skip to main content
POST
/
messages
/
{messageId}
/
attachments
cURL
curl --request POST \
  --url https://api.useanima.sh/v1/messages/{messageId}/attachments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filename": "<string>",
  "mimeType": "<string>",
  "sizeBytes": 1
}
'
{
  "id": "<string>",
  "filename": "<string>",
  "mimeType": "<string>",
  "sizeBytes": 1,
  "storageKey": "<string>",
  "url": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "detectedMimeType": "<string>"
}

Authorizations

Authorization
string
header
required

JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer

Path Parameters

messageId
string
required

ID of the message to attach the file to

Pattern: ^[0-9A-HJKMNP-TV-Z]{26}$

Body

application/json

Request body for initiating a file attachment upload

filename
string
required

Filename for the attachment (max 255 characters)

Required string length: 1 - 255
mimeType
string
required

MIME type of the file being uploaded

Minimum string length: 1
sizeBytes
integer
required

File size in bytes (must be greater than zero)

Required range: x >= 0

Response

200 - application/json

OK

File attachment associated with a message

id
string
required

Unique identifier of the attachment

Pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
filename
string
required

Original filename of the attachment

mimeType
string
required

MIME type of the attachment (e.g. application/pdf)

sizeBytes
integer
required

File size in bytes

Required range: x >= 0
storageKey
string
required

Internal storage key for retrieving the file

url
string<uri> | null
required

Pre-signed download URL, or null if not yet generated

createdAt
string<date-time>
required

Timestamp when the attachment was created

scanStatus
enum<string>
required

Content-scan verdict. BLOCKED attachments cannot be downloaded — inspect before fetching bytes.

Available options:
PENDING,
CLEAN,
FLAGGED,
BLOCKED
detectedMimeType
string | null
required

MIME type inferred from magic bytes; may differ from the declared mimeType