Skip to content
Proud to collaborate with Microsoft for Startups

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 ​

PropertyValue
Workflow typeLinear
LibraryApp-identity
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
actorstringYes——
organization_uuiduuidNo——
namestringYes——
ttl_secondsintegerNo——
expires_atdatetimeNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
token_uuidstringYes——
namestringYes——
tokenstringYes——
temporary_view_tokenstringYes——
created_atstringYes——
expires_atdatetimeNo——
actorstringYes——
organization_uuiduuidNo——
user_uuidstringNo——
plaintext_tokenstringNo——
token_hashstringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—generate—
generatingNoNo—persist—
persistingNoNo—complete—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
initiatedgenerategenerating—
generatingpersistpersisting—
persistingcompletecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "identity.api-token.create",
  "initial_data": {
    "actor": "value",
    "name": "value"
  }
}