Sync API
Use the Sync API only if your task completes within 20 seconds. Otherwise, the request will time out
Path
POST /workflows/<TASK_NAME>/execute
Request Body
{
"params" : {} // your task command
}
Response Body
{
"status" : "success",
"response" : {
"id" : "", // task id
"status" : "COMPLETED | FAILED",
"result" : {}, // task result
"usage": { // Details of the used credits, if any
"credits": 10, // total credits charged for this task (including charged sub-tasks)
"details": [ // per-tool breakdown
{
"toolId": "example_tool", // tool that was charged
"price": 1, // credits per single use of the tool
"amount": 1, // number of uses charged
"credits": 1 // credits charged for this entry (price × amount)
}
]
}
}
}
cURL Example
curl --location '{BASE_URL}/workflows/<TASK_NAME>/execute' \
--header 'Authorization: Bearer <USER_TOKEN>' \
--header 'x-app-authorization: Bearer <CLIENT_TOKEN>' \
--header 'platform: website' \
--header 'x-touchpoint: <touchpoint>' \
--data '{
"params": {},
}'