Assign a tenant to a storage account (platform administrators)
const url = 'https://files.centralcodestation.com/api/v1/platform/tenants/example/storage-account';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"storage_account_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://files.centralcodestation.com/api/v1/platform/tenants/example/storage-account \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "storage_account_id": "example" }'The tenant’s new objects go to the account from now on; its existing objects stay where they are and keep being served from there. Move them with a storage migration. Audited.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The Identity Server tenant id.
Request Bodyrequired
Section titled “Request Bodyrequired”object
An account id, or default (or null) for the platform storage.
Example generated
{ "storage_account_id": "example"}Responses
Section titled “Responses”Success.
object
The account assigned to the tenant (default: the platform storage).
Where new objects go now: the assigned account, or a running migration’s target.
The tenant’s versions per account they live in.
object
Originals and renditions.
Example generated
{ "tenant_id": "example", "storage_account_id": "example", "write_storage_account_id": "example", "migration_id": "example", "objects": [ { "storage_account_id": "example", "versions": 1, "bytes": 1 } ]}Error. error is one of: invalid_request.
object
Stable snake_case error code.
Example
{ "status_code": 400, "error": "invalid_request", "message": "The request is malformed: a required field is missing, a value has the wrong type or format, or a field the route does not accept was sent", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: invalid_token.
object
Stable snake_case error code.
Example
{ "status_code": 401, "error": "invalid_token", "message": "The bearer token is missing, malformed, expired, signed by an unknown key, or has the wrong audience (`aud` must be `files-api`).", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: not_tenant_member, tenant_not_available, insufficient_scope, client_context_mismatch, files_access_not_granted, platform_admin_required.
object
Stable snake_case error code.
Example
{ "status_code": 403, "error": "not_tenant_member", "message": "The user is not an active member of the tenant in the URL.", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: not_found, storage_account_not_found.
object
Stable snake_case error code.
Example
{ "status_code": 404, "error": "not_found", "message": "An id in the path is malformed, or the route does not exist.", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: storage_account_not_verified, storage_migration_in_progress.
object
Stable snake_case error code.
Example
{ "status_code": 409, "error": "storage_account_not_verified", "message": "The storage account failed its last verification, so no tenant can be assigned to it or migrated onto it.", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: storage_adapter_not_allowed.
object
Stable snake_case error code.
Example
{ "status_code": 422, "error": "storage_adapter_not_allowed", "message": "This deployment cannot use the requested storage adapter or location (a directory outside the allowed roots, a directory account where the deployment does not allow one, an endpoint on a private or link-local address).", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: rate_limited.
object
Stable snake_case error code.
Example
{ "status_code": 429, "error": "rate_limited", "message": "Too many requests in the current window; `retry_after` (and the `Retry-After` header) says when to retry.", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: identity_unavailable.
object
Stable snake_case error code.
Example
{ "status_code": 503, "error": "identity_unavailable", "message": "The service could not reach the Identity Server and has no fresh cached answer.", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}default
Section titled “default”Error: see error for the code.
object
Stable snake_case error code.
Example
{ "status_code": 403, "error": "invalid_request", "message": "This client is not bound to this tenant/application", "path": "/api/v1/tenants/t1/applications/a1/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D"}