---
title: "Initiate Upload"
method: POST
path: "/attachments/upload"
tags: ["Attachments"]
---

# Initiate Upload

`POST /attachments/upload`

## Request

- Base URL: `https://api.aspect.inc`
- URL: `https://api.aspect.inc/attachments/upload`
- Auth: API key in header `Authorization`

Initiate an attachment upload.

Returns a temporary upload URL.
The upload must be confirmed after the file is uploaded.

## Request body

- AttachmentUploadInitRequest: API request schema for initiating an attachment upload
  - `filename` string, required: Original filename
  - `mime_type` string, required: MIME type of the file
  - `size_bytes` integer, required: File size in bytes (max 100MB)

## Response `201`

Successful Response

- AttachmentUploadInitResponse: Temporary upload URL for a new attachment. `PUT` the file bytes to `url`, then call confirm.
  - `id` string, uuid, required: Resource identifier
  - `url` string, required: Temporary URL for the upload or download
  - `url_expires_at` string, date-time, required: UTC datetime when the URL expires

## Other responses

- `422`: Validation Error

---

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