data.identity.api-token.persist ​
Insert a UserApiToken row from a pre-hashed token
Insert a new UserApiToken row from a pre-hashed token.
Input: user_uuid (required), token_hash (required), name (required), expires_at (optional). Output in state_data: token_uuid, name, created_at, expires_at, persisted.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-identity |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
user_uuid | uuid | Yes | — | — |
token_hash | string | Yes | — | SHA-256 hex digest of the plaintext token (64 chars) |
name | string | Yes | — | — |
expires_at | datetime | No | — | — |
replaces_token_uuid | string | No | — | — |
actor | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
token_uuid | uuid | Yes | — | — |
name | string | Yes | — | — |
created_at | string | Yes | — | — |
expires_at | datetime | No | — | — |
persisted | boolean | Yes | — | — |
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 |
|---|---|---|---|---|---|
pending | Yes | No | — | complete | Persist API token |
completed | No | Yes | Yes | — | Persisted |
failed | No | Yes | No | — | Persist failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | complete | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "data.identity.api-token.persist",
"initial_data": {
"user_uuid": "value",
"token_hash": "value",
"name": "value"
}
}