Authentication
Every request carries a workspace API key as a bearer token. Keys are live or test, see one workspace, and are shown once.
API keys#
Send the key in the Authorization header of every request, over HTTPS:
GET /v1/me HTTP/1.1
Host: api.tasktohuman.com
Authorization: Bearer tth_live_…- Create keys in the app under API & webhooks, then API keys. A key is shown once, when you create it: copy it into your system's secrets. If you lose it, revoke it and create a new one.
- A key belongs to one workspace. It creates tasks only from that workspace's task types and sees only that workspace's tasks.
- A key has a mode.
tth_live_…keys create real tasks;tth_test_…keys create test tasks that notify only you (see Test mode). A key never sees tasks of the other mode. - Revoking a key in the app makes every request that uses it fail at once.
- Keys are for servers. Never put one in a web page, a mobile app or anything else you ship to users.
Check a key#
GET /v1/me tells you which organization, workspace and mode a key belongs to. It changes nothing, so it is a good first call and a good health check.
curl https://api.tasktohuman.com/v1/me \
-H "Authorization: Bearer $TTH_API_KEY"const response = await fetch("https://api.tasktohuman.com/v1/me", {
headers: {
Authorization: `Bearer ${process.env.TTH_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);import os
import requests
response = requests.get(
"https://api.tasktohuman.com/v1/me",
headers={
"Authorization": f"Bearer {os.environ['TTH_API_KEY']}",
},
timeout=10,
)
print(response.status_code, response.json())HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"organization": {
"id": "01a1dcb7-3aaf-7b52-9557-611799ccefc1",
"name": "Lumen Outdoor"
},
"workspace": {
"id": "01a1dcb7-3ab8-7bb2-b72a-95c34c3fa302",
"name": "Shop"
},
"key": {
"id": "01a1dcbb-783e-7d6e-bcff-a162a6c70959",
"prefix": "tth_live_8KdQ2mZp",
"mode": "live"
}
}Read what your plan allows#
GET /v1/entitlements returns your organization's plan code and every feature and limit as it applies now. A feature is true or false, a limit is a whole number, and null means unlimited. Integrations use it to hide what the plan doesn't include.
curl https://api.tasktohuman.com/v1/entitlements \
-H "Authorization: Bearer $TTH_API_KEY"const response = await fetch("https://api.tasktohuman.com/v1/entitlements", {
headers: {
Authorization: `Bearer ${process.env.TTH_API_KEY}`,
},
});
const body = await response.json();
console.log(response.status, body);import os
import requests
response = requests.get(
"https://api.tasktohuman.com/v1/entitlements",
headers={
"Authorization": f"Bearer {os.environ['TTH_API_KEY']}",
},
timeout=10,
)
print(response.status_code, response.json())HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"plan": "free",
"entitlements": {
"intake.api": true,
"intake.webhook": true,
"intake.connectors": true,
"intake.mcp": false,
"intake.test_mode": true,
"limit.test_tasks_month": 10,
"limit.test_task_max_seconds": 600,
"limit.task_types": 3,
"page.link": true,
"page.actions": true,
"page.reply_actions": true,
"page.edit": false,
"page.custom_fields": false,
"page.branding": false,
"routing.owner": true,
"routing.backup": true,
"limit.chain_steps": 2,
"limit.min_step_wait_seconds": 300,
"routing.default_action": false,
"routing.completion_timer": false,
"routing.quorum": false,
"routing.approver_at_creation": false,
"routing.human_groups": false,
"routing.chain_override": false,
"routing.rota": false,
"routing.quiet_hours": false,
"routing.rules": false,
"routing.rules_advanced": false,
"limit.rules": 0,
"limit.advanced_rules": 0,
"notify.email": true,
"notify.telegram": true,
"notify.slack": true,
"notify.push": true,
"notify.fallback": true,
"notify.sms": false,
"notify.whatsapp": false,
"callback.webhook": true,
"callback.poll": true,
"limit.history_days": 7,
"report.dashboard": false,
"report.export": false,
"report.audit": false,
"report.per_workspace": false,
"templates.custom": false,
"templates.ai_translate": false,
"limit.translations_per_month": 0,
"limit.members": 1,
"limit.humans": 2,
"admin.roles": false,
"limit.workspaces": 1,
"admin.sso": false,
"limit.tasks_per_month": 50,
"usage.overage": false,
"limit.included_credits": 0
}
}When a key is refused#
A missing, malformed, unknown or revoked key gets 401 unauthorized with a WWW-Authenticate: Bearer header:
curl https://api.tasktohuman.com/v1/me \
-H "Authorization: Bearer tth_live_wrong"const response = await fetch("https://api.tasktohuman.com/v1/me", {
headers: {
Authorization: "Bearer tth_live_wrong",
},
});
const body = await response.json();
console.log(response.status, body);import os
import requests
response = requests.get(
"https://api.tasktohuman.com/v1/me",
headers={
"Authorization": "Bearer tth_live_wrong",
},
timeout=10,
)
print(response.status_code, response.json())HTTP/1.1 401 Unauthorized
Content-Type: application/problem+json
WWW-Authenticate: Bearer
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.2",
"title": "Sign in to continue.",
"status": 401,
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"code": "unauthorized"
}Other refusals:
| Status | code | Why |
|---|---|---|
| 400 | https_required | The request used plain HTTP. |
| 403 | organization_on_hold, organization_suspended, organization_pending_deletion | The organization can't use the API right now. |
| 429 | rate_limited | Too many failed authentications from your IP address. See Rate limits. |
The errors page lists every code.