Vai al contenuto principale

task

SRPAPI Key

Returns the current result of an asynchronous task by ID. Tasks are created by mutations like send and createTask.

Arguments

ArgumentTypeRequiredDescription
idID!YesTask ID. The resolver accepts either the raw UUID or the base64-encoded GraphQL node ID.

Return Type

TaskResult

Fields

FieldTypeDescription
dataAWSJSONRaw 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.
reportTaskReportOptional 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.

Export This Article

Save a copy of this page as PDF or plain text.