---
title: "Upload an attachment"
method: POST
path: "/attachment/v1/upload"
tags: ["Attachments"]
---

# Upload an attachment

`POST /attachment/v1/upload`

## Request

- Base URL: `https://api.langdock.com`
- URL: `https://api.langdock.com/attachment/v1/upload`
- Auth: HTTP bearer

Upload a file that can be referenced in Agent conversations.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: The file to upload

## Response `200`

Successfully uploaded file

- object
  - `attachmentId` string, uuid, required: Unique identifier for the uploaded attachment
  - `file` object, required
    - `name` string, required: Original filename
    - `mimeType` string, required: MIME type of the file
    - `sizeInBytes` integer, required: Size of the file in bytes

## Other responses

- `400`: Invalid upload request or file validation failed
- `401`: Invalid API key
- `403`: API key does not have the required scope
- `406`: File type not allowed
- `413`: File exceeds the size limit
- `429`: Rate limit exceeded
- `500`: Internal server error

## Changes

- **2026-11-03** `c62bf90b4013`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langdock/apis/langdock-api/changes/attachment/v1/upload/post.md)

---

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