Upload File

post/v1/files?beta=true

Headers

anthropic-betastring

Optional header to specify the beta version(s) you want to use.

To use multiple betas, use a comma separated list like beta1,beta2 or specify the header multiple times for each beta.

Optional header to specify the beta version(s) you want to use.

To use multiple betas, use a comma separated list like beta1,beta2 or specify the header multiple times for each beta.

anthropic-versionstring

The version of the Claude API you want to use.

Read more about versioning and our version history here.

The version of the Claude API you want to use.

Read more about versioning and our version history here.

anthropic-workspace-idstring

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Response

Successful Response

created_atstring date-time required

RFC 3339 datetime string representing when the file was created.

downloadableboolean

Whether the file can be downloaded.

expires_atstring date-time nullable

RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with expires_in_seconds, this is the upload time plus that value.

filenamestring required

Original filename of the uploaded file.

idstring required

Unique object identifier.

The format and length of IDs may change over time.

mime_typestring required

MIME type of the file.

size_bytesinteger required

Size of the file in bytes.

type'file' required

Object type.

For files, this is always "file".

Example response

{
  "created_at": "2025-04-15T18:37:24.100435Z",
  "expires_at": "2025-05-15T18:37:24.100435Z",
  "filename": "document.pdf",
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "mime_type": "application/pdf",
  "size_bytes": 102400
}

Changes