patlas/ docs

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.

CaseStatus
issue created201
create replayed for the same externalId200
issue patched200
malformed JSON400
bad or disabled token, unknown type, missing external id, issue not found404
wrong method405
non-JSON body415
invalid field or target422
project unavailable503

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"
}

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"
}

Target

The target is configured when the webhook is created.

FieldEffect
boardTarget board. Defaults to main.
columnTarget column. Defaults to the first column or todo.
pileAdd to the active pile run.
batchAdd to an open batch.
assigneeSet the assignee. Must be a current member.
labelsSet labels at creation.
priority-2..=2.
milestoneSet 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

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."}'