API reference

Manage your account with the API

Everything the dashboard does, with an API key: see the account, make, roll and revoke keys, set the webhook URL, read or rotate the secret, send a test event and read each delivery, see usage, logs, billing and the team, and read the audit log of every change.

How it works

  • Same keys, same address. Send authorization: Bearer <key> to https://api.checksharecode.co.uk/v1/..., as for checks. These endpoints are only on the API’s address.
  • A key acts on its own mode. A sandbox (rtw_test_) key sees and changes sandbox keys, the sandbox webhook URL, secret and deliveries; a live (rtw_live_) key the live ones. To set up the sandbox, use a sandbox key.
  • Every key can change its mode. So treat a live key like a password. Every change to live settings, and every read of the live secret, is emailed to the account’s owner and admins, naming the key that did it.
  • Free, and limited per key. These calls never use a check. Each key may make 10 reads and 2 changes a second (429 RATE_LIMITED, with Retry-After).
  • A person still pays and claims. Paying, the card, handing over ownership and claiming an agent’s account stay in the dashboard.

Start with GET /v1/account

It says which key you sent, its mode, the plan and this month’s checks, the default webhook URL, and for an agent’s unclaimed account its name and claim_url. It never shows an email address.

GET /v1/account
curl https://api.checksharecode.co.uk/v1/account \
  -H "authorization: Bearer rtw_test_…"

# 200 OK
{
  "account_id": "6f1c…",
  "mode": "test",
  "key": { "id": "…", "name": "Agent sandbox key", "prefix": "rtw_test_abcdefg", "created_by": "agent" },
  "plan": { "tier": "free", "included": 10, "used": 3, "period_end": "2026-11-30" },
  "agent": { "unclaimed": true, "name": "Codex for Acme Ltd", "claim_url": "https://checksharecode.co.uk/claim#…" },
  "webhooks": { "default_url": null }
}

Set up and debug webhooks

Webhooks with the API
# 1. Where async checks without a callback_url post their result
curl -X PUT https://api.checksharecode.co.uk/v1/webhooks/settings \
  -H "authorization: Bearer rtw_test_…" -H "content-type: application/json" \
  -d '{"default_url": "https://example.com/webhooks/checksharecode"}'

# 2. The secret to verify them with
curl https://api.checksharecode.co.uk/v1/webhooks/secret -H "authorization: Bearer rtw_test_…"
# {"secret": "whsec_…"}

# 3. A signed check.test event, sent once
curl -X POST https://api.checksharecode.co.uk/v1/webhooks/test -H "authorization: Bearer rtw_test_…"
# 202 {"id": "8d0e…"}

# 4. What your endpoint answered
curl https://api.checksharecode.co.uk/v1/webhooks/deliveries/8d0e… -H "authorization: Bearer rtw_test_…"

last_status_code and last_response (the start of your endpoint’s answer, up to 1,000 characters, with anything shaped like applicant data removed) say why a delivery failed. Fix your endpoint, then POST /v1/webhooks/deliveries/{id}/resend, or send another test event. Do not poll more than once every few seconds.

GET /v1/webhooks/deliveries/{id}
{
  "id": "8d0e…",
  "event_id": "evt_test_…",
  "check_id": null,
  "type": "check.test",
  "host": "example.com",
  "path": "/webhooks/checksharecode",
  "status": "failed",
  "attempts": 1,
  "last_status_code": 404,
  "last_error": null,
  "last_duration_ms": 41,
  "last_response": "{"error":"no route for /webhooks/checksharecode"}",
  "last_response_type": "application/json",
  "next_attempt_at": null,
  "created_at": "2026-11-06T10:00:00.000Z",
  "delivered_at": null,
  "can_resend": true
}
EndpointWhat it does
GET /v1/webhooks/settingsThe default URL and when the secret last changed.
PUT /v1/webhooks/settingsSets default_url (https on a public address), or clears it with null.
GET /v1/webhooks/secretThe whsec_ signing secret.
POST /v1/webhooks/secret/rotateA new secret, used at once. The old one also signs every event for keep_previous_hours (24 unless you send it; 0 stops it now), so your verifier works with either while you move. If the secret may have leaked, send 0.
POST /v1/webhooks/testA signed check.test to url, or the default URL, sent once. One a second. With "wait": true the answer is the delivery itself: no need to read it after.
GET /v1/webhooks/deliveriesNewest first, 50 a page: limit, status, type, check_id, cursor.
GET /v1/webhooks/deliveries/{id}One delivery.
POST /v1/webhooks/deliveries/{id}/resendSends it again as a new delivery, same webhook-id.

Make and revoke keys

Keys with the API
# Make a key for a second server (same mode as the key you send)
curl -X POST https://api.checksharecode.co.uk/v1/keys \
  -H "authorization: Bearer rtw_live_…" -H "content-type: application/json" \
  -d '{"name": "Staging server"}'
# 201 {"key": {"id": "…", "prefix": "rtw_live_abcdefg", "created_by": "api", …}, "plaintext": "rtw_live_…"}

# Roll one: revoked at once, replaced by a new key with the same name
curl -X POST https://api.checksharecode.co.uk/v1/keys/<id>/roll -H "authorization: Bearer rtw_live_…"
# 201 {"key": {…}, "plaintext": "rtw_live_…"}

# Revoke one (never the key you are sending)
curl -X DELETE https://api.checksharecode.co.uk/v1/keys/<id> -H "authorization: Bearer rtw_live_…"
# 204
  • `GET /v1/keys` lists the mode’s keys, revoked ones too, with created_by: dashboard, api or agent. Never a key itself.
  • A new key is shown once. Store its plaintext at once. At most 20 active keys a mode.
  • A key cannot revoke itself (409), so an agent cannot lock itself out by mistake. Revoke it from another key or the dashboard.
  • Roll works as the dashboard’s Roll: the old key stops at once and the new one, with the same name, is in the answer only. A key may roll itself, so store the new one before your next request.

Usage, logs, billing and support

EndpointWhat it does
GET /v1/usageThis month’s checks against the allowance, day by day, and the last 30 days by check.
GET /v1/checksThe check log for your key’s mode, newest first: limit, cursor, from, to.
GET /v1/requestsEvery API call with your mode’s keys in the last 30 days, and its status: failed=true shows what was refused.
GET /v1/billingThe plan, its price and this period’s checks. Read only.
POST /v1/billing/checkout-link{"plan": "pro"}, "scale", "platform" or "payg": the link where a person changes the plan. The API buys nothing.
GET|PUT /v1/account/preferences{"incident_emails": true}. Changing it needs a live key.
POST /v1/support{"topic": "integration", "message": "…", "request_ids": ["req_…"]}: emails support, replies go to the owner. One a minute, 5 a day.

The team

A live key can do what an admin does on the Team page. The team belongs to the whole account, so sandbox keys can’t, and every change is emailed to the owner and admins. Handing ownership over, leaving, and accepting an invite stay with a person in the dashboard.

EndpointWhat it does
GET /v1/teamThe organisation’s name, its people and their roles, and invites waiting.
PUT /v1/team/name{"name": "Acme Ltd"}: needed before the first invite.
POST /v1/team/invitations{"email": "…", "role": "member"} or "admin": emails an invite in the owner’s name, valid 7 days.
POST /v1/team/invitations/{id}/resendA new link for another 7 days.
DELETE /v1/team/invitations/{id}Cancels it: the link stops working.
PATCH /v1/team/members/{userId}{"role": "admin"} or "member". Never the owner’s.
DELETE /v1/team/members/{userId}Removes them at once. Never the owner.

The audit log

Every change to the account, from the dashboard or the API, and every dashboard sign-in, newest first, kept 12 months. A sandbox key sees sandbox events; a live key sees live ones and the account-wide ones (the team, sign-ins, billing). Owners and admins see all of it, with the IP address of each person’s change, on the dashboard’s Activity page.

EndpointWhat it does
GET /v1/audit_eventsWho did what, to what, and what changed: limit, cursor, action (api_key.*,member.*), actor_type, actor_id, key_prefix, target_id, since, until.
GET /v1/audit_events/{id}One event, aev_….
  • Actions include api_key.created, .rolled, .revoked; webhook_settings.updated; webhook_secret.revealed (live), .rotated; member.invited, .joined, .role_updated, .removed; organisation.renamed; preferences.updated; billing.plan_changed; user.signed_in, user.sign_in_failed.
  • A key’s change carries the request_id from its X-Request-Id, to find it in GET /v1/requests too.
  • Never an IP address through the API, and an invited person’s address is masked (j***@acme.com).

Agents nobody has claimed yet

An agent’s sandbox key from POST /v1/agent/signup can do all of this in the sandbox, including sandbox webhooks and a callback_url on sandbox async checks, with up to 50 test events a day. Its live key can read the live settings but not change them (403 PERMISSION_DENIED, with the claim_url) until its person claims the account.

Errors

CodeStatusMeaning
RESOURCE_NOT_FOUND404No key or delivery with that id in this account and mode.
PERMISSION_DENIED403An unclaimed agent’s live key tried a change. Carries claim_url.
INVALID_INPUT400 or 409A bad body or URL, a key revoking itself, or a resend that can’t go yet.
RATE_LIMITED429Too many calls for this key, or test events for this account.