Skip to main content

Overview

Files endpoints

Available Operations

List

Lists files belonging to the workspace of the authenticating API key.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
limit*int64:heavy_minus_sign:Maximum number of files to return (1–1000).100
cursor*string:heavy_minus_sign:Opaque pagination cursor from a previous response.eyJjdXJzb3IiOiJmaWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9
workspaceID*string:heavy_minus_sign:Workspace to scope the request to. Defaults to the caller’s default workspace.a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*operations.ListFilesResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Upload

Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
requestBodyoperations.UploadFileRequestBody:heavy_check_mark:N/A
workspaceID*string:heavy_minus_sign:Workspace to scope the request to. Defaults to the caller’s default workspace.a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.FileMetadata, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.ForbiddenResponseError403application/json
sdkerrors.PayloadTooLargeResponseError413application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Delete

Deletes a file owned by the requesting workspace. Deletion is irreversible.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
fileIDstring:heavy_check_mark:N/Afile_011CNha8iCJcU1wXNR6q4V8w
workspaceID*string:heavy_minus_sign:Workspace to scope the request to. Defaults to the caller’s default workspace.a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.FileDeleteResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Retrieve

Retrieves metadata for a single file owned by the requesting workspace.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
fileIDstring:heavy_check_mark:N/Afile_011CNha8iCJcU1wXNR6q4V8w
workspaceID*string:heavy_minus_sign:Workspace to scope the request to. Defaults to the caller’s default workspace.a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

*components.FileMetadata, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*

Download

Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.

Example Usage

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context:heavy_check_mark:The context to use for the request.
fileIDstring:heavy_check_mark:N/Afile_011CNha8iCJcU1wXNR6q4V8w
workspaceID*string:heavy_minus_sign:Workspace to scope the request to. Defaults to the caller’s default workspace.a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
opts[]operations.Option:heavy_minus_sign:The options for this request.

Response

io.ReadCloser, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*