Create Token
Mint a lum_ token. The secret is returned once.
MethodPOST
/api/v2/tokensMints a lum_ token. The secret is returned once. Permission: tokens.
Use either preset or permissions, not both. reuseIfExists defaults to true.
Body Parameters
| Name | Type | Description |
|---|---|---|
name | string | Required. Token label. Min 1, max 100. |
reuseIfExists | boolean | Return an existing token with the same name instead of minting. Default true. |
permissions | string[] | Explicit scopes: subscribers, audience, campaigns, send, workflows, emails, analytics, settings, domains, tokens, or *. |
preset | "app" | "marketing" | "sender" | "full" | Permission preset. Do not combine with permissions. |
Presets: app = subscribers + emails + audience. marketing adds campaigns, analytics, workflows. sender adds send. full is *.
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Token id. |
name | string | Token label. |
token | string | Full lum_... secret. Returned once. |
permissions | string[] | Granted scopes. |
createdAt | string | ISO 8601 created timestamp. |
reused | boolean | true when an existing token was returned. |
Errors
| Status | name | When |
|---|---|---|
| 401 | missing_api_key | Missing or invalid bearer token |
| 403 | missing_permission | Token lacks the tokens permission, or cannot mint the requested scopes |
| 422 | validation_error | Invalid name, or both preset and permissions |