---
title: "Upload attachment file"
method: POST
path: "/api/v1/file"
tags: ["Open API"]
---

# Upload attachment file

`POST /api/v1/file`

Upload a file and get attachment_id for later use in chat/message APIs.

## Response `200`

OK

- ApiResponseUpload
  - `status` string
  - `message` string, nullable
  - `data` object
    - `attachment_id` string
    - `filename` string
    - `type` string

## Other responses

- `401` — Unauthorized
- `403` — Forbidden

## Changes

- **2026-03-09** `3d43cee2622a` — 5 breaking, 7 info
  - the response property `message` became nullable for the status `200`
  - the response property `data` became optional for the status `200`
  - the response property `status` became optional for the status `200`
  - the `status` response property const value `ok` was removed for the status `200`
  - …8 more

[Change history](https://skmtc.dev/astrbotdevs/apis/astrbot-openapi-v1/changes/api/v1/file/post.md)

---

[API](https://skmtc.dev/astrbotdevs/apis/astrbot-openapi-v1.md) · [All operations](https://skmtc.dev/astrbotdevs/apis/astrbot-openapi-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/astrbotdevs/astrbot-openapi-v1/revisions/3d43cee2622a/schema)
