Tasks
List a sender's tasks, complete them with outcomes, cancel them, understand expiry, and build a task inbox.
curl "$SEQ/v1/tasks?sender=u_42&status=open" -H "Authorization: Bearer $KEY"
curl "$SEQ/v1/senders/u_42/tasks" -H "Authorization: Bearer $KEY" # open tasks by default
curl $SEQ/v1/tasks/tsk_01J9… -H "Authorization: Bearer $KEY"
curl -X POST $SEQ/v1/tasks/tsk_01J9…/complete -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"outcome":"connected","note":"Booked a demo for Thursday."}'
curl -X POST $SEQ/v1/tasks/tsk_01J9…/cancel -H "Authorization: Bearer $KEY"The task
| Field | Meaning |
|---|---|
id, kind, title, body, link | what to show; title, body and link were rendered when the task was created |
dueAt, expiresAt | on the sender's calendar; after expiresAt the task expires and the step takes no_answer |
status | open, done, expired, cancelled |
outcome, note, completedAt | set on completion |
dialer, dialerPushedAt | whether the number was pushed to the sender's Allo queue, and when |
enrollmentId, contactId, senderId | the links; join with GET /v1/contacts/{id} for the contact card |
Listing
GET /v1/tasks (scope read) filters by sender, status, kind, contact and updated_since, paginated. GET /v1/senders/{id}/tasks is the same scoped to one sender, status=open by default. For a per-user inbox, poll the sender's open tasks or mirror task.created and task.expired events into your own table.
Completing
POST /v1/tasks/{id}/complete (scope enroll) with { outcome, note? }. The outcome is free text, 1 to 32 characters, matched against the node's branches_by_outcome; anything else takes completed. The waiting run closes on the outcome, the enrollment advances at once, and the signals the outcome implies are recorded: task_completed always, call_connected when the outcome is in the node's connected_outcomes, connection_accepted for linkedin_connect + accepted, a LinkedIn reply for linkedin_message + replied. Completing a task that is not open returns it unchanged, so a double click is harmless.
Call tasks with dialer: true complete themselves when Allo reports the call; a manual completion that arrives first wins, the later one is ignored. See The task node.
Cancelling and expiry
POST /v1/tasks/{id}/cancel marks an open task cancelled and the step takes no_answer. A task nobody completes expires at expiresAt (due + 7 days unless the node sets expire): the run closes on timeout, the flow takes no_answer, and task.expired is delivered. An exit of the enrollment cancels its open task.
Building a task inbox
- Subscribe an endpoint to
task.createdandtask.expired, or pollGET /v1/tasks?updated_since=. - Store the task id, kind, title, body, link, due date, contact and sender; render
kindwith your own label and icon. - Offer the outcomes the node defines (
branches_by_outcomekeys plus a generic "done") and callcomplete; offer "skip" and callcancel. - For calls, let the rep dial from Allo and let auto-completion do the rest; show the note Allo wrote.
- Read
signal.receivedwithkind: "task_completed"to update the row when a task was completed elsewhere.