---
title: "POST /messages/{messageId}/attachments"
method: POST
path: "/messages/{messageId}/attachments"
---

# POST /messages/{messageId}/attachments

`POST /messages/{messageId}/attachments`

## Request

- Base URL: `https://api.useanima.sh/v1`
- URL: `https://api.useanima.sh/v1/messages/{messageId}/attachments`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Path parameters

- `messageId` string, required: ID of the message to attach the file to

## Request body

- object: Request body for initiating a file attachment upload
  - `filename` string, required: Filename for the attachment (max 255 characters)
  - `mimeType` string, required: MIME type of the file being uploaded
  - `sizeBytes` integer, required: File size in bytes (must be greater than zero)

## Response `200`

OK

- object: File attachment associated with a message
  - `id` string, required: Unique identifier of the attachment
  - `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
  - `storageKey` string, required: Internal storage key for retrieving the file
  - `url` string, uri, nullable, required: Pre-signed download URL, or null if not yet generated
  - `createdAt` string, date-time, required: Timestamp when the attachment was created
  - `scanStatus` 'PENDING' | 'CLEAN' | 'FLAGGED' | 'BLOCKED', required: Content-scan verdict. BLOCKED attachments cannot be downloaded — inspect before fetching bytes.
  - `detectedMimeType` string, nullable, required: MIME type inferred from magic bytes; may differ from the declared mimeType

---

[API](https://skmtc.dev/useanima/apis/anima-api.md) · [All operations](https://skmtc.dev/useanima/apis/anima-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useanima/apis/anima-api/revisions/aaa148188980?raw)
