Skip to main content

Async API

Submit Task

Path

POST /workflows/<TASK_NAME>/submit

Request Body

{
"params" : {}, // your task command
"notification": { // optional, to receive notification CTA on completion
"projectId": "...",
"miniappPackageId": "...",
"actions": [
{
"deeplink": "...",
"mobileDeeplink": "..."
}
]
}
}

cURL Example

curl --location '{BASE_URL}/workflows/<TASK_NAME>/submit' \
--header 'Authorization: Bearer <USER_TOKEN>' \
--header 'x-app-authorization: Bearer <CLIENT_TOKEN>' \
--header 'platform: website' \
--header 'x-touchpoint: <touchpoint>' \
--data '{
"params": {},
"notification": {},
}'

Get Result

Path

GET /workflows/<TASK_NAME>/<TASK_ID>/result

Response Body

{
"status" : "success",
"response" : {
"id" : "", // task id
"status" : "ACCEPTED | IN_PROGRESS | COMPLETED | FAILED",
"result" : {}, // task result
"progress" : {
"percent" : 64,
"estimatedSecondsLeft" : 110
},
"usage": { // Details of the used credits, if any
"credits": 10
}
}
}

cURL Example

curl --location '{BASE_URL}/workflows/<TASK_NAME>/{taskId}/result' \
--header 'Authorization: Bearer <USER_TOKEN>' \
--header 'x-app-authorization: Bearer <CLIENT_TOKEN>'