Skip to main content
POST
/
v3
/
upload
Upload File
curl --request POST \
  --url https://api.edenai.run/v3/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form expires_in_days=30 \
  --form purpose=general
{
  "created_at": "2025-12-08T10:30:00Z",
  "expires_at": "2026-01-07T10:30:00Z",
  "file_id": "550e8400-e29b-41d4-a716-446655440000",
  "file_mimetype": "application/pdf",
  "file_name": "invoice.pdf",
  "file_size": 1048576,
  "metadata": {
    "page_count": 5
  },
  "purpose": "general"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

File to upload

expires_in_days
integer
default:30

Expiration in days (1-30)

Required range: 1 <= x <= 30
purpose
string
default:general

Purpose of the file

Required string length: 1 - 50

Response

Successful Response

Response for a successful file upload.

file_id
string<uuid>
required

Unique file identifier for use in API calls

file_name
string
required

Original filename

file_size
integer
required

File size in bytes

file_mimetype
string
required

Detected MIME type

purpose
string
required

Purpose of the file (e.g., 'general', 'assistants')

created_at
string<date-time>
required

Upload timestamp

metadata
Metadata · object

File metadata (e.g., page_count for PDFs/documents)

expires_at
string<date-time> | null

Expiration timestamp