Trigger a workflow by ID
POST /api/v1/workflows/run
POST https://api.trustverify.co.uk/api/v1/workflows/run
Request body#
| Field | Type | Description |
|---|---|---|
| workflowIdrequired | number | Numeric id of one of your saved workflows |
| inputs | object | Execution context (userId, name, companyNumber, …). An aml step reads name, dateOfBirth, country and entityType; entityType takes the same values as POST /api/v1/aml/screen `type` (omit it to screen a person; "business" or "company" screens an organisation), and any other value is a 400. So is a type sent as `type` or `subjectType` without entityType. |
| webhookUrl | string | Not called: per-request callbacks are paused, and the response carries callback "not_sent". The run result is in the response. |
Example request#
curl -sS -X POST 'https://api.trustverify.co.uk/api/v1/workflows/run' \
-H "Authorization: Bearer $TRUSTVERIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workflowId": 12,
"inputs": {}
}'Responses#
200 Workflow execution result
| Field | Type | Description |
|---|---|---|
| executionIdrequired | string | |
| workflowIdrequired | number | |
| workflowNamerequired | string | |
| statusrequired | string: "completed" | "incomplete" | "failed" | |
| resultsrequired | array of object | |
| executedAtrequired | string | |
| callback | string: "not_sent" | Present when the request carried a webhookUrl: per-request callbacks are paused and nothing was sent. The result is in this response. |
| callbackReason | string |
400 workflowId (numeric) is required / workflow inactive / an input a step reads is invalid (a non-numeric userId or transac
workflowId (numeric) is required / workflow inactive / an input a step reads is invalid (a non-numeric userId or transactionId, an unaccepted entityType, or an aml subject type sent as type or subjectType instead of entityType)