Webhook intake
Every task type has its own webhook URL. Post any JSON object to it from a form tool, a helpdesk or a no-code flow, and it becomes a task.
The URL is the credential#
Create the URL in the app, on the task type or under API & webhooks, then Webhooks. It looks like this:
https://api.tasktohuman.com/v1/hooks/tth_hook_…- The token in it (
tth_hook_…) is the credential: no API key is sent. Treat the whole URL like a password. - It is shown once. Making a new one in the app stops the old one at once.
- Tasks created through it are always live and use the task type's chain, callback URL and deadline.
Map the JSON to fields#
You send whatever shape your tool produces. On the task type, map the title and each field to a dot path into that JSON:
| Mapping | Path in the posted JSON |
|---|---|
| title | subject |
order_id | ticket.order |
customer_email | ticket.customer.email |
- A number in a path picks an array element:
items.0.name. - A field without a mapping takes the top-level property with the same key:
amountabove needs no mapping. - Numbers and booleans sent to text fields become text (
4822becomes"4822"), because many tools send everything as one or the other. - No expressions or transformations: what the path finds is what the field gets. The result is checked like any payload.
curl https://api.tasktohuman.com/v1/hooks/$TTH_WEBHOOK_TOKEN \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ticket-8812" \
-d '{
"subject": "Refund request for order #4822",
"ticket": {
"id": 8812,
"order": 4822,
"customer": {
"email": "marta@example.com"
}
},
"amount": 249
}'const response = await fetch(`https://api.tasktohuman.com/v1/hooks/${process.env.TTH_WEBHOOK_TOKEN}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "ticket-8812",
},
body: JSON.stringify({
subject: "Refund request for order #4822",
ticket: {
id: 8812,
order: 4822,
customer: {
email: "marta@example.com",
},
},
amount: 249,
}),
});
const body = await response.json();
console.log(response.status, body);import os
import requests
response = requests.post(
f"https://api.tasktohuman.com/v1/hooks/{os.environ['TTH_WEBHOOK_TOKEN']}",
headers={
"Idempotency-Key": "ticket-8812",
},
json={
"subject": "Refund request for order #4822",
"ticket": {
"id": 8812,
"order": 4822,
"customer": {
"email": "marta@example.com",
},
},
"amount": 249,
},
timeout=10,
)
print(response.status_code, response.json())HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Location: /v1/tasks/01a1e3a7-6cee-70ef-995d-129e212beeb0
{
"id": "01a1e3a7-6cee-70ef-995d-129e212beeb0",
"state": "notified",
"task_type": "approve_refund",
"title": "Refund request for order #4822",
"test": false,
"owner": {
"id": "01a1dcba-b57a-7aa2-b6b1-05d81545c2ba",
"name": "Ana"
},
"expires_at": null,
"created_at": "2026-11-16T09:19:22.8621873Z",
"finished_at": null,
"escalations": 0,
"decision": null
}The task's payload is now {"order_id": "4822", "amount": 249, "customer_email": "marta@example.com"} and its title Refund request for order #4822.
Open steps#
When the task type has open steps, the posted JSON also says who answers each one. On the task type, map the target approver for step N (approver.<N>, for example approver.2) to the path that holds the human's email address or id:
| Mapping | Path in the posted JSON |
|---|---|
approver.1 | ticket.account_manager.email |
- The value must be a string: an id (a UUID) names that human, anything else is read as an email address of exactly one active human of the workspace.
- For an open step that needs several approvals, the path can hold an array of addresses or ids, one per person (for example
["marta@example.com", "ben@example.com"]). An element that is not a non-empty string is refused withapprover_unknown, never left out. - There is no default path: an open step without a mapping, or whose path finds nothing, refuses the call with
400 validation_failedandapprover_required. The other approver codes apply as on the API. - Approver problems are reported under
errorsby mapping target:approver.<N>for step N (for exampleerrors["approver.2"]), since the webhook sends noapproverslist.
Rules#
- The body must be a JSON object: anything else is
400 request_body_invalid. UnlikePOST /v1/tasks, unknown properties are fine: the sender's shape isn't yours to define. Idempotency-Keyworks as on the API: a retry with the same key and body returns the same task. See Idempotency.- Each URL has its own allowance of requests per minute. An unknown token answers
404 not_foundand counts against your IP address's limit of failed attempts. See Rate limits. - The response is the same task object as
POST /v1/tasksreturns.