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
}
}
}
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": {},
}'