tx-agent-kit
API Reference

storage Endpoints

API endpoints for the storage resource group

storage Endpoints

All endpoints require a valid Bearer token in the Authorization header.

POST /v1/storage/upload-url

Generate a presigned URL for uploading a file to R2.

Request body

FieldTypeRequiredDescription
keystringYesObject key (path) in the bucket
contentTypestringYesMIME type of the file
expiresInnumberNoURL expiry in seconds (default: 3600)

Responses

StatusDescription
200Success — returns { url: string }
400Invalid request or storage operation failed
401Unauthorized
500InternalError

POST /v1/storage/download-url

Generate a presigned URL for downloading a file from R2.

Request body

FieldTypeRequiredDescription
keystringYesObject key to download
expiresInnumberNoURL expiry in seconds (default: 3600)

Responses

StatusDescription
200Success — returns { url: string }
400Invalid request or storage operation failed
401Unauthorized
500InternalError

POST /v1/storage/delete

Delete an object from the bucket.

Request body

FieldTypeRequiredDescription
keystringYesObject key to delete

Responses

StatusDescription
200Success — returns { deleted: true }
400Invalid request or storage operation failed
401Unauthorized
500InternalError

GET /v1/storage/objects

List objects in the bucket, optionally filtered by prefix.

Parameters

NameInTypeRequiredDescription
prefixquerystringNoKey prefix filter

Responses

StatusDescription
200Success — returns { keys: string[] }
400Invalid request or storage operation failed
401Unauthorized
500InternalError

GET /v1/storage/objects/{key}/metadata

Get metadata for a specific object.

Parameters

NameInTypeRequiredDescription
keypathstringYesObject key

Responses

StatusDescription
200Success — returns { key, contentType, contentLength, lastModified, etag }
400Invalid request or storage operation failed
401Unauthorized
500InternalError

On this page