Workflows
Query Workflows Internal
Query workflow records. Called by agent runtime via platform skill. Auth: Bearer proxy key.
Path Parameters
uuidQuery Parameters
11 <= value201 <= value <= 100Response Body
curl -X GET "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows?customer_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&workflow_type=string&status=string&reference=string&page=1&per_page=20"{
"page": 0,
"per_page": 0,
"total": 0,
"workflows": [
{
"approver_id": "1b287364-14ff-4b72-8953-b40399093a6f",
"assigned_to": "string",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"escalation_level": 0,
"expires_at": "2019-08-24T14:15:22Z",
"history": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"last_action_at": "2019-08-24T14:15:22Z",
"next_action_at": "2019-08-24T14:15:22Z",
"reference": "string",
"stage": "string",
"status": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"workflow_state": {},
"workflow_type": "string"
}
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Create Workflow
Create a new workflow record. Called by agent runtime via platform skill. Auth: Bearer proxy key.
Path Parameters
uuiduuidExternal reference (property ref, job ref, etc.)
Initial stage
One of: ('lead', 'rent_arrears', 'maintenance', 'compliance_renewal', 'viewing', 'roster', 'approval', 'invoice_chase', 'onboarding', 'custom')
Response Body
curl -X POST "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e", "workflow_type": "string" }'{
"approver_id": "1b287364-14ff-4b72-8953-b40399093a6f",
"assigned_to": "string",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"escalation_level": 0,
"expires_at": "2019-08-24T14:15:22Z",
"history": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"last_action_at": "2019-08-24T14:15:22Z",
"next_action_at": "2019-08-24T14:15:22Z",
"reference": "string",
"stage": "string",
"status": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"workflow_state": {},
"workflow_type": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Get Workflow Internal
Get a single workflow record. Auth: Bearer proxy key.
Path Parameters
uuiduuidResponse Body
curl -X GET "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"approver_id": "1b287364-14ff-4b72-8953-b40399093a6f",
"assigned_to": "string",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"escalation_level": 0,
"expires_at": "2019-08-24T14:15:22Z",
"history": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"last_action_at": "2019-08-24T14:15:22Z",
"next_action_at": "2019-08-24T14:15:22Z",
"reference": "string",
"stage": "string",
"status": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"workflow_state": {},
"workflow_type": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Advance Workflow
Advance a workflow's state. Called by agent runtime via platform skill. Auth: Bearer proxy key.
Path Parameters
uuiduuidAudit action name (e.g. 'escalated', 'approved', 'contacted_tier2')
New stage
New status: ('active', 'awaiting_approval', 'paused', 'suspended', 'completed', 'expired', 'cancelled', 'failed')
Merge into existing state
Response Body
curl -X PATCH "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{ "action": "string" }'{
"approver_id": "1b287364-14ff-4b72-8953-b40399093a6f",
"assigned_to": "string",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"escalation_level": 0,
"expires_at": "2019-08-24T14:15:22Z",
"history": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"last_action_at": "2019-08-24T14:15:22Z",
"next_action_at": "2019-08-24T14:15:22Z",
"reference": "string",
"stage": "string",
"status": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"workflow_state": {},
"workflow_type": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Resume Workflow Internal
Resume a suspended workflow from the agent runtime. Auth: Bearer proxy key.
Path Parameters
uuiduuidData merged into workflow_state on resume
Response Body
curl -X POST "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/resume" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"message": "string",
"status": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Suspend Workflow Internal
Suspend a workflow from the agent runtime. Auth: Bearer proxy key.
Path Parameters
uuiduuidArbitrary state payload to preserve for resume
Step name to suspend at
length <= 100Response Body
curl -X POST "https://loading/internal/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/suspend" \ -H "Content-Type: application/json" \ -d '{ "step": "string" }'{
"id": "string",
"message": "string",
"status": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}List Workflows Dashboard
List workflow records for tenant dashboard observability. Auth: JWT (admin only). RLS scopes to tenant.
In: header
Query Parameters
11 <= value201 <= value <= 100Header Parameters
Response Body
curl -X GET "https://loading/v1/workflows?customer_id=497f6eca-6276-4993-bfeb-53cbbbba6f08&workflow_type=string&status=string&page=1&per_page=20" \ -H "X-Api-Key: string"{
"page": 0,
"per_page": 0,
"total": 0,
"workflows": [
{
"approver_id": "1b287364-14ff-4b72-8953-b40399093a6f",
"assigned_to": "string",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"escalation_level": 0,
"expires_at": "2019-08-24T14:15:22Z",
"history": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"last_action_at": "2019-08-24T14:15:22Z",
"next_action_at": "2019-08-24T14:15:22Z",
"reference": "string",
"stage": "string",
"status": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"workflow_state": {},
"workflow_type": "string"
}
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}List Suspended Workflows
List all suspended workflows for the tenant. Auth: JWT (admin only). RLS scopes to tenant.
In: header
Header Parameters
Response Body
curl -X GET "https://loading/v1/workflows/suspended" \ -H "X-Api-Key: string"[
{}
]{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Get Workflow Dashboard
Get workflow detail for tenant dashboard observability. Auth: JWT (admin only). RLS scopes to tenant.
In: header
Path Parameters
uuidHeader Parameters
Response Body
curl -X GET "https://loading/v1/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "X-Api-Key: string"{
"approver_id": "1b287364-14ff-4b72-8953-b40399093a6f",
"assigned_to": "string",
"completed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
"escalation_level": 0,
"expires_at": "2019-08-24T14:15:22Z",
"history": [],
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",
"last_action_at": "2019-08-24T14:15:22Z",
"next_action_at": "2019-08-24T14:15:22Z",
"reference": "string",
"stage": "string",
"status": "string",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"title": "string",
"updated_at": "2019-08-24T14:15:22Z",
"workflow_state": {},
"workflow_type": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Abort Workflow
Abort a workflow (transition to 'cancelled').
Preserves audit trail rather than deleting. Only allowed for non-terminal statuses. Auth: JWT (admin only). RLS scopes to tenant.
In: header
Path Parameters
uuidHeader Parameters
Response Body
curl -X POST "https://loading/v1/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/abort" \ -H "X-Api-Key: string"{
"id": "string",
"message": "string",
"status": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Resume Workflow
Resume a suspended workflow with resume data.
Picks up from suspended_step with the provided data merged into workflow_state. Auth: JWT (admin only). RLS scopes to tenant.
In: header
Path Parameters
uuidHeader Parameters
Data merged into workflow_state on resume
Response Body
curl -X POST "https://loading/v1/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/resume" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"message": "string",
"status": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Suspend Workflow
Suspend a workflow at a specific step with payload to preserve state. Auth: JWT (admin only). RLS scopes to tenant.
In: header
Path Parameters
uuidHeader Parameters
Arbitrary state payload to preserve for resume
Step name to suspend at
length <= 100Response Body
curl -X POST "https://loading/v1/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/suspend" \ -H "X-Api-Key: string" \ -H "Content-Type: application/json" \ -d '{ "step": "string" }'{
"id": "string",
"message": "string",
"status": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}