Short-lived API tokens are JWTs issued from your static API key. They have an expiration time and an optional request limit. Use them when you need to give a time-bound credential to a client (e.g. server issuing tokens for a frontend or worker) without sharing your main API key. All endpoints below require your static API key in the request (e.g.Documentation Index
Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: YOUR_API_KEY or x-api-key: YOUR_API_KEY). Short-lived tokens are available on Startup, Growth, and Enterprise plans.
Create tokens
POST /api/2/auth/tokens
Creates one or more short-lived tokens. Each token is returned once; store it securely.
Request body
You must provide at least one of the following fields.| Field | Type | Required | Description |
|---|---|---|---|
expiresIn | number | No | Lifetime in milliseconds. Min 60000 (1 min), max 86400000 (24 h). Default 3600000 (1 h). |
count | number | No | Number of tokens to create (1–25). Default 1. |
requestLimit | string | No | Max requests allowed per token. Positive integer, max 1000000. Default 5000. |
Example
Response
token value in subsequent API calls as:
List tokens
GET /api/2/auth/tokens
Returns all active short-lived tokens for your API key. The token secret is not returned.
Example
Response
Inspect one token
GET /api/2/auth/token?token=<jwt>
Returns metadata for a single short-lived token by its JWT string. Requires your static API key and the token query parameter set to the full JWT.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | The short-lived JWT to inspect. |
Example
Response
Revoke a token
DELETE /api/2/auth/tokens/:id
Revokes a short-lived token by its id. The token stops working immediately.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Token ID (UUID) returned when the token was created or from the list endpoint. |
Example
Response
Using a short-lived token on other endpoints
After creating a token, use it for any Mobula API call by sending it only in the Bearer header:x-api-key. Use Authorization: Bearer <token> only.
Authentication overview
Back to API key and short-lived token overview