---
title: "Presign a file upload"
method: POST
path: "/upload-url"
tags: ["Uploads"]
---

# Presign a file upload

`POST /upload-url`

## Request

- Base URL: `https://api.autumn.ai`
- URL: `https://api.autumn.ai/upload-url`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`
  - HTTP bearer

Presign a .csv, .txt, .md or .markdown upload. PUT the bytes to upload_url with no auth headers, then POST /validate-upload.

## Request body

- UploadRequest
  - `task_id` string, required: The task the file belongs to.
  - `filename` string, required: A .csv, .txt, .md or .markdown file name.

## Response `200`

Presigned upload target.

- UploadUrlResponse
  - `upload_url` string, required: PUT the file bytes here with no Autumn auth headers.
  - `key` string, required
  - `filename` string, required

## Other responses

- `400`: `invalid_request`: The request is invalid. Fix the field in `param` (see `detail`), or read `message`.
- `401`: `unauthorized`: Missing or invalid credentials. Send your full API key as `X-API-Key: <key>` or `Authorization: Bearer <key>`.
- `422`: `invalid_request`: a field failed validation. `param` names it; `detail` is the validator output.
- `429`: `rate_limited`: Too many requests. Wait `retry_after` seconds, then send the request again.
- `503`: `auth_unavailable`: Key verification is temporarily unavailable. Wait `retry_after` seconds, then send the request again.

---

[API](https://skmtc.dev/autumn-ai/apis/autumn-task-api.md) - [All operations](https://skmtc.dev/autumn-ai/apis/autumn-task-api/llms.txt) - [OpenAPI document](https://skmtc.dev/autumn-ai/apis/autumn-task-api/revisions/78fb43699783?raw)
