---
title: "Create Assistant Attachment Upload"
method: POST
path: "/api/v1/assistant-attachments"
tags: ["authed"]
---

# Create Assistant Attachment Upload

`POST /api/v1/assistant-attachments`

## Request

- Base URL: `https://api.teaflask.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.teaflask.com/api/v1/assistant-attachments`
- Auth: none declared

Step one: declare the file, get back the attachment id and the
presigned PUT to send the bytes to. The row lands (and commits) before
the URL goes out; an upload that never finishes is swept after its
TTL.

## Request body

- CreateAttachmentUploadRequest
  - `filename` string, required
  - `byte_size` integer, required

## Response `201`

Successful Response

- CreateAttachmentUploadResponse
  - `attachment` AssistantAttachmentResponse, required
    - `id` string, uuid, required
    - `kind` 'image' | 'document' | 'video' | 'audio' | 'file', required: The assistant_attachments kind CHECK's closed set.
    - `format` string, nullable, required
    - `filename` string, required
    - `byte_size` integer, required
    - `ready` boolean, required
  - `upload_url` string, required
  - `upload_url_expires_in_seconds` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `413`: The file is over the size cap
- `422`: Validation error
- `500`: Internal server error
- `503`: Attachments not configured

---

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