lumail.tokens.create
SDK 2.1.0 · API v2 · POST /api/v2/tokens
MethodPOST
/api/v2/tokens[email protected] · lumail.tokens
tokens.create(params: CreateApiTokenParams): Promise<LumailResult<CreateApiTokenResponse>>Secret returned once. Optional preset or permissions.
Body Parameters
| Name | Type | Description |
|---|---|---|
name | string | Required. Token label. |
reuseIfExists | boolean | When true, return an existing token with the same name instead of minting another. |
permissions | string[] | Explicit permission list. |
preset | "app" / "marketing" / "sender" / "full" | Permission preset. Used when permissions is omitted. |
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Token id. |
name | string | Token label. |
token | string | Full lum_ secret. Shown once. |
permissions | string[] | Granted permissions. |
createdAt | string | ISO 8601 timestamp. |
reused | boolean | true when reuseIfExists returned an existing token. |
data is the minted token. Failures return { data: null, error: { name, message, statusCode } }.