---
title: "POST /v2/messages/{message_id}/attachments"
method: POST
path: "/v2/messages/{message_id}/attachments"
tags: ["attachments", "messages"]
---

# POST /v2/messages/{message_id}/attachments

`POST /v2/messages/{message_id}/attachments`

(for draft only) upload a file to server and add attachment reference to the draft.

## Path parameters

- `message_id` string, required

## Response `201`

File uploaded sucessfully. Backend sends back attachment's temp_id.

- object
  - `temp_id` string — attachment's temporary id. temp_id exists as long as message has 'draft' status.

## Other responses

- `400` — bad request
- `401` — Unauthorized
- `404` — Not Found
- `413` — Request entity too large
- `415` — Unsupported media type

---

[API](https://skmtc.net/caliopen/apis/caliopen-http-rest-api.md) · [All operations](https://skmtc.net/caliopen/apis/caliopen-http-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/caliopen/caliopen-http-rest-api/revisions/f32b5d08284d/schema)
