The Dispatchlet API

Everything you can do in the app, over HTTPS with JSON. Base URL https://dispatchlet.com/api/v1. The machine-readable version is openapi.json. Webhooks are on their own page, as is the MCP server and the inbound hook.

Tokens

Make one under Settings → API tokens. It is shown once. Send it on every request as Authorization: Bearer dl_…. A read token can only GET; a write token can also create, change, start runs and approve. Revoking a token stops it on the next request. A token acts as you: runs it starts count against your allowance, and it can never see another account.

curl https://dispatchlet.com/api/v1/me \
  -H "Authorization: Bearer dl_…"

Conventions

Ids are strings. Times are Unix milliseconds in fields ending At. Every response to an accepted token carries X-RateLimit-Limit, -Remaining and -Reset (Unix seconds). An error comes back with a code and a message, and a field or line when one applies:

{ "error": { "code": "invalid", "message": "maxPostsPerRun: Too big", "field": "maxPostsPerRun" } }
StatusCodeWhen
401unauthorizedNo token, or a revoked one.
403forbiddenA read token on a route that writes, an account not let in yet, or Buffer needs reconnecting.
404not_foundNo such route, or an id that is not yours.
405method_not_allowedThe route exists but not with that method; `Allow` lists the ones it takes.
400invalidThe body or query is wrong; `field` names which part, `line` for a playbook.
409conflictA run is already going, the automation is paused or not ready, or you are at a limit on how many you may have.
402allowanceNo free runs, dry runs or playbook generations left. Add your own Anthropic key in settings.
429rate_limited60 requests a minute per token, 1,000 an hour per account. `Retry-After` says how long.
502bufferBuffer refused the call; the message is passed through.
500unavailableSomething on our side. Try again.

Starting a run returns 202 at once. Poll GET /runs/:id until finishedAt is set; a run takes one to three minutes. Nothing in the API skips the app’s rules: one run at a time per automation, the free allowance, Buffer’s rate limit and the daily spend cap all apply.

Routes

GET /meread

The account behind the token.

curl https://dispatchlet.com/api/v1/me -H "Authorization: Bearer dl_…"

{ "id": "k17…", "email": "you@example.com", "timezone": "Africa/Johannesburg", "allowance": { "ownKey": false, "runsLeft": 7, "dryRunsLeft": 2 }, "buffer": { "connected": true, "needsReauth": false } }

GET /channelsread

Your Buffer channels, with which ones Dispatchlet can post to.

POST /channels/syncwrite

Read the channels from Buffer again.

GET /automationsread

List automations.

POST /automationswrite

Create an automation from the setup answers. Returns 202 with status "generating". The playbook is written in the background; fetch the automation again in about a minute.

curl -X POST https://dispatchlet.com/api/v1/automations -H "Authorization: Bearer dl_…" -H "Content-Type: application/json" -d '{"setup":{"research":"Formula 1 news","cadence":{"preset":"daily","time":"08:00","weekday":null},"maxStories":2,"postingMode":"draft"},"channelIds":["<buffer channel id>"]}'

{ "automation": { "_id": "kx7…", "name": "Formula 1 news", "status": "generating", … } }

GET /automations/{id}read

One automation with its playbook.

PATCH /automations/{id}write

Change schedule, channels, posting mode, story count or status.

curl -X PATCH https://dispatchlet.com/api/v1/automations/kx7… -H "Authorization: Bearer dl_…" -H "Content-Type: application/json" -d '{"status":"paused"}'

{ "automation": { "_id": "kx7…", "status": "paused", "nextRunAt": null, … } }

DELETE /automations/{id}write

Delete an automation.

GET /automations/{id}/playbookread

The playbook, as JSON or as text. Send `Accept: text/markdown` for the text the editor shows; otherwise JSON with both.

curl https://dispatchlet.com/api/v1/automations/kx7…/playbook -H "Authorization: Bearer dl_…" -H "Accept: text/markdown"

# Formula 1 news

## About
…

PUT /automations/{id}/playbookwrite

Replace the playbook text as a new version. Send the text with `Content-Type: text/markdown`, or JSON `{ "text" }`. A parse error comes back as 400 with the line.

POST /automations/{id}/ruleswrite

Add a skip rule to the playbook.

curl -X POST https://dispatchlet.com/api/v1/automations/kx7…/rules -H "Authorization: Bearer dl_…" -H "Content-Type: application/json" -d '{"rule":"Skip driver contract rumours"}'

{ "version": 4 }

POST /automations/{id}/runswrite

Start a run or a dry run. Returns 202 at once; poll GET /runs/{id} until finishedAt is set. 409 when a run is going, 402 when the allowance is spent.

curl -X POST https://dispatchlet.com/api/v1/automations/kx7…/runs -H "Authorization: Bearer dl_…" -H "Content-Type: application/json" -d '{"dry":true}'

{ "run": { "_id": "j57…", "kind": "dry", "status": "researching", "startedBy": "api", "steps": [ … ], "stories": [], "posts": [] } }

GET /automations/{id}/runsread

Runs of an automation, newest first.

Query: limit (1 to 50, default 20), before (Only runs started before this time (ms))

GET /runs/{id}read

One run: steps, stories, posts, cost.

POST /runs/{id}/sharewrite

Make a run readable by link.

GET /postsread

Posts, newest first.

Query: status (draft, queued, scheduled, sent, failed, held, rejected, dry or deleted), automation (Only this automation), since (Created after this time (ms)), limit (1 to 100, default 50)

curl "https://dispatchlet.com/api/v1/posts?status=draft" -H "Authorization: Bearer dl_…"

{ "posts": [ { "_id": "k9a…", "channelName": "GrandPrixPicks", "service": "twitter", "text": "…", "status": "draft", … } ] }

GET /posts/{id}read

One post.

PATCH /posts/{id}write

Change a draft’s text before approving it. Drafts only. The text must fit the channel as the service counts it; it is saved in Buffer as a draft.

POST /posts/{id}/approvewrite

Move a draft into the Buffer queue. Calls Buffer's editPost. Already-queued posts come back unchanged.

curl -X POST https://dispatchlet.com/api/v1/posts/k9a…/approve -H "Authorization: Bearer dl_…"

{ "post": { "_id": "k9a…", "status": "queued", … }, "message": "Added to your Buffer queue." }

POST /stories/{id}/ideawrite

Save a story to Buffer Ideas. For a story that was skipped or picked on a dry run. Calls Buffer's createIdea in the automation's organization, with the Dispatchlet tag. Saving twice returns the same idea. Needs a Buffer connection that allowed Ideas; a 403 forbidden means sign in with Buffer again.

curl -X POST https://dispatchlet.com/api/v1/stories/m97…/idea -H "Authorization: Bearer dl_…"

{ "ideaId": "6721…", "message": "Saved to Buffer Ideas." }

GET /webhooksread

List webhooks.

POST /webhookswrite

Add a webhook. The signing secret is in the response once. See /docs/webhooks for the events and the signature.

curl -X POST https://dispatchlet.com/api/v1/webhooks -H "Authorization: Bearer dl_…" -H "Content-Type: application/json" -d '{"url":"https://hooks.zapier.com/hooks/catch/1/2","events":["post.approved","post.sent"]}'

{ "webhook": { "_id": "kw1…", "url": "https://hooks.zapier.com/hooks/catch/1/2", "events": ["post.approved","post.sent"], "active": true, … }, "secret": "whsec_…" }

DELETE /webhooks/{id}write

Delete a webhook.

POST /webhooks/{id}/testwrite

Send a ping event now.

GET /webhooks/{id}/deliveriesread

The last 50 deliveries.

GET /hooksread

List inbound hook URLs.

POST /hookswrite

Make an inbound hook URL for an automation. The URL is in the response once. POST to it to start a run; see /docs/hooks.

DELETE /hooks/{hook}write

Delete an inbound hook. `hook` is the hook’s id, as listed by GET /hooks.

POST /hooks/{hook}no token

Start a run from an inbound hook (no bearer token). `hook` is the hook’s token (dlh_…), which is the credential. Body: empty (run now), `{ "title", "url"?, "notes"?, "dry"? }`, or a GitHub release webhook (X-GitHub-Event: release). 10 a minute per hook.

curl -X POST https://dispatchlet.com/api/v1/hooks/dlh_… -H "Content-Type: application/json" -d '{"title":"Dispatchlet 1.2 is out","url":"https://github.com/barrymichaeldoyle/dispatchlet/releases/tag/v1.2.0"}'

{ "run": { "id": "j57…", "url": "https://dispatchlet.com/app/a/kx7…/runs/j57…" } }

Webhook events

POST /webhooks takes any of these in events:

How deliveries are signed and retried is on the webhooks page.