Skip to main content
POST
Create a file

Authorizations

x-api-key
string
header
required

Workspace API key. Current accepted keys use the ando_sk_ prefix.

Headers

Idempotency-Key
string
required

Required idempotency key for safely retrying this write. Idempotency key.

Maximum string length: 255

Body

application/json

Create a public file upload intent. The response returns a storage upload URL; send the file bytes to that URL, then complete the upload before attaching the returned file id to a message.

content_type
string
required

Declared MIME content type.

filename
string
required

Original filename.

size_bytes
integer
required

Declared file size in bytes.

Required range: x >= 1
client_upload_id
string | null

Optional caller-generated identifier for correlating this file with the integration's local upload.

purpose
enum<string>

File purpose.

Available options:
message_attachment
sha256
string | null

Optional lowercase hex-encoded SHA-256 digest of the file bytes. SHA-256 verification is supported only when size_bytes is less than or equal to 67108864.

Maximum string length: 64

Response

Existing file upload intent for a matching idempotency key.

Public file response envelope.

data
object
required

Public file lifecycle state. Ready readable files include short-lived download instructions and can be attached to message creation with file_ids.

file_id
string
required

File identifier. Matches data.id.

Example:

"01jzn7e61x3a7v9h2r7t2m3q4p"