Skip to main content
POST
/
v1
/
files
curl -X POST https://api.dari.dev/v1/files \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -F "file=@ticket.txt"
{
  "id": "file_456",
  "filename": "ticket.txt",
  "size_bytes": 1842
}

Documentation Index

Fetch the complete documentation index at: https://docs.dari.dev/llms.txt

Use this file to discover all available pages before exploring further.

Uploads a file that can later be referenced from message parts by file_id. Deployments enforce a maximum upload size. Larger uploads return 413.

Headers

Authorization
string
required
Bearer token using your Dari API key.
Content-Type
string
required
Must be multipart/form-data

Request Body

file
file
required
File to upload.

Response Fields

id
string
Uploaded file ID.
filename
string
Normalized leaf filename from the upload. Path components are stripped.
size_bytes
integer
File size in bytes.
curl -X POST https://api.dari.dev/v1/files \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -F "file=@ticket.txt"
{
  "id": "file_456",
  "filename": "ticket.txt",
  "size_bytes": 1842
}