HydraCore
API by router

Workflows

Query Workflows Internal

Query workflow records. Called by agent runtime via platform skill. Auth: Bearer proxy key.

GET
/internal/v1/instances/{instance_id}/workflows

Path Parameters

instance_idInstance Id
Formatuuid

Query Parameters

customer_id?Customer Id
workflow_type?Workflow Type
status?Status
reference?Reference
page?Page
Default1
Range1 <= value
per_page?Per Page
Default20
Range1 <= value <= 100

Response 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.

POST
/internal/v1/instances/{instance_id}/workflows

Path Parameters

instance_idInstance Id
Formatuuid
assigned_to?Assigned To
customer_idCustomer Id
Formatuuid
expires_at?Expires At
instance_id?Instance Id
next_action_at?Next Action At
reference?Reference

External reference (property ref, job ref, etc.)

stage?Stage

Initial stage

title?Title
workflow_state?Workflow State
workflow_typeWorkflow Type

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.

GET
/internal/v1/instances/{instance_id}/workflows/{workflow_id}

Path Parameters

instance_idInstance Id
Formatuuid
workflow_idWorkflow Id
Formatuuid

Response 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.

PATCH
/internal/v1/instances/{instance_id}/workflows/{workflow_id}

Path Parameters

instance_idInstance Id
Formatuuid
workflow_idWorkflow Id
Formatuuid
actionAction

Audit action name (e.g. 'escalated', 'approved', 'contacted_tier2')

action_detail?Action Detail
actor?Actor
approver_id?Approver Id
assigned_to?Assigned To
escalation_level?Escalation Level
expires_at?Expires At
next_action_at?Next Action At
stage?Stage

New stage

status?Status

New status: ('active', 'awaiting_approval', 'paused', 'suspended', 'completed', 'expired', 'cancelled', 'failed')

workflow_state?Workflow State

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.

POST
/internal/v1/instances/{instance_id}/workflows/{workflow_id}/resume

Path Parameters

instance_idInstance Id
Formatuuid
workflow_idWorkflow Id
Formatuuid
resume_data?Resume Data

Data 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.

POST
/internal/v1/instances/{instance_id}/workflows/{workflow_id}/suspend

Path Parameters

instance_idInstance Id
Formatuuid
workflow_idWorkflow Id
Formatuuid
payload?Payload

Arbitrary state payload to preserve for resume

stepStep

Step name to suspend at

Lengthlength <= 100

Response 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.

GET
/v1/workflows
AuthorizationBearer <token>

In: header

Query Parameters

customer_id?Customer Id
workflow_type?Workflow Type
status?Status
page?Page
Default1
Range1 <= value
per_page?Per Page
Default20
Range1 <= value <= 100

Header Parameters

X-Api-Key?X-Api-Key

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.

GET
/v1/workflows/suspended
AuthorizationBearer <token>

In: header

Header Parameters

X-Api-Key?X-Api-Key

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.

GET
/v1/workflows/{workflow_id}
AuthorizationBearer <token>

In: header

Path Parameters

workflow_idWorkflow Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

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.

POST
/v1/workflows/{workflow_id}/abort
AuthorizationBearer <token>

In: header

Path Parameters

workflow_idWorkflow Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key

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.

POST
/v1/workflows/{workflow_id}/resume
AuthorizationBearer <token>

In: header

Path Parameters

workflow_idWorkflow Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key
resume_data?Resume Data

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.

POST
/v1/workflows/{workflow_id}/suspend
AuthorizationBearer <token>

In: header

Path Parameters

workflow_idWorkflow Id
Formatuuid

Header Parameters

X-Api-Key?X-Api-Key
payload?Payload

Arbitrary state payload to preserve for resume

stepStep

Step name to suspend at

Lengthlength <= 100

Response 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"
    }
  ]
}