Presign a file upload
curl --request POST \
--url https://api.autumn.ai/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "<string>",
"filename": "accounts.csv"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_id: '<string>', filename: 'accounts.csv'})
};
fetch('https://api.autumn.ai/upload-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.autumn.ai/upload-url"
payload = {
"task_id": "<string>",
"filename": "accounts.csv"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"upload_url": "<string>",
"key": "<string>",
"filename": "<string>"
}{
"error": "invalid_request",
"message": "The request is invalid. Fix the field in `param` (see `detail`), or read `message`.",
"retryable": false,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c"
}{
"error": "unauthorized",
"message": "Missing or invalid credentials. Send your full API key as `X-API-Key: <key>` or `Authorization: Bearer <key>`.",
"retryable": false,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c"
}{
"error": "invalid_request",
"message": "prompt: Field required",
"retryable": false,
"param": "prompt",
"detail": [
{
"type": "missing",
"loc": [
"body",
"prompt"
],
"msg": "Field required"
}
],
"request_id": "req_3f9c2a1b0d4e5f6a7b8c"
}{
"error": "rate_limited",
"message": "Too many requests. Wait `retry_after` seconds, then send the request again.",
"retryable": true,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c",
"retry_after": 10
}{
"error": "auth_unavailable",
"message": "Key verification is temporarily unavailable. Wait `retry_after` seconds, then send the request again.",
"retryable": true,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c",
"retry_after": 5
}Uploads
Presign a file upload
Presign a .csv, .txt, .md or .markdown upload. PUT the bytes to upload_url with no auth headers, then POST /validate-upload.
POST
/
upload-url
Presign a file upload
curl --request POST \
--url https://api.autumn.ai/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "<string>",
"filename": "accounts.csv"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_id: '<string>', filename: 'accounts.csv'})
};
fetch('https://api.autumn.ai/upload-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.autumn.ai/upload-url"
payload = {
"task_id": "<string>",
"filename": "accounts.csv"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"upload_url": "<string>",
"key": "<string>",
"filename": "<string>"
}{
"error": "invalid_request",
"message": "The request is invalid. Fix the field in `param` (see `detail`), or read `message`.",
"retryable": false,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c"
}{
"error": "unauthorized",
"message": "Missing or invalid credentials. Send your full API key as `X-API-Key: <key>` or `Authorization: Bearer <key>`.",
"retryable": false,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c"
}{
"error": "invalid_request",
"message": "prompt: Field required",
"retryable": false,
"param": "prompt",
"detail": [
{
"type": "missing",
"loc": [
"body",
"prompt"
],
"msg": "Field required"
}
],
"request_id": "req_3f9c2a1b0d4e5f6a7b8c"
}{
"error": "rate_limited",
"message": "Too many requests. Wait `retry_after` seconds, then send the request again.",
"retryable": true,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c",
"retry_after": 10
}{
"error": "auth_unavailable",
"message": "Key verification is temporarily unavailable. Wait `retry_after` seconds, then send the request again.",
"retryable": true,
"request_id": "req_3f9c2a1b0d4e5f6a7b8c",
"retry_after": 5
}Authorizations
ClerkSessionApiKeyHeaderBearerApiKey
A signed-in platform session; only the upload routes accept it.
Body
application/json