Create a bearer token
Exchanges Auth Key credentials for a scoped bearer token.
https://api2.transloadit.com/ tokenThis is the OAuth 2.0 token endpoint. Headless clients exchange their Auth Key and
Auth Secret for a short-lived Bearer token with the client_credentials grant, handled
directly by the Transloadit API. MCP clients that
connected by URL redeem the
authorization code from the Console consent screen with the authorization_code grant
(PKCE S256, no HTTP Basic credentials) and rotate the resulting refresh token with the
refresh_token grant.
At /token, OAuth grant errors for authorization_code and refresh_token use the standard
error and error_description body. Rate limits return RATE_LIMIT_REACHED (429), and
unexpected internal failures return SERVER_500 (500). Malformed requests rejected
before the grant is identified can receive an HTTP Basic challenge (401), or
TOKEN_INVALID_REQUEST if Basic credentials were supplied.
Client-credentials tokens are minted server-side using your Auth Key/Secret. If you expose token
creation via a UI, call /token from your backend (never directly from the browser).
Canceled Workspaces cannot create new bearer tokens. For endpoints whose documentation explicitly allows reads after cancellation, use the signed read recipe with an existing active Auth Key instead. Billing has its own signed billing recipe.
Requests must use application/x-www-form-urlencoded; the client_credentials grant also needs HTTP Basic Auth:
In a trusted server-side shell with curl and jq, set TRANSLOADIT_KEY and TRANSLOADIT_SECRET to your Auth Key and Auth Secret. Keep both credentials and the resulting token secret; never run this setup in browser code.
This example requests Assembly read/write access and saves the returned access_token as TRANSLOADIT_TOKEN for subsequent requests in the same shell. For another endpoint, use its listed scopes instead; the Auth Key must already grant them. Endpoints authenticated by an Auth Key or bearer token include the appropriate token setup in their request examples.
if ! TOKEN_RESPONSE="$(curl --fail-with-body -sS \
--request POST \
--url 'https://api2.transloadit.com/token' \
--user "${TRANSLOADIT_KEY:?Set TRANSLOADIT_KEY}:${TRANSLOADIT_SECRET:?Set TRANSLOADIT_SECRET}" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'aud=api2' \
--data-urlencode 'scope=assemblies:read assemblies:write')"; then
printf '%s\n' "$TOKEN_RESPONSE" >&2
exit 1
fi
TRANSLOADIT_TOKEN="$(printf '%s' "$TOKEN_RESPONSE" |
jq -er '.access_token | strings | select(length > 0)')" || exit 1
Authentication
HTTP Basic authentication with your Auth Key and secret is required for the following grant_type values: client_credentials. Other supported values do not need account credentials. Do not send an Authorization header for those requests; their grant-specific proof is still required.
Form fields
Content type: application/x-www-form-urlencoded
The following fields may be sent at most once: aud, client_assertion, client_assertion_type, client_id, code, code_verifier, grant_type, redirect_uri, refresh_token, resource, scope.
Complete JSON Schema
OAuth 2.0 token request form for the client-credentials, authorization-code and refresh-token grants.
Fields beyond those listed for this object are accepted.
| Field | Type and description |
|---|---|
aud | stringOptional audience value for |
client_assertion | stringA JWT signed with one of the client’s published keys (RFC 7523), from clients whose metadata allows |
client_assertion_type | stringAlways |
client_id | stringThe client identifier from dynamic registration or the HTTPS URL of the client’s metadata document. Required for |
code | stringThe one-time authorization code delivered to the client’s redirect URI after consent. Required for |
code_verifier | stringThe PKCE code verifier whose SHA-256 digest was sent as |
grant_typerequired | "authorization_code" | "client_credentials" | "refresh_token"Which OAuth 2.0 grant to run. |
redirect_uri | stringThe redirect URI used in the authorization request. Required for |
refresh_token | stringThe refresh token to rotate. Required for |
resource | stringThe protected resource the token is for: the hosted MCP endpoint ( |
scope | stringOptional, space- or comma-separated list of scopes for |
Using the token
Pass the token as Authorization: Bearer <access_token> on API requests. When a request is
authenticated with a valid Bearer token, API2 treats
Signature Authentication as satisfied and
skips signature validation. Signature Authentication is enforced only for key/secret requests.
Scope checks still apply. The default api2 audience is accepted by regular API2 endpoints and is
valid for 21,600 seconds by default. The mcp audience is accepted by the MCP server, which relays it
to API2 with a service credential; it is rejected by regular API2 endpoints when presented directly, and valid for
604,800 seconds by default. Treat the response’s expires_in value as authoritative.
Response
Here’s an example response body:
{
"access_token": "opaque-token",
"expires_in": 21600,
"scope": "assemblies:read assemblies:write",
"token_type": "Bearer"
}2xx success
JSON response body. application/json
Response body schema
Complete JSON Schema
The response contains only the fields listed for this object.
| Field | Type and description |
|---|---|
access_tokenrequired | string (minimum length: 1)The token to send in the Authorization header of subsequent API requests. Keep it secret. |
expires_inrequired | integer (exclusive minimum: 0)Token lifetime in seconds from issuance. Request a new token after it expires. |
refresh_token | string (minimum length: 1)Returned by the |
scoperequired | string (minimum length: 1, maximum length: 512)Space-separated scopes granted to this token. Validation pattern (regular expression)^(?:read|write|auth_keys:write|auth_keys:read|assemblies:write|assemblies:read|assembly_notifications:write|dam:read|dam:write|template_credentials:read|template_credentials:write|billing:read|queues:read|smart_cdn:sign|templates:read|templates:write|storage_grants:write)(?: (?:read|write|auth_keys:write|auth_keys:read|assemblies:write|assemblies:read|assembly_notifications:write|dam:read|dam:write|template_credentials:read|template_credentials:write|billing:read|queues:read|smart_cdn:sign|templates:read|templates:write|storage_grants:write))*$ |
token_typerequired | string (always: "Bearer") |
HTTP 400
JSON response body. application/json
Response body schema
Complete JSON Schema
Any of the following schemas may apply:
error: "GET_ACCOUNT_UNKNOWN_AUTH_KEY"
Could not get workspace, this is an unknown Auth Key.
The response may contain additional fields.
error: "TOKEN_INVALID_GRANT_TYPE"
Invalid grant type.
The response may contain additional fields.
error: "TOKEN_INVALID_REQUEST"
Invalid token request.
The response may contain additional fields.
required properties: error
The response may contain additional fields.
| Field | Type and description |
|---|---|
errorrequired | stringAn RFC 6749, 7591 or 8707 error code such as Validation pattern (regular expression)^(?:access_denied|invalid_client|invalid_client_metadata|invalid_grant|invalid_redirect_uri|invalid_request|invalid_scope|invalid_target|server_error|unauthorized_client|unsupported_grant_type)$ |
error_description | stringA human-readable explanation that never names an account. |
HTTP 401
JSON response body. application/json
Response body schema
Complete JSON Schema
Any of the following schemas may apply:
error: "SERVER_401"
Authorization required.
The response may contain additional fields.
error: "TOKEN_INVALID_CREDENTIALS"
Invalid client credentials.
The response may contain additional fields.
required properties: error
The response may contain additional fields.
| Field | Type and description |
|---|---|
errorrequired | stringAn RFC 6749, 7591 or 8707 error code such as Validation pattern (regular expression)^(?:access_denied|invalid_client|invalid_client_metadata|invalid_grant|invalid_redirect_uri|invalid_request|invalid_scope|invalid_target|server_error|unauthorized_client|unsupported_grant_type)$ |
error_description | stringA human-readable explanation that never names an account. |
HTTP 403
JSON response body. application/json
Response body schema
Complete JSON Schema
Any of the following schemas may apply:
error: "TOKEN_INVALID_AUDIENCE"
Invalid audience.
The response may contain additional fields.
error: "TOKEN_INVALID_SCOPE"
Invalid or unauthorized scope.
The response may contain additional fields.
HTTP 429
JSON response body. application/json
Response body schema
Complete JSON Schema
Request limit reached.
The response may contain additional fields.
HTTP 500
JSON response body. application/json
Response body schema
Complete JSON Schema
Unexpected error.
The response may contain additional fields.