GET/v1/files

List files

Lists file metadata for the authenticated user in the selected Workspace. Use page and limit to paginate the results, or use ids[] to request specific files; ids[] cannot be combined with either parameter and returns a single page. IDs that do not resolve to visible files are omitted.

6 parameters
pagestringoptional
Opaque cursor from a prior response's `next_page`, prefixed with `page_`. Use it to fetch a subsequent page.
ids[]array<string>optional
Restricts results to files whose IDs are in the list. Accepts at most 100 entries after de-duplication, cannot be combined with `page` or `limit`, and returns a single page; IDs that do not resolve to visible files are omitted.
limitintegeroptional
Number of files per page, from 1 to 1000. Defaults to 20 when omitted.
Default:20
anthropic-versionstringoptional
The version of the Claude API to use.
x-api-keystringoptional
API key used to authenticate the request and access services; send this header with API requests.
anthropic-workspace-idstringoptional
Workspace ID to select when the credential can act on multiple Workspaces. A credential tied to one Workspace can omit it; if supplied, it must match that Workspace.

17 status codes
200Returns a `data` array of file metadata objects and a `next_page` cursor, which is null when no further results are available.
dataarray<FileMetadataSchema>required
List of file metadata objects.
next_pagestringoptional
Opaque cursor for the next page. Supply as `?page=` to fetch the next page; null when there are no more results.
400Returned when the request contains an invalid argument.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
401Returned when the request does not have valid authentication credentials.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
403Returned when the caller does not have permission to perform the operation.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
404Returned when a requested entity is not found.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
408Returned when the operation's deadline expires before completion.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
409Returned when a concurrency issue aborts the operation.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
412Returned when the operation is rejected because the system is not in the required state.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
413Returned when the operation is attempted beyond a valid range.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
429Returned when a resource is exhausted, such as when rate limits are reached.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
431Returned when request metadata is too large.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
499Returned when the client cancels the operation.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
500Returned when an internal server error occurs.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
501Returned when the operation is not implemented or supported.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
503Returned when the service is unavailable.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
504Returned when an upstream service does not respond in time.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error
529Returned when the service is temporarily overloaded.
errorobjectrequired
request_idstringrequired
Default:null
typestringrequired
Default:error

Error handling

A 400 is returned for an invalid argument; a 401 for invalid authentication; a 403 when the caller lacks permission; a 404 when a requested entity is not found; a 408 when the deadline expires; and a 409 when a concurrency issue aborts the operation. A 412 is returned when a precondition is not met; a 413 when an operation exceeds a valid range; a 429 when a resource is exhausted; a 431 when request metadata is too large; a 499 when the client cancels the operation; a 500 for an internal error; a 501 when the operation is unsupported; a 503 when the service is unavailable; a 504 when an upstream service times out; and a 529 when the service is overloaded. ids[] accepts at most 100 entries after de-duplication and cannot be combined with page or limit; limit must be between 1 and 1000.