Tasks

Estimate, create, read, and settle tasks — the core loop of the Hannu API.

Tasks are the core of the API. You estimate the work, create it under escrow, then approve, reject, or cancel once proof is in.

POST/v1/estimate_task

Dry-run pricing with zero state change.

Bearer auth

Send the task shape you intend to create; get back a price. Nothing is committed.

POST/v1/estimate_task
curl -X POST https://api.hannu.africa/v1/estimate_task \
  -H "Authorization: Bearer $HANNU_KEY"
POST/v1/tasks

Create and escrow-lock a task.

Bearer authIdempotency-Key

Requires an Idempotency-Key, plus type, title, instructions, reward_major, and deadline. Locks escrow and enters safety screening atomically.

JSON
{
  "data": {
    "taskId": "task_8f21",
    "escrowLockId": "lock_3c90",
    "state": "screening",
    "totalChargedMinor": "303750"
  }
}
GET/v1/tasks

List the org's tasks (newest first, bounded to 50).

Bearer auth
GET/v1/tasks/:id

Full task state, reward, and proof status.

Bearer auth
GET/v1/tasks/:id/proof

The AI verification report summary.

Bearer auth
POST/v1/tasks/:id/approve

Release escrow to the Operator.

Bearer authIdempotency-Key
POST/v1/tasks/:id/reject

Reject proof with a structured reason — opens a dispute, freezes escrow.

Bearer authIdempotency-Key

Send a structured reason so the dispute has context. Reject is valid only while the task is verifying. The handler reads reason only:

POST/v1/tasks/task_8f21/reject
curl -X POST https://api.hannu.africa/v1/tasks/task_8f21/reject \
  -H "Authorization: Bearer $HANNU_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/v1/tasks/:id/cancel

Cancel before acceptance and refund escrow.

Bearer authIdempotency-Key
Task lifecycle

A task moves through a defined state machine — draft → screening → live → matched → accepted → in_progress → proof_submitted → verifying → approved → paid, with dispute and refund branches. See Task lifecycle.