---
title: "Get a one-time URL to upload a file to"
method: POST
path: "/v1/inboxes/{id}/attachment-uploads"
tags: ["Messages"]
---

# Get a one-time URL to upload a file to

`POST /v1/inboxes/{id}/attachment-uploads`

## Request

- Base URL: `https://anjal.app`
- URL: `https://anjal.app/v1/inboxes/{id}/attachment-uploads`
- Auth: API key in header `X-API-Key`

For attaching a real file without putting its bytes in a request an agent
has to write out. Returns an `uploadUrl`. `PUT` the raw file to it with no
API key, then attach it by passing `{ "uploadId": "..." }` in `attachments`
on a send, reply, reply-all, forward or draft call. One file, up to 10 MB,
valid for 60 minutes, and single-use in both directions: it can be uploaded
to once and attached once.

## Request body

- object
  - `filename` string, required
  - `contentType` string
  - `sizeBytes` integer: If known, so an oversized file is refused before upload.

## Response `201`

Upload slot created

- object
  - `uploadId` string, uuid
  - `uploadUrl` string, uri
  - `expiresAt` string, date-time
  - `maxBytes` integer
  - `filename` string
  - `howTo` string

---

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