List Files

get/v1/files?beta=true

Query parameters

pagestring nullable

Opaque page cursor returned in a prior list response's next_page. Prefixed page_.

Opaque page cursor returned in a prior list response's next_page. Prefixed page_.

ids[]string[] nullable

Restrict the result set to Files whose id is in this list. At most 100 entries (after de-duplication). Mutually exclusive with page and limit. When supplied, the response is always a single page (next_page is null). IDs that do not resolve to a visible File — including deleted Files — are silently omitted.

Restrict the result set to Files whose id is in this list. At most 100 entries (after de-duplication). Mutually exclusive with page and limit. When supplied, the response is always a single page (next_page is null). IDs that do not resolve to a visible File — including deleted Files — are silently omitted.

limitinteger

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

scope_idstring

Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).

Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).

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.

x-api-keystring

Your unique API key for authentication.

This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the Console. Each key is scoped to a Workspace.

Your unique API key for authentication.

This key is required in the header of all API requests, to authenticate your account and access Anthropic's services. Get your API key through the Console. Each key is scoped to a Workspace.

Response

Successful Response

next_pagestring nullable

Opaque cursor for the next page. Supply as ?page= to fetch the next page; null when there are no more results.

Example response

{
  "data": [
    {
      "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

Changed in 4 of the 67 revisions of this API.67

  • ef8360d7d2b654See the full diff
    • deleted the query request parameter after_id

      request-parameter-removed

    • deleted the query request parameter before_id

      request-parameter-removed

    • removed the optional property first_id from the response with the 200 status

      response-optional-property-removed

    • removed the optional property has_more from the response with the 200 status

      response-optional-property-removed

    • removed the optional property last_id from the response with the 200 status

      response-optional-property-removed

    • added the new optional query request parameter ids[]

      new-optional-request-parameter

    • added the new optional query request parameter page

      new-optional-request-parameter

    • added the optional property data/items/expires_at to the response with the 200 status

      response-optional-property-added

    • added the optional property next_page to the response with the 200 status

      response-optional-property-added

    This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • removed the optional property data/items/expires_at from the response with the 200 status

      response-optional-property-removed

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the optional property data/items/expires_at to the response with the 200 status

      response-optional-property-added

    • added the new optional query request parameter scope_id

      new-optional-request-parameter

    • added the optional property data/items/scope to the response with the 200 status

      response-optional-property-added