TasksAll pages

Tasks

A task is one request to a person. Create it, follow it through its states, read the decision, list your tasks or cancel one.

Create a task#

POST /v1/tasks creates a task from one of your task types, notifies the first human of its chain and answers 201 Created with the task and a Location header.

PropertyTypeDescription
task_typestring, requiredThe task type's key, in the key's workspace.
titlestringUp to 200 characters. Defaults to the task type's name. Not encrypted and shown in emails: keep sensitive data out of it.
payloadobjectThe task type's fields, up to 64 KB. Validated against the task type: see fields.
callback_urlstringA public https URL that receives the outcome. Defaults to the task type's callback URL. See Callbacks.
deadline_minutesinteger1 to 525600 (a year). When it passes, the task type's default action applies. Defaults to the task type's deadline; none when neither sets one.
ownerstring (uuid)A human of the workspace who takes the first step instead of the one the chain names. The step's wait and the backups stay.
approversarrayOnly for a task type with open steps: the people of each one, one entry per person (at most 100). See below.
chainarrayOnly for a task type that allows it: this task's own chain, replacing the task type's. See below.
urgencystringnormal (the default) or high. A high-urgency task is marked in the app and its email subjects start with "[Urgent]"; it never changes a timer. Anything else is a 400 with urgency_invalid. A routing rule may set it too.
curl https://api.tasktohuman.com/v1/tasks \
  -H "Authorization: Bearer $TTH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-4821" \
  -d '{
    "task_type": "approve_refund",
    "title": "Refund €249 to order #4821?",
    "payload": {
      "order_id": "4821",
      "amount": 249,
      "reason": "Arrived damaged",
      "customer_email": "marta@example.com"
    },
    "deadline_minutes": 120
  }'
201 response
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Location: /v1/tasks/01a1e3a7-6489-7106-aa3a-c976287f9999

{
  "id": "01a1e3a7-6489-7106-aa3a-c976287f9999",
  "state": "notified",
  "task_type": "approve_refund",
  "title": "Refund €249 to order #4821?",
  "test": false,
  "owner": {
    "id": "01a1dcba-b57a-7aa2-b6b1-05d81545c2ba",
    "name": "Ana"
  },
  "expires_at": "2026-11-16T11:19:20.7134083Z",
  "created_at": "2026-11-16T09:19:20.7134083Z",
  "finished_at": null,
  "escalations": 0,
  "decision": null
}
curl https://api.tasktohuman.com/v1/tasks \
  -H "Authorization: Bearer $TTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task_type": "approve_refund",
    "data": {
      "order_id": "4821"
    }
  }'
400 response
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Some fields need your attention.",
  "status": 400,
  "code": "validation_failed",
  "errors": {
    "data": [
      {
        "code": "unknown_property",
        "message": "This property isn't part of the request. Check its spelling against the API reference."
      }
    ]
  },
  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Payload values are checked against the task type's fields; each problem is named as payload.<field>, never with its value:

curl https://api.tasktohuman.com/v1/tasks \
  -H "Authorization: Bearer $TTH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task_type": "approve_refund",
    "payload": {
      "order_id": "4821",
      "amount": "249"
    }
  }'
400 response
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Some fields need your attention.",
  "status": 400,
  "code": "validation_failed",
  "errors": {
    "payload.amount": [
      {
        "code": "field_invalid",
        "message": "This value doesn't match the field's type."
      }
    ]
  },
  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Name the approvers of open steps#

A task type can leave a step's human open. approvers then names the people of each open step, one entry per person, by id or by email address:

Request body
{
  "task_type": "approve_refund",
  "payload": { "order_id": "4822", "amount": 249 },
  "approvers": [
    { "step": 1, "email": "marta@example.com" },
    { "step": 3, "human": "0199c1a4-6d2e-7b7a-9f43-2f1c6a1d8e55" }
  ]
}
PropertyDescription
stepThe step's number in the task type's chain, from 1. GET /v1/task-types lists each task type's steps and which ones are open; an open consensus step also shows approvals_needed and max_approvers.
humanThe human's id (GET /v1/humans, or the Humans page of the app). Prefer ids: they name exactly one record and don't change when an address does.
emailInstead of human: the email address of exactly one active human of the workspace. Naming an address never adds a human.
  • Every open step is named, and no other step: nobody overrides a step whose human the task type sets. A single open step takes exactly one entry.
  • An open consensus step (with approvals_needed) takes between approvals_needed and max_approvers entries, one per person, each a different person (not the same human twice, nor two human records with the same address or the same linked member). The order you list them in is the order the task shows them. Nobody named this way can decide alone. For example, for step 1 needing 2 approvals: [{ "step": 1, "email": "marta@example.com" }, { "step": 1, "human": "<id>" }].
  • A step that chooses from a group takes a member of that group: GET /v1/humans?group=<group id> lists them.
  • The same human may be named for several steps.
  • approvers holds at most 100 entries.
  • The human must be able to be asked: active, with an address that is not marked undeliverable. Anyone else is refused, rather than accepted and skipped.
  • Approvers are checked only once the rest of the request is valid, so fix the other errors first.
  • With a test key the task runs its first step only, so only an open first step needs an approver.
  • A retry with the same Idempotency-Key and body returns the original task without checking any of this again.

Problems are reported as 400 validation_failed under errors, as approvers or approvers.<position> (from 0). A human that is not a UUID, or a step that is not a number, is a malformed body: 400 request_body_invalid, as for owner.

CodeWhen
approver_requiredAn open step has no approver, or an open consensus step has fewer valid people than it needs. The message names the steps and how many people they need.
approver_not_allowedThe step is not open, or doesn't exist. Also when approvers is sent to a task type without open steps.
approver_duplicateA single open step is named more than once, or the same person is named twice for a consensus step.
approver_unknownNot exactly one human of this workspace who can be asked: an unknown id or address, an archived human, one whose address is marked undeliverable, a human of another workspace, an address two humans share, an address that is not in the step's group, or an entry with both or neither of human and email. The answer is the same in every case; the message names the step.
approver_not_in_groupThe human, named by id, isn't a member of the step's group.
approver_group_emptyThe step's group has fewer people who can be asked than the step needs (one, or the approvals needed). Add people to the group first.
approvers_too_manyMore than 100 entries (approvers), or more people for a consensus step than its max_approvers (approvers.<position> of the first one too many).

Send your own chain#

A task type can let each task bring its own chain: tick Let whoever creates a task through the API replace this chain for that task in its chain settings (plan feature routing.chain_override). GET /v1/task-types shows it as chain_override: true. chain then replaces the task type's whole chain for that one task:

Request body
{
  "task_type": "approve_refund",
  "payload": { "order_id": "4822", "amount": 249 },
  "chain": [
    { "human": "0199c1a4-6d2e-7b7a-9f43-2f1c6a1d8e55", "wait_seconds": 3600 },
    {
      "approvers": [{ "email": "cfo@example.com", "can_decide_alone": true }, { "human": "0199c1a4-7f10-7c2b-8d11-5e2a7b3c9d01" }],
      "approvals_needed": 2,
      "wait_seconds": 86400,
      "remind": false
    }
  ]
}
PropertyDescription
human / emailA step that asks one person: the human's id (prefer ids), or the email address of exactly one active human of the workspace. One of the two.
approversA consensus step instead: 2 to 10 different people, each { "human": … } or { "email": … }, optionally with "can_decide_alone": true.
approvals_neededA consensus step: how many approvals decide it, from 2 to the number of people. Approval task types only.
wait_secondsRequired: how long the step waits before the task moves on, from your plan's minimum (limit.min_step_wait_seconds) to 604800 (7 days).
remindA reminder at half the wait. Defaults to true.
  • 1 to 10 steps, checked exactly like a chain saved in the app, and against your plan: more steps than limit.chain_steps is 403 plan_limit_reached, more than one step without routing.backup or a consensus step without routing.quorum is 403 feature_not_in_plan.
  • Only fixed people: no open steps. approvers and owner are refused with chain (approver_not_allowed, owner_not_allowed_with_chain).
  • The task type's default action, deadline and time to finish still apply; the task type's own steps, open or not, play no part.
  • People are checked like approvers, only once the rest of the request is valid: someone who isn't exactly one human of this workspace who can be asked is approver_unknown, whatever the reason.
  • With a test key the task runs the first step of your chain only, and notifies you as usual.
  • chain is part of the request body: a retry with the same Idempotency-Key and another chain is 409 idempotency_conflict.
  • The task's chain then shows in the app as set when the task was created; the task and its callbacks look like any other task.

Problems are reported as 400 validation_failed under errors, as chain, chain.<step>.<property> or chain.<step>.approvers.<position> (all from 0). A human that is not a UUID is a malformed body: 400 request_body_invalid.

CodeWhen
chain_override_not_allowedThe task type doesn't allow its chain to be replaced (chain).
steps_invalidNo step, or more than 10 (chain).
step_wait_invalidwait_seconds missing, below your plan's minimum or over 7 days.
human_invalidA step with both or neither of human and email, or with both one person and approvers.
approvers_invalidA consensus step with fewer than 2 or more than 10 people, an entry with both or neither of human and email, or the same person twice (also two human records with the same address or linked member).
approvals_needed_invalidapprovals_needed below 2 or above the number of people.
quorum_approval_onlyA consensus step on a follow-up task type (chain).
approver_unknownNot exactly one human of this workspace who can be asked.

States#

stateMeaning
notifiedWaiting for the current step's human. owner says who that is.
acknowledgedFollow-ups only: someone said "I've got it" and is working on it.
resolvedA person decided. decision says what.
expiredNobody decided: the chain ran out, the deadline passed, or nobody could be notified. decision.automatic is true.
cancelledYou (or a member in the app) cancelled it.

resolved, expired and cancelled are final: neither you nor the humans can change a finished task. One exception: at your request, TaskToHuman support can reopen a cancelled task, or an expired one that ended without a decision (decision.action is expired). It goes back to notified, and when it finishes again it sends a new callback with a new TTH-Event-Id.

The decision#

Once a task is finished it has a decision:

PropertyDescription
actionapproved, rejected, edited (approved with changes), done (a follow-up was completed), handed_back, expired or cancelled.
byThe human who decided (id, name), or null when no person did.
atWhen, in UTC.
automatictrue when no person decided: an expiry or the task type's default action.
reasonWhy a task expired: chain_exhausted, deadline, no_owner, handed_back or support (TaskToHuman support ended it at your request); otherwise null.
commentWhat the human wrote, if anything.
payloadThe edited values of an edited approval; otherwise null.
fieldsThe human inputs the person filled in (key to value). Only on GET /v1/tasks/{id}, cancel and the callback, when there are any.
attachmentsThe files the person sent (id, field, name, size, content_type, sha256, url, removed, removed_at, removed_reason). Download one with GET /v1/tasks/{id}/attachments/{attachment id} and the workspace's API key. A file removed to fit the storage allowance has removed: true and its download answers 410 attachment_removed (removed files). Only on GET /v1/tasks/{id}, cancel and the callback.

Consensus steps#

When the task's current or final step is a consensus step, the task also has a quorum object (it is absent on every other task). owner is then the step's first person, and decision.by the person whose answer completed the decision.

PropertyDescription
neededHow many approvals decide the step.
approvals, rejectionsThe answers so far.
outcomeOnce finished: met (N approvals), override (a person who can decide alone chose to decide for everyone), rejected (approval became impossible) or not_met (the task ended another way); null while open.
answersEvery person asked, in order: by (id, name), override (true once this person decided for everyone, false for an ordinary vote; unanswered, true when they can decide alone, and on a finished task when they could decide alone and did not answer), answer (approved, rejected or null), at and comment. Comments follow the rule of decision.comment: on GET /v1/tasks/{id}, cancel and the callback, null in lists.

A task type's default action can finish an unanswered task as approved or rejected. Its state is then expired and decision.automatic is true. Act on a decision only when automatic is false, unless you chose that default on purpose.

Get a task#

GET /v1/tasks/{id} returns one task with its payload and, once decided, the decision with the human's comment and any edited values. Use it when you can't receive callbacks, or to check. It also returns payload_sha256: the SHA-256 of the payload JSON as TaskToHuman stored it, the value the task's audit trail records. Keep it if you may need to prove later which payload a decision was about.

curl https://api.tasktohuman.com/v1/tasks/01a1e3a7-6489-7106-aa3a-c976287f9999 \
  -H "Authorization: Bearer $TTH_API_KEY"
200 response: still waiting
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "01a1e3a7-6489-7106-aa3a-c976287f9999",
  "state": "notified",
  "task_type": "approve_refund",
  "title": "Refund €249 to order #4821?",
  "test": false,
  "owner": {
    "id": "01a1dcba-b57a-7aa2-b6b1-05d81545c2ba",
    "name": "Ana"
  },
  "expires_at": "2026-11-16T11:19:20.713Z",
  "created_at": "2026-11-16T09:19:20.713Z",
  "finished_at": null,
  "escalations": 0,
  "decision": null,
  "payload": {
    "order_id": "4821",
    "amount": 249,
    "reason": "Arrived damaged",
    "customer_email": "marta@example.com"
  },
  "payload_sha256": "77d21b5d074a3fa4dca6ed88891f798696041c64eca3e26e7d5d3a7f91d747ef"
}

A task of another workspace or mode, one older than your task history, or one an owner or admin deleted, answers 404 not_found.

List tasks#

GET /v1/tasks returns the key's tasks, newest first and then by id, without payloads or comments: { "data": [ … ] }.

Query parameterDescription
statenotified, acknowledged, resolved, expired or cancelled. Anything else is a 400.
task_typeA task type key. An unknown key gives an empty list.
created_after, created_beforeISO 8601 times.
finished_afterAn ISO 8601 time: only finished tasks, see below.
cursorThe next_cursor of the page before, see below.
limit1 to 100, default 50 (with expand=details: 1 to 25, default 25).
expanddetails, only with finished_after: each task in full, see below.
curl "https://api.tasktohuman.com/v1/tasks?state=notified&task_type=approve_refund&limit=2" \
  -H "Authorization: Bearer $TTH_API_KEY"
200 response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "data": [
    {
      "id": "01a1e3a7-6489-7106-aa3a-c976287f9999",
      "state": "notified",
      "task_type": "approve_refund",
      "title": "Refund €249 to order #4821?",
      "test": false,
      "owner": {
        "id": "01a1dcba-b57a-7aa2-b6b1-05d81545c2ba",
        "name": "Ana"
      },
      "expires_at": "2026-11-16T11:19:20.713Z",
      "created_at": "2026-11-16T09:19:20.713Z",
      "finished_at": null,
      "escalations": 0,
      "decision": null
    }
  ]
}

Page through the list#

When more tasks match than limit, the answer has a next_cursor. Send it as cursor, with the same filters, for the next page; go on until an answer has no next_cursor: that is the last page.

TEXT
GET /v1/tasks?state=resolved&limit=100
GET /v1/tasks?state=resolved&limit=100&cursor=<next_cursor of the answer before>

Every task comes once: two tasks created at the same instant are told apart by id, and a task created while you page sorts before the pages you already read, so it neither repeats nor hides another. Treat the cursor as opaque and keep the filters the same from page to page. A cursor that is not one gives an empty list. If you never send cursor you get the first page, as before.

Tasks finished since a time#

Every task carries finished_at: when it was resolved, expired or cancelled, and null while it is open. To poll for decisions when you can't receive callbacks, send finished_after: the list then holds only finished tasks whose finished_at is at or after that time, oldest finished first, then by id.

TEXT
GET /v1/tasks?finished_after=2026-11-16T09:00:00Z&limit=50

This list is paged the same way: when more tasks match than limit, the answer has a next_cursor; send it as cursor, with the same filters, for the next page. It is left out on the last page. Two tasks that finished at the same instant are both returned, each once, even when a page ends between them.

For the next poll, send as finished_after the latest finished_at you have seen minus a safety margin, for example one minute, and skip the ids you already handled in that window. Don't poll from the exact latest time: finished_at is taken a moment before the task is saved, so a task can show up in the list shortly after another one with a later finished_at, and a poll that starts at the latest time seen would never return it.

Count a task as finished only when its finished_at is set and its state is resolved, expired or cancelled; ignore any other item in the answer, and read a missing next_cursor as the last page only when every item passed that check.

The list has no payload, comment or edited values. Add expand=details to get each task exactly as GET /v1/tasks/{id} returns it (payload, payload_sha256, the decision's comment, fields and attachments), so a poll needs no extra request per task. With it a page holds at most 25 tasks (a larger limit is brought down to 25), and expand works only together with finished_after: otherwise, or with any other value, the answer is a 400 validation_failed.

TEXT
GET /v1/tasks?finished_after=2026-11-16T09:00:00Z&expand=details
curl "https://api.tasktohuman.com/v1/tasks?finished_after=2026-11-16T09:00:00Z&expand=details&limit=1" \
  -H "Authorization: Bearer $TTH_API_KEY"
200 response: each task as GET /v1/tasks/{id} returns it
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "data": [
    {
      "id": "01a1e3a7-6489-7106-aa3a-c976287f9999",
      "state": "resolved",
      "task_type": "approve_refund",
      "title": "Refund €249 to order #4821?",
      "test": false,
      "owner": null,
      "expires_at": "2026-11-17T09:19:20.713Z",
      "created_at": "2026-11-16T09:19:20.713Z",
      "finished_at": "2026-11-16T09:19:54.377Z",
      "escalations": 0,
      "decision": {
        "action": "approved",
        "by": {
          "id": "01a1dcba-b57a-7aa2-b6b1-05d81545c2ba",
          "name": "Ana"
        },
        "at": "2026-11-16T09:19:54.377Z",
        "automatic": false,
        "reason": null,
        "comment": "Photos confirm the damage.",
        "payload": null,
        "attachments": []
      },
      "payload": {
        "order_id": "4821",
        "amount": 249,
        "reason": "Arrived damaged",
        "customer_email": "marta@example.com"
      },
      "payload_sha256": "77d21b5d074a3fa4dca6ed88891f798696041c64eca3e26e7d5d3a7f91d747ef",
      "urgency": "normal",
      "tags": []
    }
  ],
  "next_cursor": "639304175943770000.01a1e3a764897106aa3ac976287f9999"
}

Cancel a task#

POST /v1/tasks/{id}/cancel cancels an open task. The humans notified so far are told, and the callback is sent with decision.action: "cancelled".

curl -X POST https://api.tasktohuman.com/v1/tasks/01a1e3a7-6cee-70ef-995d-129e212beeb0/cancel \
  -H "Authorization: Bearer $TTH_API_KEY"
200 response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "01a1e3a7-6cee-70ef-995d-129e212beeb0",
  "state": "cancelled",
  "task_type": "approve_refund",
  "title": "Refund request for order #4822",
  "test": false,
  "owner": null,
  "expires_at": null,
  "created_at": "2026-11-16T09:19:22.862Z",
  "finished_at": "2026-11-16T09:19:30.777Z",
  "escalations": 0,
  "decision": {
    "action": "cancelled",
    "by": null,
    "at": "2026-11-16T09:19:30.7778539Z",
    "automatic": false,
    "reason": null,
    "comment": null,
    "payload": null
  },
  "payload": {
    "order_id": "4822",
    "amount": 249,
    "customer_email": "marta@example.com"
  },
  "payload_sha256": "c039eb0d560cb51766cf4a79e918bb20fb9985d39019df3338182d872199434a"
}

Cancelling a finished task is a 409 task_already_finished with its state and action, so you can tell what happened instead:

curl -X POST https://api.tasktohuman.com/v1/tasks/01a1e3a7-6cee-70ef-995d-129e212beeb0/cancel \
  -H "Authorization: Bearer $TTH_API_KEY"
409 response
HTTP/1.1 409 Conflict
Content-Type: application/problem+json

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
  "title": "This task is already finished.",
  "status": 409,
  "code": "task_already_finished",
  "state": "cancelled",
  "action": "cancelled",
  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

What not to send in clear#

  • The title is not encrypted and appears in notification emails. Put order numbers there, not account numbers.
  • Fields the task type marks sensitive never appear in emails, previews or logs; they are shown only on the task page.
  • The whole payload is encrypted at rest.