Buckets

/api/v1 operations for buckets. See HTTP API for authentication, the error envelope, and rate limits.

Operations

GET /api/v1/buckets

List buckets

Returns the organization's non-deleted storage buckets. Responses never include a credential; issue one with the credentials operation.

Auth: API key required.

Operation ID: listBuckets

Responses:

CLI: khotan buckets list

POST /api/v1/buckets

Create a bucket

Provisions a Khotan-managed storage bucket synchronously and responds 201 with the persisted record whether setup ends ready or failed; branch on the returned status. A bucket is a private folder subtree in your organization's file storage, reached through the Files API with a scoped key. Supply an idempotencyKey to make retries safe — a retry carrying the same key returns the original bucket instead of creating a second one; without a key, every call creates a new bucket.

Auth: API key required.

Operation ID: createBucket

Request body (application/json, required):

Responses:

CLI: khotan buckets create

GET /api/v1/buckets/{bucketId}

Get a bucket

Returns one storage bucket's record, including status and failure state when present. Responses never include a credential; issue one with the credentials operation.

Auth: API key required.

Operation ID: getBucket

Path parameters:

Responses:

CLI: khotan buckets get

DELETE /api/v1/buckets/{bucketId}

Delete a bucket

Empties the bucket's folder subtree (deleting its objects), revokes its scoped credentials, then soft-deletes the record — the same semantics as deleting from the dashboard. Deletion is permanent. Returns 403 resource_protected when the bucket has deletion protection enabled; protection can only be removed from the dashboard.

Auth: API key required.

Operation ID: deleteBucket

Path parameters:

Responses:

CLI: khotan buckets delete

PUT /api/v1/buckets/{bucketId}/tags

Set a bucket's tags

Replaces a bucket's tag list with the submitted list and returns the stored list. Tags are normalized to lowercase slugs, so Live is stored as live. Send an empty list to remove every tag. Requires an API key whose role is owner or developer.

Auth: API key required.

Operation ID: setBucketTags

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan buckets tags set

POST /api/v1/buckets/{bucketId}/credentials

Issue bucket credentials

Issues a folder-scoped API key for the bucket and returns its secret once. The key acts only through the Files API and only within the bucket's folder subtree — send it as Authorization: Bearer against the Files API. Each call rotates the credential: any previously issued key for this bucket is revoked. The secret is shown once and is not retrievable afterward. The response filesApiBaseUrl already includes /api/v1 — append paths such as /files/... directly; do not append another /api/v1.

Auth: API key required.

Operation ID: issueBucketCredentials

Path parameters:

Responses:

CLI: khotan buckets credentials

DELETE /api/v1/buckets/{bucketId}/credentials

Revoke bucket credentials

Revokes the bucket's live folder-scoped API key and clears the stored secret without minting a replacement. Subsequent Files API calls with the revoked key fail authentication. Issue a new key with POST /api/v1/buckets/{bucketId}/credentials when one is needed again.

Auth: API key required.

Operation ID: revokeBucketCredentials

Path parameters:

Responses: