Skip to the content

API

Everything the dashboard does with sites, scans and issues, over HTTPS with an API key.


Make a key in Org settingsthenAPI keys. Choose what it may do and, if you like, the one site it is limited to. The API is part of the Pro plan and up.

A key is shown once

Copy it when you make it and keep it in a secret store. Ranky can't show it again.

How the API works

Every address starts withhttps://ranky.dev/api/v1OpenAPI 3.1 document

  • Every answer is JSON: { "data": … }, lists with nextCursor, errors as { "error": { code, message, fields? } }.
  • Send an API key as Authorization: Bearer rk_…. A key holds scopes and acts with the role of the person who made it, so it never does more than they can. A key limited to one site sees that site only.
  • Each key may make 120 calls a minute; past that the answer is 429 with Retry-After.
  • Lists are paged with cursor (the nextCursor of the page before), never by offset.
  • Objects may carry fields not listed here; new fields can appear at any time.

Projects

List sites

GET /projects

Every site of the org (a key limited to one site sees that one).

Add a site

POST /projects

Get a site

GET /projects/{id}

Scans

List a site's scans

GET /projects/{id}/scans

Newest first, each with its summary once it has one.

Start a scan

POST /projects/{id}/scans

An empty body starts a full scan.

Get a scan

GET /scans/{id}

Get a scan's report

GET /scans/{id}/report

What the scan found new, what came back, and what it resolved. A preview scan carries preview, its comparison with production. gate is the site's quality gate held against the new issues and regressions (a preview's new issues), null until the scan has finished.

Cancel a scan

POST /scans/{id}/cancel

200 for a scan that was waiting; 202 with stopping for one that is closing.

Issues

List a site's issues

GET /projects/{id}/issues

Open issues, most severe first, unless the query says otherwise. The first page also carries total and counts.

Get an issue

GET /issues/{id}

With the rule's fix guidance, the evidence and the issue's history.

Change an issue

PATCH /issues/{id}

note is the reason for ignored or accepted_risk (required for the latter); assignee a member's user ID or null.

Verify a fix

POST /issues/{id}/verify

A verify scan of the issue's addresses. 200 when one is already on its way.

Comment on an issue

POST /issues/{id}/comments

List a template issue's pages

GET /issues/{id}/pages

By URL; the cursor is the URL the page before ended with.

List saved filters

GET /projects/{id}/saved-filters

Save a filter

POST /projects/{id}/saved-filters

Delete a saved filter

DELETE /saved-filters/{id}

Changes and pages

List a site's changes

GET /projects/{id}/changes

Newest first, with the deploys recorded among them. The first page also carries total and counts.

List a site's pages

GET /projects/{id}/pages

Deploys

Report a deploy

POST /projects/{id}/deployments

202 with the scan it started: a deploy scan for production, and for a preview a scan of the preview's address compared with production (its report carries preview). 200 for a deployId reported before. A preview's url must be on another host than the site.

Alerts

List alert channels

GET /alert-channels

The org's email addresses and Slack, Discord and webhook channels.

Add an alert channel

POST /alert-channels

{ address } for email (a confirmation email goes out), or { type, url, name? } for a hook. A webhook's signing secret is shown this once.

Remove an alert channel

DELETE /alert-channels/{id}

Send a new confirmation link

POST /alert-channels/{id}/resend

List a site's alert rules

GET /projects/{id}/alert-rules

Add an alert rule

POST /projects/{id}/alert-rules

Get an alert rule

GET /alert-rules/{id}

Replace an alert rule

PATCH /alert-rules/{id}

Send the whole rule, as for adding one.

Delete an alert rule

DELETE /alert-rules/{id}

Send a test alert

POST /alert-rules/{id}/test

List a site's alert history

GET /projects/{id}/alerts

Infrastructure

List maintenance windows

GET /projects/{id}/maintenance-windows

The site's windows, and the one in force now (alerts wait until it ends).

List outages

GET /projects/{id}/incidents

The site's outages of the last 90 days, newest first.

Get an outage

GET /projects/{id}/incidents/{incidentId}

With its timeline. latest names the newest.

API keys

List API keys

GET /api-keys

Every key of the org, also the deploy keys of each site. Never the key itself.

Make an API key

POST /api-keys

The key is in secret, shown this once.

Rotate an API key

POST /api-keys/{id}/rotate

A new key with the same name, scopes and site. The old one keeps working for graceHours (default 24, 0 stops it at once).

Revoke an API key

DELETE /api-keys/{id}

Twice is not an error.

List a site's deploy keys

GET /projects/{id}/api-keys

Make a deploy key

POST /projects/{id}/api-keys

A key for this site that can only report deploys. secret is shown this once.

Revoke a deploy key

DELETE /projects/{id}/api-keys/{keyId}

Dashboard

This document

GET /openapi.json