identity.api-token.create ​
Generate a new API token for the current user
Generate a new API token for the current user.
Inputs:
- actor: Cognito sub or user UUID (required)
- name: Human-readable token name, unique per user (required)
- ttl_seconds: Optional short-lived token lifetime, 60 seconds..365 days
- expires_at: Optional explicit expiry timestamp; mutually exclusive with ttl_seconds
Outputs (terminal state_data):
- token_uuid: public uuid of the persisted row
- name
- token: plaintext token — returned ONCE, never retrievable again
- created_at
- expires_at: Optional expiry timestamp for short-lived tokens
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-identity |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
actor | string | Yes | — | — |
organization_uuid | uuid | No | — | — |
name | string | Yes | — | — |
ttl_seconds | integer | No | — | — |
expires_at | datetime | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
token_uuid | string | Yes | — | — |
name | string | Yes | — | — |
token | string | Yes | — | — |
temporary_view_token | string | Yes | — | — |
created_at | string | Yes | — | — |
expires_at | datetime | No | — | — |
actor | string | Yes | — | — |
organization_uuid | uuid | No | — | — |
user_uuid | string | No | — | — |
plaintext_token | string | No | — | — |
token_hash | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | generate | — |
generating | No | No | — | persist | — |
persisting | No | No | — | complete | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | generate | generating | — |
generating | persist | persisting | — |
persisting | complete | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "identity.api-token.create",
"initial_data": {
"actor": "value",
"name": "value"
}
}