subscription.key_provision ​
Provision a new integration key for the actor-seat pricing model
Provision an integration key tied to an organization subscription.
Writes happen in a single transaction on context.session so the seat-counter increment and the new IntegrationKey row commit together.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-subscription |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID |
subscription_uuid | uuid | Yes | — | OrganizationSubscription UUID |
name | string | Yes | — | Human-readable name for the key |
created_by_user_uuid | uuid | No | — | User UUID who requested the key (None for autonomous keys) |
scope | json | No | — | Optional scope dict for access control |
prefix | string | No | — | Key prefix (default: ltik) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
subscription_uuid | uuid | No | — | — |
organization_uuid | uuid | No | — | — |
integration_key_uuid | uuid | No | — | — |
plaintext_secret | string | No | — | Returned ONCE; never persisted again |
prefix | string | No | — | — |
expires_at | string | No | — | — |
key_seats_used | integer | No | — | — |
key_seats_total | integer | No | — | — |
is_delegated | boolean | No | — | — |
provisioned_at | 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 | — | — |
failed_at | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
pending | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.key_provision",
"initial_data": {
"organization_uuid": "value",
"subscription_uuid": "value",
"name": "value"
}
}