All docs pages
For developers

The Roastd API

Everything you can see and do in Roastd, from your own scripts: your numbers, fixes and reports, and approving, declining or undoing fixes. Every address follows the same rules as the dashboard, and anything only you may do still waits for you on roastd.io.

Updated

Start

  1. Step 1: Make an API key

    In Roastd, open Settings, Connections, and press Make an API key. Name it, choose Read only or Read and act, and copy the key. It is shown this one time only, and you can revoke it there at any time.
  2. Step 2: Send it with every request

    As the header Authorization: Bearer <your key>. The API answers JSON at https://roastd.io/api/v1.
Your account and your sites
curl https://roastd.io/api/v1/me \
  -H "Authorization: Bearer roastd_your_key"
The fixes waiting for your yes
curl "https://roastd.io/api/v1/sites/acme-invoicing.com/fixes?show=needs_yes" \
  -H "Authorization: Bearer roastd_your_key"
Approve one
curl -X POST https://roastd.io/api/v1/fixes/fix_456/approve \
  -H "Authorization: Bearer roastd_your_key" \
  -H "Idempotency-Key: 6f1c2a90-0b7e-4f7e-9a1d-2c4b8e1f0a33"

The description for your tools

The whole API is described in OpenAPI 3.1 at /api/v1/openapi.json, from the same definitions the API checks with.

Reading

Any key. {site} is the site's domain, such as acme-invoicing.com, or its id.

Addresses that read
AddressWhat it gives
GET /meWho is connected
GET /sites/{site}/overviewHow a site is doing

Query weeks number, 1 to 52

GET /sites/{site}/searchesSearches on Google

Query show one of close, tracked, all · limit number, 1 to 100 · cursor text

GET /sites/{site}/pagesPages on Google

Query limit number, 1 to 100 · cursor text

GET /sites/{site}/ai-answersAI answers

Query excerpts number, 0 to 10

GET /sites/{site}/rivalsRivals
GET /sites/{site}/fixesThe change log

Query show one of needs_yes, waiting, live, this_week, all · limit number, 1 to 100 · cursor text

GET /fixes/{id}Read one fix
GET /sites/{site}/fixes-to-makeFixes to make in the code
GET /sites/{site}/reportsMonday emails and reviews
GET /sites/{site}/reports/{id}One report in full
GET /sites/{site}/settingsA site's settings
GET /sites/{site}/factsThe site's facts
GET /sites/{site}/ai-questionsThe questions asked of AI answers
GET /sites/{site}/planA site's plan
GET /free-reports/{id}Read a free report
POST /linksLink to a step on roastd.io

Body purpose text, required · site text · fix text

Reporting fixes your code makes

Any key, read only too: a script or tool that makes an approved fix in your code says so here, and the fix shows as live and is measured from that day.

Addresses that report fixes made in your code
AddressWhat it does
POST /fixes/{id}/madeReport a fix made

Body note text · liveOn text

POST /fixes/{id}/put-backSay the old version is in place again
POST /fixes/{id}/problemReport a fix you could not make

Body problem text, required

Acting

Keys that may act. A new page, a redirect, removing a page from Google, or a claim about price, law, health, money or a rival answers needs_person with the roastd.io link instead, and paying, switching Autopilot on, loosening a rule and team changes are not in the API at all.

A body is one JSON object with the fields listed. Any other field is left out, and the parts of the address always win.

Addresses that act
AddressWhat it does
POST /fixes/{id}/approveApprove a fix
POST /fixes/{id}/declineDecline a fix
POST /fixes/{id}/stopStop a fix in its wait
POST /fixes/{id}/undoUndo a live fix
POST /fixes/{id}/answersAnswer a new page's questions

Body answers list of objects with question, answer, 1 to 8, required

POST /sites/{site}/searchesTrack searches

Body searches list of text, 1 to 10, required

DELETE /sites/{site}/searches/{id}Stop tracking a search
POST /sites/{site}/rivalsAdd a rival

Body address text, required

DELETE /sites/{site}/rivals/{id}Remove a rival
POST /sites/{site}/factsAdd a fact

Body question text, required · answer text, required

PATCH /sites/{site}/facts/{id}Edit a fact

Body question text, required · answer text, required

DELETE /sites/{site}/facts/{id}Delete a fact
POST /sites/{site}/ai-questionsAdd a question

Body text text, required

PATCH /sites/{site}/ai-questions/{key}Change, take out, put back or reset a question

Body action one of change, take_out, put_back, reset, required · text text

POST /sites/{site}/leave-aloneLeave a page alone

Body page text, required

PATCH /sites/{site}/approval-levels/{kind}Make a rule stricter

Body level one of wait_48h, always_ask, required

POST /sites/{site}/autopilot/offSwitch Autopilot off
PUT /sites/{site}/time-zoneSet the time zone

Body timeZone text, required

POST /free-reportsStart a free report

Body address text, required

Sending a request again

Send an Idempotency-Key header (any unique string, such as a UUID) with any request that acts. If the same key and request come again within 24 hours, the API answers the first answer again, with Idempotent-Replayed: true, and nothing happens twice. The same key with a different request is refused.

Some answers are not kept, so the same key runs the request again: a limit (429) or a fault on our side (5xx), where waiting helps, and a refusal about the key or the plan (402, 403), which can change once a trial starts or a key that may act is used.

Lists, a page at a time

Lists take limit (up to 100) and cursor. When there is more, the answer has nextCursor: send it as cursor for the next page. Field names are the same as in the connector's answers.

Limits

60 requests a minute and 5,000 a day for each key, and 300 changes a day for each person across every key and connected app. Past one, the answer is 429 with Retry-After.

Errors

Every error is application/problem+json: a code your program can act on, the plain sentence to show a person in detail, and, for a step only the person may take, next with the roastd.io link.

403 needs_person
{
  "type": "https://roastd.io/docs/api#needs-person",
  "title": "Only the person may do this",
  "status": 403,
  "detail": "A new page always waits for your own yes on roastd.io.",
  "code": "needs_person",
  "next": {
    "purpose": "approve_fix",
    "url": "https://roastd.io/open?to=approve_fix&site=site_123&fix=fix_456",
    "what": "Open it on roastd.io, read the exact text, and approve it there."
  }
}
400 invalid
Something sent does not fit. The sentence names the field.
400 which_site
You have several sites: name one in the address.
400 bad_json
The body is not one JSON object.
401 unauthorised
No API key, or one that was revoked.
402 needs_plan
The fix needs a trial or a plan first. For an owner, next opens Billing; for a member, detail names the owner who can start one.
403 read_only
This key may only read. Make one that may act.
403 owner_only
Only an owner of the site may do this.
403 needs_person
Only the person may do this, on roastd.io. next has the link that opens it.
404 not_found
No such site, fix or report among your own.
404 no_route
No such address in the API.
405 method
The address takes other methods. Allow lists them.
409 conflict
The fix moved on: a teammate or the agent changed it first.
409 idempotency_running
The first request with this Idempotency-Key is still running. Retry-After says when to ask again: 5 seconds.
413 too_large
The body is over 100,000 characters.
415 unsupported_media
Send the body as JSON.
422 idempotency_mismatch
This Idempotency-Key was used for another request in the last 24 hours.
429 limit
Too many requests. Retry-After says when to try again.
503 unavailable
Something we rely on is not answering. Try again later.

Versions

/v1 only grows: new addresses and new fields, never a field taken away or a meaning changed. If something must go, it is announced in the changelog and with Deprecation and Sunset headers on the address.

Using an AI tool instead of a script? Add Roastd to it with the connector. What a key can reach is also on the security page.