Webhooks
Status: implemented.
Inbound webhooks let an external form or automation create and patch issues
without a project session. Each webhook is a URL plus a fixed create target.
The token is the capability.
Endpoints
POST /api/webhooks/<token>/issue.create
POST /api/webhooks/<token>/issue.patch/<external_id>
Both accept application/json only. Other content types return 415.
Responses have no body. Only the status code matters.
| Case | Status |
|---|---|
| issue created | 201 |
create replayed for the same externalId | 200 |
| issue patched | 200 |
| malformed JSON | 400 |
| bad or disabled token, unknown type, missing external id, issue not found | 404 |
| wrong method | 405 |
| non-JSON body | 415 |
| invalid field or target | 422 |
| project unavailable | 503 |
The owner sees the last failure in the Webhooks tab. The public response never
carries an error body or an issue id.
Create
{
"title": "Broken checkout",
"content": "Steps to reproduce...",
"externalId": "form-42"
}
titleis required, trimmed and capped at 500 characters.contentis the Markdown body and maps to the issuebody.externalIdmaps to the issue frontmatter~external.- Board, column, pile, batch, assignee, labels, priority and milestone come
from the webhook target. - Status is derived from the target column, the same way the board create
path does.
externalId is optional. Without it the issue cannot be patched through the
webhook later.
Patch
POST /api/webhooks/<token>/issue.patch/form-42
{
"title": "New title",
"content": "Updated body",
"assignee": "ada",
"labels": ["bug"],
"priority": 2,
"status": "done"
}
- The issue is found by
~external. - Every body field is optional.
assignee: nullunsets the assignee.- Fields match the existing issue patch endpoint, with
contentreplacingbody. - Status updates frontmatter only. It does not move the board card.
- No
milestone, because the existing patch endpoint does not expose it.
Target
The target is configured when the webhook is created.
| Field | Effect |
|---|---|
board | Target board. Defaults to main. |
column | Target column. Defaults to the first column or todo. |
pile | Add to the active pile run. |
batch | Add to an open batch. |
assignee | Set the assignee. Must be a current member. |
labels | Set labels at creation. |
priority | -2..=2. |
milestone | Set the milestone string. |
Targets are validated when the webhook is saved and again when it fires.
Missing boards, columns, piles, batches or assignees fail closed.
External ids
External ids are unique per project. The issue stores only ~external in its
frontmatter. The server resolves it through an in-memory index built from the
same issue scan that produces the board snapshot. A miss falls back to a file
scan, so a snapshot that predates a pull still resolves.
The index is rebuilt on load and after every mutation. Nothing is stored in a
separate table.
Managing webhooks
The only place to create a webhook is the Integrations page, Webhooks tab:
/p/<project>/integrations/webhooks
Members can view the list. Only the owner can create, rotate, enable, disable
or delete.
API, owner-only:
GET /api/board/<slug>/webhooks
POST /api/board/<slug>/webhooks
PATCH /api/board/<slug>/webhooks/<id>
POST /api/board/<slug>/webhooks/<id>/rotate
DELETE /api/board/<slug>/webhooks/<id>
Create body:
{
"name": "Website form",
"target": {
"board": "main",
"column": "todo",
"pile": "inbox",
"batch": 3,
"assignee": "ada",
"labels": ["website"],
"priority": 1,
"milestone": "v2"
}
}
The create and rotate responses return the full token once, plus both URL
paths. The list returns only a short token hint. Rotating invalidates the old
URL immediately.
Security
- Tokens are stored as SHA-256 hashes, never in plain text.
- Disabling a webhook makes its URL return
404. - The public endpoint can only create issues in the configured target and
patch issues by known external id. It cannot read, delete or move issues. - The token is in the request path, so it appears in access logs. Redact the
path in nginx if logs are shared. - No CORS. Use server-to-server calls.
Example
curl -i -X POST \
"https://taleplan.com/api/webhooks/phk_example/issue.create" \
-H "content-type: application/json" \
-d '{"title":"Broken checkout","content":"Steps to reproduce...","externalId":"form-42"}'
curl -i -X POST \
"https://taleplan.com/api/webhooks/phk_example/issue.patch/form-42" \
-H "content-type: application/json" \
-d '{"status":"done","content":"Fixed in the latest deploy."}'