Skip to main content
Documentation
POST /api/v1/tasks

Create Task

Create a new task that appears in the operator's dashboard.

Request

curl -X POST https://your-instance/api/v1/tasks \
  -H "Authorization: Bearer htk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Review document",
    "steps": [{ "id": "review", "title": "Review", "blocks": [...] }]
  }'

Required scope: tasks:create

Request Body

FieldTypeRequiredDescription
titlestringYesTask title (max 200 chars)
stepsarrayYesOne or more form steps
task_idstringNoCustom UUID (auto-generated if omitted)
instructions_mdsvexstringNoMarkdown instructions shown above the form
assignee_member_idstringNoAssign to an org member by user ID. Use "me" to assign to the API token owner.
assignee_emailstringNoAssign by email. If the email matches an org member, resolves as member (dashboard link). Otherwise creates an external assignee with OTP verification.
assignee_namestringNoDisplay name for external assignee
assignee_phonestringNoPhone number for external assignee
expires_innumberNoLink expiration in seconds (60 to 2,592,000)
corr_idstringNoCorrelation ID for tracing
process_idstringNoLink to a parent process
process_stepstringNoProcess step key
payloadobjectNoArbitrary metadata
sinksarrayNoNotification sinks (webhook, NATS, email)

Step Object

FieldTypeRequiredDescription
idstringYesUnique step identifier
titlestringYesStep title
description_mdsvexstringNoMarkdown description
blocksarrayYesContent blocks

Notification Sinks

Sinks define where to send notifications when the task completes, is cancelled, or fails.

Webhook sink:

{
	"type": "webhook",
	"url": "https://your-app/webhook",
	"secret": "optional-hmac-secret",
	"events": ["completed", "cancelled", "failed"]
}

NATS sink:

{
	"type": "nats",
	"subject": "my.custom.subject",
	"events": ["completed"]
}

Email sink:

{
	"type": "email",
	"to": "manager@company.com",
	"events": ["completed"]
}

On completion, a PDF of the submitted form data is attached to the email. Cancelled/failed events send a plain email with the reason.

If no secret is provided for webhook sinks, one is auto-generated and returned in the response.

Response

{
	"task_id": "uuid",
	"link_id": "uuid",
	"url": "https://your-instance/t/...",
	"requires_otp": false,
	"sinks": [
		{
			"type": "webhook",
			"url": "https://your-app/webhook",
			"secret": "auto-generated-hex-secret"
		},
		{
			"type": "nats",
			"subject": "my.custom.subject"
		},
		{
			"type": "email",
			"to": "manager@company.com"
		}
	],
	"created_at": "2026-02-24T12:00:00Z"
}

Errors

StatusMeaning
400Invalid request body — check details array for field-level errors
401Missing or invalid token
403Token lacks tasks:create scope

Example: Feedback Survey

Shows the newer field types — radio, date, range, and rating:

{
	"title": "Product Feedback",
	"steps": [
		{
			"id": "feedback",
			"title": "Your Feedback",
			"blocks": [
				{
					"type": "input",
					"field": {
						"name": "role",
						"label": "Your Role",
						"kind": "radio",
						"options": ["Developer", "Designer", "PM", "Other"]
					}
				},
				{
					"type": "input",
					"field": {
						"name": "start_date",
						"label": "When did you start using the product?",
						"kind": "date",
						"include_time": true
					}
				},
				{
					"type": "input",
					"field": {
						"name": "ease_of_use",
						"label": "Ease of Use",
						"kind": "range",
						"min": 0,
						"max": 10,
						"step": 1
					}
				},
				{
					"type": "input",
					"field": {
						"name": "overall_rating",
						"label": "Overall Rating",
						"kind": "rating",
						"max_rating": 5
					}
				},
				{
					"type": "input",
					"field": {
						"name": "comments",
						"label": "Additional Comments",
						"kind": "textarea",
						"required": false
					}
				}
			]
		}
	]
}

Example: Multi-step Form

{
	"title": "New employee onboarding",
	"steps": [
		{
			"id": "personal",
			"title": "Personal Information",
			"blocks": [
				{
					"type": "input",
					"field": { "name": "full_name", "label": "Full Name", "kind": "text", "required": true }
				},
				{
					"type": "input",
					"field": {
						"name": "department",
						"label": "Department",
						"kind": "select",
						"options": ["Engineering", "Sales", "Marketing", "HR"]
					}
				}
			]
		},
		{
			"id": "documents",
			"title": "Upload Documents",
			"blocks": [
				{
					"type": "callout",
					"severity": "info",
					"content": "Please upload a scan of the signed contract."
				},
				{
					"type": "input",
					"field": {
						"name": "contract",
						"label": "Signed Contract",
						"kind": "file",
						"required": true
					}
				}
			]
		},
		{
			"id": "approval",
			"title": "Manager Approval",
			"blocks": [
				{
					"type": "input",
					"field": { "name": "approved", "label": "Approve onboarding?", "kind": "checkbox" }
				},
				{
					"type": "input",
					"field": {
						"name": "signature",
						"label": "Manager Signature",
						"kind": "signature",
						"required": true
					}
				}
			]
		}
	]
}