# TaskBullet Agent API and Remote MCP

Authenticated VA handoff for AI agents (Grok Bot, Cursor, OpenClaw, cloud MCP clients).
This is NOT the public site MCP at https://taskbullet.com/api/mcp.

- HTML docs: https://taskbullet.com/docs/agent-api
- Markdown: https://taskbullet.com/docs/agent-api.md
- Keys: https://taskbullet.com/dashboard/settings/api-keys

## Remote MCP

- URL: https://taskbullet.com/api/agent-mcp
- Transport: streamable HTTP (JSON-RPC)
- Auth: existing `tb_live_` header authentication remains supported (`x-api-key: tb_live_…` or Authorization: Bearer `tb_live_…`). Follow OAuth only when the server advertises it. Never ask users to paste keys into chat. A manual header may still use `TASKBULLET_API_KEY`. Call `get_balance` before proposing spend. Require an explicit yes for each task's quoted cost before `delegate_task` (real hours). Require an explicit yes for each phone call's stated hold before `place_call`. Connection consent or a general "send it" is not cost approval.
- Discovery: https://taskbullet.com/.well-known/mcp.json (entry `taskbullet-agent`)
- Unauthenticated GET returns name/version/docs and `auth.required: true`. Tools stay locked. Follow OAuth only when the server advertises it (a Bearer `resource_metadata` challenge or OAuth metadata). A well-known probe that returns JSON `oauth_not_supported` is not an advertisement. Do not start an OAuth flow then. A presented `tb_live_` key stays on header auth.

### Tools

- `get_balance` — GET /api/v1/balance. Remaining hours, canDelegate, capRoom, addHoursUrl. Calls wallet: balance_cents (spendable after open holds), wallet_cents (balance_cents + holds_cents), holds_cents (unsettled holds). No args. Call this first. canDelegate false while hours remain is not a buy-hours signal.
- `delegate_task` — POST /api/v1/delegate. Call get_balance first. Require an explicit yes for this task's quoted cost. Connection consent or a general "send it" is not cost approval. Args: title (required, max 5000), description (max 8000; no passwords, OTP, recovery keys, cookies, or API keys), priority (low|normal|high|urgent; unknown is rejected), dueDate, sourceAgent, webhookUrl, maxHours (optional, default 0.5, max 8), idempotencyKey (required; same value as the REST Idempotency-Key header). A tb_live_ key files the brief. The customer starts VA hours on Work. It does not dial. A phone call is `place_call`. Spend cap for VA/AM — actual tracked time is billed. Missing Basecamp queues the task and provisions the workspace; does not 409. 400 if the payload looks like it contains secrets, the idempotency key is missing, or priority is unknown.
- `list_tasks` — GET /api/v1/tasks. Args: status (pending|in_progress|completed|failed|cancelled|all). Each row includes title and a short result on completed tasks. awaitingCustomerConfirm true includes amNote and deliverableLinks. pending and in_progress omit customer-cancelled jobs.
- `get_task` — GET /api/v1/tasks/{taskId}. Args: taskId. Full result. awaitingCustomerConfirm true means the delivery is done: amNote is the AM or VA note, deliverableLinks lists https links. Ask the human, then confirm_task, cancel_task, or reopen_task. Stop when status is completed, failed, or cancelled.
- `confirm_task` — POST /api/v1/tasks/{taskId}/confirm. Accept the delivery, settle tracked hours, and release the board and ledger hold. Header Idempotency-Key is required (MCP arg idempotencyKey). A repeat of the same key returns the stored response. The job stays open until the customer accepts or says never mind.
- `cancel_task` — POST /api/v1/tasks/{taskId}/cancel. Customer never mind. Releases the hold and bills only tracked time. JSON reason is required. Header Idempotency-Key is required. Does not send task.completed.
- `reopen_task` — POST /api/v1/tasks/{taskId}/reopen. JSON reason is required (at least 3 characters). Sends the delivery back to the account manager. Does not settle hours. Header Idempotency-Key is required.
- `place_call` — POST /api/v1/calls. One human phone call. Require an explicit yes for this call's stated hold. Connection consent or a general "send it" is not cost approval. The hold is the full call. Default max_minutes is 5, so a tier 1 call holds $6.50. record_call must be false or omitted. Only US and CA are live. `business_name` and `on_behalf_of` may be omitted when signup stored them. A value on the call replaces the stored one.
- `validate_call` — POST /api/v1/calls/validate. Same body, no hold.
- `get_call` — GET /api/v1/calls/{id}.
- `update_call` — PATCH /api/v1/calls/{id}. needs_info only.
- `cancel_call` — POST /api/v1/calls/{id}/cancel.
- `get_transcript` — GET /api/v1/calls/{id}/transcript.txt. The VA wrap-up summary, not a recording. Once the call is wrap_up or completed, the body is that summary plus any question answers, with source wrap_up_summary and recorded false. transcript_not_ready before that summary exists. A call that ended without a dial is "no transcript: call not placed". A recorded transcript may be a separate paid feature later and is not returned.
- `get_call_events` — the per-step log for one call id (seq, kind, status, outcome, release_reason). A queued `place_call` appends `call.placed` with status `queued`. The ops create POST appends `call.handoff_sent` or `call.handoff_failed`. Replaying that Idempotency-Key does not append those rows again.
- `request_action` — POST /api/v1/actions. One human email. Flat fee from the prepaid wallet (reason ACTION, default 500 cents, ACTION_EMAIL_FEE_CENTS). Pass provider, a one-time delegated_credential, credential_scope, and credential_expires_at. Scope must match recipients, subject, and message. Missing, expired, or mismatched scope returns needs_info and charges nothing. The credential is not returned and is not sent to the VA. Client approval is required before send. Idempotency-Key is required.
- `validate_action` — POST /api/v1/actions/validate. Same body, no hold.
- `get_action` — GET /api/v1/actions/{id}.
- `update_action` — PATCH /api/v1/actions/{id}. Fill needs_info, or answer a VA question with follow_up_answer.
- `approve_action` — POST /api/v1/actions/{id}/approve. consent_attestation true. Send stays blocked until this passes.
- `cancel_action` — POST /api/v1/actions/{id}/cancel. Releases the hold and revokes the credential when the email has not been sent.

When the AI cannot finish (2FA, captcha, physical world, subjective QA, long manual work), call get_balance, state that task's quoted cost, and wait for an explicit yes, then delegate_task. Connection consent or a general "send it" is not cost approval. That files a brief and waits for the customer to click Start. It does not dial. A human phone call is `place_call`, not `delegate_task`. `place_call` dials. Require an explicit yes for that call's stated hold. Poll get_task until completed, failed, or cancelled, or pass webhookUrl. When get_task shows awaitingCustomerConfirm, ask the human, then confirm_task, cancel_task, or reopen_task. Customer cancel is cancelled and does not send the completion webhook. Never invent VA results.

### Grok Bot

Settings → Plugins → custom MCP (or TaskBullet when listed). Server URL https://taskbullet.com/api/agent-mcp. Existing `tb_live_` header authentication remains supported in connector auth (`x-api-key` or Bearer). Never ask users to paste keys into chat. Follow OAuth only when the server advertises it.

### Cursor / Grok Build (TOML)

```toml
[mcp_servers.taskbullet_agent]
url = "https://taskbullet.com/api/agent-mcp"
headers = { "x-api-key" = "tb_live_YOUR_KEY" }
enabled = true
```

### Cursor / Claude mcp.json (JSON)

```json
{
  "mcpServers": {
    "taskbullet-agent": {
      "url": "https://taskbullet.com/api/agent-mcp",
      "headers": { "x-api-key": "tb_live_YOUR_KEY" }
    }
  }
}
```

Local stdio (`npx @taskbullet/mcp-server`) is laptop-only. Cloud Grok Bots cannot use npx.

## OpenClaw lobster

Install: `openclaw skills install @griffmurder/taskbullet` (repo path `openclaw/workspace/skills/taskbullet`).

The lobster cannot create the account or mint a key. Tell the human, in order:

1. No account → https://taskbullet.com/get-started?source=openclaw (10 hours, no card)
2. Issue `tb_live_…` at https://taskbullet.com/dashboard/settings/api-keys (shown once)
3. For a host that uses a static header, put `TASKBULLET_API_KEY` in Gateway env and Agent MCP `https://taskbullet.com/api/agent-mcp` (`x-api-key`). Restart. Existing `tb_live_` header authentication remains supported. Follow OAuth only when the server advertises it. Never ask users to paste keys into chat.

Then `get_balance` / `delegate_task`. Hours deduct when tracked (15-minute rounding). `maxHours` defaults to 0.5. No key → trial URL above. Keyed 402 `addHoursUrl` is https://taskbullet.com/packages-pricing — do not restart trial. 402 is only a live Ops read that is not above zero. A cap that does not fit open caps is 422: hours remain, lower maxHours to capRoom or wait. Missing Basecamp queues the task and auto-provisions — no 409. Never invent VA results.

Named prospect / lead / cold list: send the human to https://taskbullet.com/build-a-list (pay once, CSV). Do not scrape 50–500 contacts. Do not spend hours forming the file. After the file is in their workspace, calling it is last-mile `delegate_task`. TaskBullet does not place those calls. A single human phone call is `place_call`. They already have a list → skip the wizard. Do not pitch the wizard; only when they asked.

TaskBullet's own lobster is Bullet. Workspace seed: `openclaw/workspace/` in the TaskBullet repo. Help = last-mile human VA. Get help = another lobster/skill when no human is needed.

## REST Agent API

Base: https://taskbullet.com
Auth: x-api-key: tb_live_…
Rate limit: 60 requests per 60 seconds per key on this server instance. This ceiling does not hold across instances.

### POST /api/v1/delegate

Header: Idempotency-Key (required). Empty is 400. The same account and key returns the original task.
Body: task or title (required), context or description, priority (low|normal|high|urgent; unknown is 400), dueDate, webhookUrl, sourceAgent, maxHours (optional, default 0.5, max 8).
A key files the brief. The customer starts it on Work. The response sentence matches the result: filed and waiting for a start, queued, held for a manager, or sent. awaiting_customer_start means the job is NOT started until the customer clicks Start.

200: { success, taskId, status: "awaiting_customer_start", message }
402: { error, hoursRemaining, addHoursUrl } — live Ops read whose spendable hours are not above zero
422: { error, hoursRemaining, capRoom } — the requested maxHours does not fit open caps. hoursRemaining is the live Ops figure and is above zero. capRoom is the hours free for a new cap. No addHoursUrl. Hours remain. Lower maxHours to capRoom or wait for open work to finish.
503: { error, hoursUnavailable: true } — Ops remaining was unavailable. Not a buy-hours error. canDelegate is false.
401: missing/invalid key

### GET /api/v1/balance

200: { hoursRemaining, canDelegate, addHoursUrl, hoursUnavailable, capRoom?, balance_cents, wallet_cents, holds_cents, billing_status, can_place_call, addFundsUrl, billing_setup_url, auto_topup }. hoursUnavailable true means Ops did not return a live remaining figure. capRoom is omitted on that read. On a live read, capRoom is hoursRemaining minus open caps, floored to the centihour. canDelegate is false when hours are unavailable, when spendable hours are not above zero, or when capRoom is below the minimum new cap. canDelegate false with hoursRemaining above zero means lower maxHours to capRoom or wait for open work to finish. Buy hours only when the live Ops read is not above zero. balance_cents is the spendable calls wallet after open holds. holds_cents is the sum of unsettled placed holds. wallet_cents is balance_cents + holds_cents. Auth required. No other account fields.

## Calls

Human phone calls use `place_call`, not `delegate_task`. `place_call` dials. `delegate_task` files a brief and waits for the customer to click Start. It does not dial. Require an explicit yes for each phone call's stated hold before `place_call`. Connection consent or a general "send it" is not cost approval. Pay as you go from the calls wallet. Only US and CA can be placed today. Other priced countries return 422 `country_not_enabled` with `country` and `tier` until `CALL_LAUNCH_COUNTRIES` includes them.

Calls routes share the agent rate limit: 60 requests per minute per key on this instance (60 requests per 60 seconds). A 429 response includes the `Retry-After` header in seconds. The ceiling does not hold across instances.

### Fields

Required: `phone`, `purpose` (`info`, `scheduling`, `account_servicing`, `vendor_ops`), `goal` (at most 4000 characters), `questions`, `deadline` (ISO-8601), `consent_attestation` (true).

`business_name` and `on_behalf_of` are stored at signup (POST /api/v1/accounts and https://taskbullet.com/hub/get-api-key). A call that omits either field uses the stored value. A call that sends a value uses that value. If the account has no stored value and the call omits the field, the call is needs_info.

A question is `{"id","ask","type"?}`. `id` is at most 80 characters. `ask` is at least 8 characters and at most 1000. At most 20 questions. An `ask` shorter than 8 characters is needs_info `too_short` on `questions[n].ask`, with `limit` 8 and a `message` that names that field. An over-long `goal` or question is 422 `field_too_long` with `field` and `limit`. The value is not truncated.

Optional: `language` (default `en`; `tl` is stored as `fil`), `record_call` (false or omit; true returns needs_info `recording_not_available`), `script_mode` (`guided` or `verbatim`), `script`, `instructions`, `extension` (digits, at most 20, appended to the VA instructions, not billed), `allowed_disclosures`, `shareable_contact`, `time_window`, `recipient_timezone`, `retry_preference`, `allow_outside_business_hours`, `max_attempts` (default 3, max 5), `max_minutes` (default 5, max 60), `callback_url` (https). Call webhooks are delivered to `callback_url`.

`time_window`, when present, is 24-hour `HH:MM-HH:MM` in the recipient time zone, end after start. Example: `09:00-17:00`. A bad window is needs_info on `time_window` with that format in `message`.

`phone` accepts US and Canada shapes and stores E.164. `801-414-4664`, `(801) 414-4664`, and `+1 801 414 4664` are `+18014144664`. A number that already starts with `+` only loses separators.

### Endpoints

Auth on all of these is `x-api-key: tb_live_…`.

- POST /api/v1/calls/validate — dry run. Creates nothing and places no hold. A ready body includes `country`, `tier`, `language`, `hold_cents`, `recipient_timezone`, and `recipient_timezone_inferred`. The flag is true only when the client omitted the zone and the area code supplied it. `valid` stays true when spendable `balance_cents` is below `hold_cents`. `warnings` then includes `{ code: "insufficient_balance", needed_cents, addFundsUrl }`. `needed_cents` is the hold. `addFundsUrl` is POST /api/v1/billing/add-funds. Placement of that body is still 402.
- POST /api/v1/calls — header `Idempotency-Key` required. The first create of a queued call is 201. Replaying the same key and body returns 200 and the current call, including after a needs_info call was updated. A different body with the same key is 409 `idempotency_conflict`.
- GET /api/v1/calls/{id} — a queued call includes `billing` (`hold_cents`, `charged: false`, nothing charged yet) and `attempts: []`.
- PATCH /api/v1/calls/{id} — needs_info only. Same result shapes as place.
- POST /api/v1/calls/{id}/cancel — asks ops to cancel. The call stays `cancel_pending` until ops confirms, then the hold is refunded and the status is `cancelled`. If the dial already started, 409 `cancel_too_late` and the call bills normally. An ops error keeps `cancel_pending` and is retried. A dial after a confirmed cancel refunds the hold in full and marks the VA unpaid.
- GET /api/v1/calls — this account's calls.
- GET /api/v1/calls/{id}/transcript.txt — the VA wrap-up summary, not a recording. On wrap_up or completed, the body starts with `source: wrap_up_summary` and `recorded: false`, then the summary, then question answers when the call has them. MCP `get_transcript` returns that summary as `transcript`, plus `answers` when present, `source` `wrap_up_summary`, and `recorded` false. Before the summary exists, 404 `transcript_not_ready`. A call that ended without a dial (system failure or refund) is 409 `no transcript: call not placed`. A cancel after the dial started is 409 `call_cancelled`. A recorded transcript may be offered later as a separate paid feature. This response does not include one.
- GET /api/v1/balance — `balance_cents` is spendable after open holds. `holds_cents` is unsettled placed holds. `wallet_cents` is `balance_cents` + `holds_cents`. `addFundsUrl` is POST /api/v1/billing/add-funds. That read does not create a Stripe session.
- POST /api/v1/billing/add-funds — body `topup_cents`. Optional `return_url` is where the browser goes after Checkout. A same-origin URL returns automatically. An https URL on another host is a continue link. With no `return_url`, the return page says whether the key is live or still activating and links to a test call. GET on that path describes the method and does not create a session.
- POST /api/v1/accounts — signup. The same form is https://taskbullet.com/hub/get-api-key (name, email, company, business_name, on_behalf_of). Optional `return_url`. 201 returns `api_key` and `webhook_secret` once. An existing email is 409 `already_exists` and does not rotate the secret. Add funds with POST /api/v1/billing/add-funds. This is not the 10-hour trial at /get-started.
- PATCH /api/v1/accounts/me — settings, including `business_name` and `on_behalf_of`. `rotate_webhook_secret: true` returns a new secret once.

### Statuses and outcomes

Statuses: `needs_info`, `queued`, `assigned`, `in_progress`, `wrap_up`, `cancel_pending`, `completed`, `failed`, `blocked`, `cancelled`, `expired`, `expired_no_report`. `cancel_pending` means a cancel was requested and ops has not confirmed it. It is not a refund. `expired` is a finished call.

Outcomes on a finished call: `success`, `partial`, `no_answer`, `voicemail`, `voicemail_left`, `busy`, `wrong_number`, `refused`, `ended_insufficient_funds`, `expired`. A call that is still in progress does not report `no_answer`, `voicemail`, or `busy`. That disposition stays on the redial until the call ends.

### Webhooks

Events: `call.needs_info`, `call.queued`, `call.assigned`, `call.in_progress`, `call.attempted`, `call.redial`, `call.wrap_up`, `call.cancel_pending`, `call.completed`, `call.failed`, `call.blocked`, `call.cancelled`, `call.expired`, `call.expired_no_report`, `call.auto_topup_failed`.

`call.redial` includes `next_attempt_at` and `attempt`. Ops retries a no-answer, voicemail, or busy result about every 20 minutes, inside `max_attempts` and the deadline. Those redials are not a new charge.

Signature: header `x-taskbullet-timestamp` is unix seconds. Header `x-taskbullet-signature` is hex HMAC-SHA256 of `{unixSeconds}.{rawBody}`. No `sha256=` prefix. The secret is the per-key webhook secret. Retries wait 1 minute, 5 minutes, 15 minutes, then longer, up to 5 attempts.

POST https://taskbullet.com/api/v1/webhooks/test with the account API key and `{ "url": "https://..." }` sends one sample `call.completed` to that URL. The body matches a live completion and includes `test: true`. It is signed the same way. It creates no call, places no hold, and does not call ops. Send it again any time. 10 requests per minute per key. 200 returns `status_code`, `latency_ms`, `event_id`, and `headers`.

POST https://taskbullet.com/api/v1/webhooks/receiver/{token} is a first-party inbox. The token is unguessable and belongs to one account. It stores the headers, `x-taskbullet-signature`, `x-taskbullet-timestamp`, the raw body, the time received, and whether that signature matches the account's webhook secret. It returns 200. The body cap is 32 KiB. 30 requests per minute. GET https://taskbullet.com/api/v1/webhooks/receipts with the same API key issues that account's `receiver_url` when it is missing, then lists the recent receipts.

### Hold and no-answer charge

The hold is the full call: the tier minimum for the first minute, then the per-minute rate for each additional minute. Default `max_minutes` is 5. Tier 1 is $2.50 for the first minute and $1.00 for each additional minute, so the default hold is $6.50 (650 cents). Raise `max_minutes` on that call to hold more, up to 60. Settlement uses the quote that hold paid for and never charges more than that hold. A call placed at the older price stays on that price. Unused hold is released. A refund happens only when no dial was made.

A call that never connected is not charged. Refused, never rang, no answer, busy, disconnected, and no connection release the hold, including the tier minimum. A connected call is billed: the tier minimum covers the first minute, then the per-minute rate. Voicemail and a wrong number count as connected. Ring time is not billed. Talk minutes round up, including US and CA. Redials after no-answer, voicemail, or busy are free. A charge that already settled is left as it is.

A dial is a real attempt: an attempt row, a dial outcome (no answer, busy, voicemail, a wrong or disconnected number, or bad information the VA worked), or a submitted wrap-up. If the stall backstop finds one of those and ops never sent `call.completed`, the call is completed. A connected attempt is charged the quote that hold paid for. An unconnected attempt releases the hold. A refund with no completion happens only when no dial was made. That covers a failed handoff, a call never claimed or dialed, an ops or desk error, and a call that expired with zero attempts. The sweep claims settlement once, so the same call is not charged twice.

### Tiers

Only US and CA are live. Alaska 907 and Canada 867 stay Tier 1. Canada 867 does not infer a time zone.

| Tier | First minute | Each additional minute | Countries |
|---|---|---|---|
| 1 | $2.50 | $1.00 | US, Canada, Puerto Rico |
| 2 | $3.00 | $1.25 | US Virgin Islands, Singapore, Bermuda, Guam, India, Australia, New Zealand |
| 3 | $3.50 | $1.50 | Northern Mariana Islands, Ireland, Nigeria, Philippines, Trinidad and Tobago, Gibraltar, Kenya |
| 4 | $4.50 | $2.00 | Cayman Islands, American Samoa, Bahamas, Jamaica, British Virgin Islands, South Africa, United Kingdom, Belize, Ghana, Barbados, Malta, Turks and Caicos |

### Time zone

An explicit IANA `recipient_timezone` wins. If it is omitted, TaskBullet infers it from the US or Canada area code, or from a single-zone country when that country is launched. `recipient_timezone_inferred` is true only in that case. If it cannot be inferred, the call is needs_info for `recipient_timezone`. There is no UTC fill-in. Australian mobiles (national 4) and area code 8 need an explicit zone.

### Calls errors

| Status | error | When |
| 400 | Idempotency-Key required or invalid JSON | POST /api/v1/calls |
| 401 | Invalid or revoked API key | Any calls route |
| 429 | Rate limit exceeded | About 60 requests per minute per key on this instance. Honor the `Retry-After` header (seconds). The ceiling does not hold across instances. |
| 402 | payment_required | Wallet cannot cover the hold |
| 409 | too_many_calls | 5 open calls: queued, assigned, in_progress, wrap_up, or cancel_pending. needs_info does not count |
| 409 | idempotency_conflict | Same Idempotency-Key, different body |
| 409 | call_not_editable | PATCH after the call left needs_info |
| 409 | cancel_too_late | Cancel after dialing started. The call stays active and bills normally |
| 409 | call_cancelled | transcript.txt after a dial was cancelled |
| 409 | no transcript: call not placed | The call ended without a dial (system failure or refund). There is no wrap-up |
| 413 | payload_too_large | Body larger than 32 KiB. `message` names the limit |
| 422 | country_not_enabled | Priced country that is not live. Includes `country` and `tier` |
| 422 | country_quote_only | Country that is not priced |
| 422 | number_blocked | Premium, toll-free, personal, paging, or shared-cost range |
| 422 | field_too_long | `goal` or a question over its limit. Includes `field` and `limit` |
| 422 | do_not_call | Number is on the internal do-not-call list. No hold |
| 422 | blocked_compliance | Sales purpose, a secret in the body, or a blocked Caribbean NANP |
| 404 | transcript_not_ready | Wrap-up summary is not stored yet |
| 404 | not_found | Unknown call |
| 200 | needs_info | Missing or invalid fields, including a bad `time_window`, `too_short` (a question `ask` under 8 characters; `field`, `limit`, and `message` name it), `needs_lead_time` (deadline is under 60 minutes of clock time from now; `message` says so), `needs_business_hour` (at least 60 minutes of clock time, but fewer than 60 minutes fall inside weekday 09:00–17:00 recipient-local; also asks for `allow_outside_business_hours`), or an uninferable time zone |

### GET /api/v1/tasks

Query: status=pending|in_progress|completed|failed|cancelled|all (default all). Up to 50 tasks. Each item: taskId, title, status, priority, createdAt, completedAt?, result? (short snippet when completed). When awaitingCustomerConfirm is true the row also includes amNote and deliverableLinks. pending and in_progress omit customer-cancelled jobs.

### GET /api/v1/tasks/{taskId}

Poll until status is completed, failed, or cancelled. Completed responses include result. Customer cancel is cancelled. It is not pending, in_progress, or failed, and it does not send the completion webhook. Stop.

Statuses: pending (filed, not on the board), in_progress (on the board, VA has not delivered, customer has not closed), completed (client_complete only), failed (existing failed status only), cancelled (customer cancel). A VA checkbox or an AM mark-done sets vaCompletedAt and awaitingCustomerConfirm. The status stays pending or in_progress until confirm_task, cancel_task, or reopen_task. It does not complete the task. amNote is that delivery note. deliverableLinks are https links from the note plus the board card. autoConfirmNote is a close note stored on the job when one was recorded. A missing board card is a hold on get_task, not a failure. A customer cancel is not a hold.

### POST /api/v1/tasks/{taskId}/confirm

Header: Idempotency-Key (required, max 255). Empty body is allowed. Accepts a delivery that is awaitingCustomerConfirm. Settles tracked hours through Ops, releases the board and ledger hold, and returns the task with status completed. Already confirmed returns the current task and message "Already confirmed." 409 not_awaiting_confirm when nothing has been delivered. 409 task_closed when the task is cancelled or failed. 409 idempotency_conflict when the key was used for a different action, task, or body. 409 idempotency_in_progress when the first request is still running.

The job stays open until confirm_task or cancel_task. A cron does not complete it.

### POST /api/v1/tasks/{taskId}/cancel

Header: Idempotency-Key (required). Optional JSON body `{ "reason": "..." }`. Releases the hold and bills only tracked time. Does not send task.completed. 409 task_closed when the task is already completed or failed.

### POST /api/v1/tasks/{taskId}/reopen

Header: Idempotency-Key (required). JSON body `{ "reason": "..." }` is required (at least 3 characters, no secrets). Clears the delivery stamp and sends the job back to the account manager. Does not settle hours and does not send task.completed. 409 when the job is already closed or is not waiting for confirmation.

## Webhooks

If webhookUrl is set on delegate, TaskBullet POSTs a signed payload when the customer closes the job (client_complete) and, for an agent-created task, when the delivery is marked done and is awaiting confirmation. A hold does not send a failed webhook. A customer cancel does not send task.completed. get_task status cancelled is the stop.

Headers: x-taskbullet-signature (hex HMAC-SHA256 of `${unixSeconds}.${rawBody}`), x-taskbullet-timestamp (unix seconds). The same headers and secret sign call.* webhooks. The webhook secret is returned once at calls signup and again only when PATCH /api/v1/accounts/me sends rotate_webhook_secret true.
Events: task.completed (taskId, taskTitle, status, result) and task.awaiting_confirmation (same fields, plus awaitingCustomerConfirm, amNote, and deliverableLinks). The two events retry independently. Call events use the same signature over the raw JSON body.

webhookUrl must be a public https URL. Retries up to 5 times. Call webhook retries wait 1 minute, then 5 minutes, then 15 minutes, then longer.

Calls add-funds: get_balance returns addFundsUrl (POST /api/v1/billing/add-funds with topup_cents). That read does not create a Stripe Checkout session.

## Errors

| Status | Cause |
| 400 | Invalid body, oversize fields, or secrets in title/description |
| 413 | Request body larger than 32 KiB |
| 401 | Missing, invalid, or revoked API key |
| 402 | Live spendable hours are not above zero |
| 422 | Requested cap does not fit open caps. Hours remain. Lower maxHours to capRoom or wait. Not a buy-hours error. |
| 503 | Hours unavailable — Ops did not return a live remaining figure. hoursUnavailable is true. Not a buy-hours error. |
| 409 | not_awaiting_confirm, task_closed, idempotency_conflict, or idempotency_in_progress on confirm, cancel, or reopen |
| 429 | Rate limit on this instance — honor Retry-After. The ceiling does not hold across instances. |

Hours are gated at 402 only when the live Ops read is not above zero. A cap that does not fit open caps is 422. VA time deducts from the bucket when work is tracked, not as a prepaid debit on submit.
