bling.refresh-token ​
Loads an existing Bling CloudConnection, exchanges its refresh_token for a fresh access/refresh pair at Bling, and persists the rotated credentials.
Rotate Bling OAuth credentials before they expire.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-bling |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization that owns the Bling connection |
connection_uuid | uuid | Yes | — | UUID of the Bling CloudConnection to refresh |
actor | string | No | — | Caller identity (defaults to context.actor) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization that owns the Bling connection |
connection_uuid | uuid | Yes | — | UUID of the Bling CloudConnection to refresh |
actor | string | No | — | Caller identity (defaults to context.actor) |
loaded_at | string | No | — | ISO-8601 timestamp the row was loaded |
refreshed_at | string | No | — | ISO-8601 timestamp the refresh round-trip completed |
new_expires_at | string | No | — | ISO-8601 expiry of the freshly-issued access_token |
persisted_at | string | No | — | ISO-8601 timestamp the rotated tokens were persisted |
completed_at | string | No | — | ISO-8601 timestamp of overall completion |
failure_reason | string | No | — | Why this run failed (on the failed branch) |
failed_at | string | No | — | ISO-8601 timestamp of failure |
_rotated_access_token | string | No | — | — |
_rotated_refresh_token | string | No | — | — |
_rotated_scope | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | json | No | — | — |
failed_layer | json | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
initiated | Yes | No | — | load_connection | Refresh request received |
loading | No | No | — | refresh | Loading connection from database |
persisting | No | No | — | complete | Writing rotated tokens |
refreshing | No | No | — | persist | Exchanging refresh_token at Bling |
completed | No | Yes | Yes | — | Bling credentials rotated |
failed | No | Yes | No | — | Bling refresh failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
initiated | load_connection | loading | — |
loading | refresh | refreshing | — |
refreshing | persist | persisting | — |
persisting | complete | completed | — |
initiated | fail | failed | — |
loading | fail | failed | — |
refreshing | fail | failed | — |
persisting | fail | failed | — |
Business Errors ​
| Code | Message Template |
|---|---|
BLING_CONNECTION_NOT_FOUND | Bling connection {connection_uuid} not found in organization |
BLING_CONNECTION_WRONG_PROVIDER | Connection {connection_uuid} is not a Bling connection |
BLING_REFRESH_FAILED | Bling refresh failed: |
BLING_PERSIST_FAILED | Persisting rotated Bling tokens failed: |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "bling.refresh-token",
"initial_data": {
"organization_uuid": "value",
"connection_uuid": "value"
}
}