Create a share link for the file
const url = 'https://files.centralcodestation.com/api/v1/tenants/example/applications/example/files/example/shares';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"actions":["view","download"],"expires_at":"2026-10-29T09:12:33.120Z","max_downloads":10,"label":"For the printer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://files.centralcodestation.com/api/v1/tenants/example/applications/example/files/example/shares \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "actions": [ "view", "download" ], "expires_at": "2026-10-29T09:12:33.120Z", "max_downloads": 10, "label": "For the printer" }'The token is shown once.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A file id (ULID).
The Identity Server tenant id.
The Identity Server application id: a tenant application, or (platform clients) the client’s own platform application.
Header Parameters
Section titled “Header Parameters”Replays the first answer for 24 hours when the same key is sent again (1 to 200 characters).
Request Bodyrequired
Section titled “Request Bodyrequired”object
Default 7 days, at most share_link_max_days.
Example
{ "actions": [ "view", "download" ], "expires_at": "2026-10-29T09:12:33.120Z", "max_downloads": 10, "label": "For the printer"}Responses
Section titled “Responses”Created.
object
object
object
Shown once.
Example generated
{ "share_id": "example", "target": {}, "actions": [ "example" ], "expires_at": "2026-04-15T12:00:00Z", "password_protected": true, "max_downloads": 1, "downloads": 1, "access_count": 1, "last_accessed_at": "2026-04-15T12:00:00Z", "created_by": { "user_id": "example", "client_id": "example" }, "created_at": "2026-04-15T12:00:00Z", "revoked_at": "2026-04-15T12:00:00Z", "label": "example", "token": "example", "url": "example"}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, no_application_access, tenant_not_available, insufficient_scope, client_context_mismatch, files_access_not_granted, missing_action, folder_managed.
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: application_not_found, not_found.
object
Stable snake_case error code.
Example
{ "status_code": 404, "error": "application_not_found", "message": "The application in the URL is not an active application of the tenant.", "path": "/api/v1/tenants/fitness-co/applications/fitness-app/files/01J9Z6S9Q5F5R6Y2W2GZ3B3K4D", "timestamp": "2026-10-22T09:12:33.120Z"}Error. error is one of: share_links_disabled.
object
Stable snake_case error code.
Example
{ "status_code": 422, "error": "share_links_disabled", "message": "Share links are switched off for the application or the tenant.", "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"}