Skip to content
REST API

API reference

A small HTTP API for scripts and CI. Most of what Patchlit does happens by itself on GitHub events; the API covers what you may want to trigger or check from outside. For agents, the MCP server offers more: fixes, diffs, insights, Retry and Fix it.

Authentication

Create a key under Settings, API keys (shown once; Patchlit keeps only a hash) and send it on every request:

Header
Authorization: Bearer patchlit_sk_...
  • A key acts as you, with full access to your account’s repositories in Patchlit. Keep it in a secret store or an environment variable.
  • A key unused for 90 days stops working. Revoke a key any time in Settings; it stops at once.
  • At most 25 keys per account.

Base URL: https://patchlit.dev. Requests and responses are JSON (Content-Type: application/json). Ids are UUIDs. Times are ISO 8601 in UTC.

Start an issue resolution

POST /api/resolve starts Patchlit on an open bug-report issue: it writes one failing test that reproduces the bug and opens a pull request holding only that test. After a maintainer approves it with the patchlit-go label, Patchlit tries a fix (how it works). The repository must have Issues switched on in its settings.

FieldTypeDescription
repoIdstring (UUID)The repository’s id in Patchlit (shown by the MCP tool patchlit_list_repositories).
issueNumberintegerThe issue’s number on GitHub. Patchlit must have seen the issue (it is recorded when opened or labelled while the app is installed).
Request
curl -X POST https://patchlit.dev/api/resolve \
  -H "Authorization: Bearer $PATCHLIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"repoId":"6f1c…","issueNumber":42}'
202 Accepted
{
  "resolutionId": "1d2e…",
  "jobId": "…",
  "remaining": 2
}

remaining is how many green fixes your free trial has left, or null on a paid plan. At most 20 calls an hour per account. Usage is charged only when a fix turns your CI green, not when you call this.

Read a resolution

GET /api/resolutions/{id} returns one resolution’s status. Poll it every 30 seconds or more; most finish within minutes.

Request
curl https://patchlit.dev/api/resolutions/1d2e… \
  -H "Authorization: Bearer $PATCHLIT_API_KEY"
200 OK
{
  "id": "1d2e…",
  "status": "running",
  "current_phase": 2,
  "quality_score": null,
  "pr_number": 128,
  "pr_url": "https://github.com/acme/api/pull/128",
  "branch_name": "patchlit/repro-issue-42",
  "error_message": null,
  "started_at": "2026-11-30T09:12:04Z",
  "completed_at": null,
  "created_at": "2026-11-30T09:12:01Z",
  "updated_at": "2026-11-30T09:13:40Z",
  "issue": { "id": "…", "title": "Crash on empty input", "number": 42, "body": "…", "state": "open", "labels": ["bug"] },
  "repo": { "id": "6f1c…", "full_name": "acme/api", "name": "api", "owner": "acme" }
}

Service health

GET /api/health needs no key. It answers 200 when Patchlit is working and 503 when the database, the queue or the worker is down; the body says which, as booleans only. GET /api/version returns the release running now.

Request
curl -i https://patchlit.dev/api/health

Errors

Errors are JSON with an error message written for a person: {"error": "repoId must be a repository id"}.

StatusMeaning
400The body is not valid JSON, or a field is missing or has the wrong type. The error message names the field.
401No API key, or the key is unknown, revoked, or unused for 90 days.
402Your plan's limit is reached. The body includes used, limit and upgradeUrl.
403The action is switched off for that repository (for example issues), or a dashboard request came from another site.
404Not found, or not yours: another account's ids read as not found.
409The resolution is already running or done, or the issue is closed.
422The repository is not connected through the GitHub App.
429Too many requests. Wait the number of seconds in the retry-after header.
500 / 503Something failed on our side. Retry later; GET /api/health shows which part is down.

Stability

Patchlit is in early access. We add fields without notice, so ignore fields you do not know. We announce removals or renamed fields on the blog before they happen.

Terms that apply: the Terms (section 4: what you may and may not do, and that anything done with your keys is done by you) and the Privacy Policy. See also Data, privacy and terms.