task
SRPAPI Key
Returns the current result of an asynchronous task by ID. Tasks are created by mutations like send and createTask.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | Task ID. The resolver accepts either the raw UUID or the base64-encoded GraphQL node ID. |
Return Type
Fields
| Field | Type | Description |
|---|---|---|
data | AWSJSON | Raw task payload. This contains the task object as JSON, including fields such as id, title, status, created, and expires. It is retained for 90 days. |
report | TaskReport | Optional structured report output for tasks that produce report metadata. |
Example
query RetrieveTask($id: ID!) {
task(id: $id) {
data
report {
status
batchId
documents
errors
}
}
}
For send workflows, monitor report.status until it reaches COMPLETED or FAILED.
The data field is JSON, so your client needs to inspect task.data.status after parsing it when you need the raw task record. That status uses TaskStatus, for example TODO, INPROGRESS, REJECTED, or COMPLETED.
report is optional. When present, it provides a typed summary for tasks that generate a report payload.
Related
- send — returns a task ID
- createTask
- TaskResult
- TaskReport
- TaskReportStatus
- TaskStatus enum