Automate
REST API
Base URL, authentication, errors, pagination and every endpoint, with curl examples.
Everything the dashboard does is also a JSON endpoint. This page covers what every endpoint has in common, then examples, then the list of endpoints. The OpenAPI document has the full request and response schemas.
Base URLs
| Environment | API | Dashboard |
|---|---|---|
| Production | https://api.showbugai.com | https://app.showbugai.com |
| Preprod | https://preprod-api.showbugai.com | https://preprod.showbugai.com |
| Dev | https://dev-api.showbugai.com | https://dev.showbugai.com |
Every path on this page starts with /api/v1. The project list in production, for example, is https://api.showbugai.com/api/v1/orgs/{org_id}/projects. Use HTTPS only.
Each environment has its own organisations, tokens and data. A token works only in the environment where it was created.
Requests and answers are JSON. A request with a body needs Content-Type: application/json and may be up to 16 KB. Ids are opaque strings such as prj_…, and timestamps are ISO 8601 in UTC.
Authentication
Send an API token in the Authorization header of every request:
Authorization: Bearer sbp_...- A missing, malformed, unknown, expired or revoked token gets
401 unauthenticated. The answer is the same in every case. - A token belongs to one organisation.
GET /mereturns it, so it is the quickest way to check a token and to find the{org_id}the other paths need. - A token can do what its scopes allow and what its creator’s role allows, up to admin. See Scopes.
Do not send a token from a web page. Anyone who opens the page could read it.
Errors
A failed request answers with a status and a JSON body:
{
"error": {
"code": "insufficient_scope",
"message": "This API token does not have the scope this endpoint needs."
}
}Branch on code: it is a stable snake_case word. message is a fixed sentence for people and logs. It may be reworded, and it never repeats what you sent. For a code you do not know, fall back to the HTTP status.
| Status | Code | What it means and what to do |
|---|---|---|
| 400, 422 | bad_json, invalid, invalid_* | The body is not valid JSON, or a field or parameter is not acceptable. The invalid_ codes name the problem, such as invalid_email or invalid_cursor. Fix the request; sending it again unchanged fails again. |
| 401 | unauthenticated | The token is missing, malformed, unknown, expired or revoked. Check the header, then the token’s status under Settings → API tokens. Create a new token if it has expired or been revoked. |
| 403 | insufficient_scope | The token does not have the scope the endpoint needs (see the endpoint reference). Scopes cannot be added to an existing token: create one that has it. |
| 403 | forbidden | The token’s creator does not have the role this needs. A token acts with its creator’s current role, up to admin. |
| 403 | owner_required | Only an owner can do this, such as changing an owner’s role. A token never acts as an owner, so do it in the dashboard. |
| 403 | session_required | The endpoint is only for a person signed in to the dashboard, such as managing tokens or creating an organisation. |
| 403 | org_suspended | The organisation is suspended. Contact Showbug support. |
| 404 | not_found | The thing does not exist, or belongs to another organisation. The two answers are identical on purpose. Check the ids, and that the token is for this organisation. |
| 409 | project_limit, key_limit, member_limit, invite_limit, token_limit, too_many_destinations | A limit is reached. Revoke or remove something first. See Limits and quotas. |
| 409 | already_member, last_owner, slug_taken | The request conflicts with the current state: the person is already a member, the last owner cannot be demoted or removed, or the name is taken. |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running. Send yours again after a second. |
| 413 | too_large | The request body is over 16 KB. |
| 422 | idempotency_key_reused | The Idempotency-Key was already used for a different request. Use a new key. |
| 422 | provider_refused, provider_unavailable, webhook_https_required, webhook_private_address | An integration was refused. The provider (Linear or GitHub) rejected the credentials or could not be reached, or the webhook URL is not acceptable: it must use https and must not point at a private or internal address. |
| 429 | rate_limited | The token made more than 120 requests in a minute. Wait the number of seconds in Retry-After, then retry. |
| 500 | internal | A fault on Showbug’s side. Retry once; if it keeps happening, contact support. |
| 503 | unavailable | The service is briefly unavailable. Retry after the number of seconds in Retry-After. |
The widget’s own endpoints, /api/v1/sessions and /api/v1/storage, are used by the SDK in your visitors’ browsers. They are a different API and keep a simpler error body, {"error": "<code>"}.
Pagination
Lists that can grow without limit use cursors. They come back newest first.
| Endpoint | Default limit | Maximum limit |
|---|---|---|
listSessions | 200 | 200 |
listAuditEvents | 100 | 200 |
listDeliveries | 100 | 200 |
- Send
limitto choose the page size, from 1 up to the maximum. A value outside the range is a422error. - The answer has a
nextCursornext to the list. Send it back ascursorto get the next page, with the same filters. It isnullon the last page. - A cursor is opaque: do not build or read one. One the API did not issue is
422 invalid_cursor; start again without it.
The other lists, such as projects, keys, members, invites and integrations, are small and come back in one answer. See the examples for a loop that walks every page.
Idempotency
If a create times out, you cannot tell whether it worked, and sending it again can make a duplicate. Send an Idempotency-Key header with the create instead. A retry with the same key gives you the first answer rather than a second resource.
| If you send | You get |
|---|---|
| The same key and the same request | The first answer again, with the header Idempotent-Replayed: true. Nothing is created twice. |
| The same key and a different request | 422 idempotency_key_reused |
| The same key while the first request is still running | 409 idempotency_in_progress. Send it again after a second. |
| The same key after a request that failed | The request runs again. A failed request leaves no record. |
- The key is 1 to 128 characters from
A-Z a-z 0-9 . _ : -. A UUID works. Anything else is422 invalid_idempotency_key. - Make one key for each create and reuse it only when you retry that create. Two requests are the same when the method, the path and the JSON body match.
- Records are kept for 24 hours. These creates accept the header:
createProject,createProjectKey,createInvite,createWebhook,connectLinearApiKeyandconnectGithubToken. - A one-time secret, such as the invite link or a webhook’s signing secret, is never stored. A replay leaves it out. If you lost it, invite the address again, or rotate the webhook secret.
Rate limits
Each token may make 120 requests a minute, and answers to a token carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. See API tokens for what each one means. Over the limit, the request is not processed:
HTTP/1.1 429 Too Many Requests
Retry-After: 1
RateLimit-Limit: 120
RateLimit-Remaining: 0
RateLimit-Reset: 60
Content-Type: application/json
{"error":{"code":"rate_limited","message":"Too many requests. Wait for the time in Retry-After, then retry."}}- Wait the number of seconds in Retry-After, then send it again.
- In a bulk job, watch
RateLimit-Remainingand slow down before it reaches 0, rather than retrying after errors. - Give each integration its own token. The limit is per token, so one busy job does not slow the others.
OpenAPI
curl https://api.showbugai.com/api/v1/openapi.json- The document is OpenAPI 3.1. It is public, so it needs no token, and it can be cached.
- Every operation has an
operationId, a summary, examples, the shared error responses, and the scope and role it needs, inx-required-scopeandx-required-role. - Use it to generate a client, or give it to an AI agent. If this page and the document disagree, the document is right.
- The CLI and the MCP server follow the same operations. An MCP tool is named after the
operationIdin snake_case:listProjectsislist_projects.
Examples
These examples use curl and jq. Set your token and the base URL once:
export SHOWBUG_TOKEN="sbp_..." # from Settings → API tokens
export API="https://api.showbugai.com/api/v1"Who am I
curl -sS "$API/me" -H "Authorization: Bearer $SHOWBUG_TOKEN"{
"user": { "id": "usr_…", "email": "dana@example.com", "name": "Dana", "pictureUrl": null },
"orgs": [
{ "id": "org_…", "name": "Acme", "slug": "acme", "status": "active", "role": "admin" }
],
"token": {
"id": "tok_…",
"name": "GitHub Actions deploy",
"scopes": ["keys:write", "projects:write"],
"expiresAt": "2026-12-28T10:15:00Z"
}
}Keep the organisation’s id for the rest of the examples:
export ORG=$(curl -sS "$API/me" -H "Authorization: Bearer $SHOWBUG_TOKEN" | jq -r '.orgs[0].id')Create a project
The project comes with one key, labelled Default. The Idempotency-Key makes a retry safe. $(uuidgen) makes a new key each time the command runs, so in a script make the key once and reuse it when you retry.
curl -sS "$API/orgs/$ORG/projects" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"name": "Marketing site", "allowedOrigins": ["https://www.example.com"]}'{
"id": "prj_…",
"name": "Marketing site",
"slug": "marketing-site",
"status": "active",
"allowedOrigins": ["https://www.example.com"],
"reviewRequired": false,
"limits": {
"max_session_seconds": 180,
"max_sessions_per_hour": 30,
"max_sessions_per_month": 1000,
"max_sessions_per_ip_hour": 10
},
"createdAt": "2026-11-28T10:15:00Z",
"updatedAt": "2026-11-28T10:15:00Z",
"keys": [
{
"id": "key_…",
"publicKey": "pk_…",
"label": "Default",
"status": "active",
"createdAt": "2026-11-28T10:15:00Z",
"revokedAt": null,
"lastUsedAt": null
}
]
}export PROJECT="prj_..." # the id from the answer aboveAdd an allowed origin
An origin is a scheme and host with an optional port and no path, such as https://app.example.com. The rules are the ones in API keys and security, and a project holds up to 50. Adding one it already has changes nothing.
curl -sS "$API/orgs/$ORG/projects/$PROJECT/origins" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
-H "Content-Type: application/json" \
-d '{"origin": "https://staging.example.com"}'{ "origins": ["https://www.example.com", "https://staging.example.com"] }To remove one, send DELETE with the origin in the query string. Changes to origins and keys take up to 30 seconds to apply.
curl -sS -X DELETE -G "$API/orgs/$ORG/projects/$PROJECT/origins" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
--data-urlencode "origin=https://staging.example.com"Create an SDK key
The publicKey goes in the script tag on your page (see Install). It is not a secret. A project holds up to 10 active keys, so you can rotate without downtime: create the new key, deploy it, then revoke the old one with DELETE /orgs/{org_id}/projects/{project_id}/keys/{key_id}.
curl -sS "$API/orgs/$ORG/projects/$PROJECT/keys" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"label": "Production"}'{
"id": "key_…",
"publicKey": "pk_…",
"label": "Production",
"status": "active",
"createdAt": "2026-11-28T10:15:00Z",
"revokedAt": null,
"lastUsedAt": null
}Create a webhook
The URL must use https. events is optional and defaults to both events, session.completed and ticket.created. The signing secret is in this answer once, so store it now.
curl -sS "$API/orgs/$ORG/projects/$PROJECT/integrations/webhook" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"url": "https://hooks.example.com/showbug", "events": ["session.completed", "ticket.created"]}'{
"destination": {
"id": "dst_…",
"kind": "webhook",
"status": "active",
"auth": "secret",
"account": { "name": "hooks.example.com" },
"config": {
"url": "https://hooks.example.com/showbug",
"events": ["session.completed", "ticket.created"]
},
"health": { "failures": 0, "openUntil": null, "lastError": null, "lastErrorAt": null, "lastOkAt": null },
"previousSecretUntil": null,
"createdAt": "2026-11-28T10:15:00Z",
"updatedAt": "2026-11-28T10:15:00Z"
},
"secret": "whsec_…"
}Each delivery is a POST of JSON. Check it before you trust it:
Showbug-Signatureist=<unix time>,v1=<hex>. The hex is the HMAC-SHA256, keyed with the secret, of the timestamp, a dot and the raw request body.- Reject a timestamp more than 5 minutes old, and compare the signatures in constant time.
- Ignore an event you have seen.
Showbug-Event-Idis the same on every retry of one event. - For 24 hours after
rotateWebhookSecret, the header carries twov1=values. Accept either.
Page through sessions
This prints every session, newest first, 50 at a time. It follows nextCursor until it is null. Add --data-urlencode "project=prj_..." to read one project’s sessions.
cursor=()
while :; do
page=$(curl -sS -G "$API/orgs/$ORG/sessions" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
--data-urlencode "limit=50" "${cursor[@]}")
echo "$page" | jq -r '.sessions[] | [.id, .startedAt, .status] | @tsv'
next=$(echo "$page" | jq -r '.nextCursor // empty')
[ -z "$next" ] && break
cursor=(--data-urlencode "cursor=$next")
doneList failed deliveries and retry one
A delivery that has used all its attempts has the status dead. The other statuses are pending, running, succeeded and cancelled.
curl -sS -G "$API/orgs/$ORG/projects/$PROJECT/integrations/deliveries" \
-H "Authorization: Bearer $SHOWBUG_TOKEN" \
--data-urlencode "status=dead" \
| jq '.deliveries[] | {id, event, attempts, lastCode, lastError}'Retrying queues the delivery again at once, with its attempts reset:
export DELIVERY="dlv_..." # an id from the list above
curl -sS -X POST "$API/orgs/$ORG/projects/$PROJECT/integrations/deliveries/$DELIVERY/retry" \
-H "Authorization: Bearer $SHOWBUG_TOKEN"{
"id": "dlv_…",
"destinationId": "dst_…",
"kind": "webhook",
"sessionId": "ses_…",
"event": "ticket.created",
"eventId": "evt_…",
"status": "pending",
"attempts": 0,
"maxAttempts": 12,
"nextAttemptAt": "2026-11-28T10:15:00Z",
"lastError": "…",
"lastCode": 502,
"lastLatencyMs": 31,
"externalId": null,
"externalUrl": null,
"createdAt": "2026-11-28T09:40:00Z",
"updatedAt": "2026-11-28T10:15:00Z"
}Endpoint reference
Paths start with /api/v1. A call needs the scope for a token, and the token’s creator needs at least the role. Tokens act as admin at most, so nothing that needs an owner is open to them. Creates marked Idempotency-Key accept that header. See Scopes.
Account
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
getMe | GET /me | Any token | Any | Works with any valid token. Returns the user, the token’s organisation and the token’s name, scopes and expiry. |
Organisation
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
getOrg | GET /orgs/{org_id} | org:read | viewer | |
renameOrg | PATCH /orgs/{org_id} | org:write | admin | Body: name. |
Members and invites
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listMembers | GET /orgs/{org_id}/members | members:read | viewer | |
changeMemberRole | PATCH /orgs/{org_id}/members/{user_id} | members:write | admin | Body: role. A token cannot make someone an owner or change an owner’s role. |
removeMember | DELETE /orgs/{org_id}/members/{user_id} | members:write | viewer | Anyone may remove themselves; removing someone else needs admin. Also revokes that person’s tokens. Answers 204. |
listInvites | GET /orgs/{org_id}/invites | members:read | admin | Pending invites. |
createInvite | POST /orgs/{org_id}/invites | members:write | admin | Body: email, role. Idempotency-Key. The invite is emailed, and its link is in the answer once. A token cannot invite an owner. Answers 201. |
resendInvite | POST /orgs/{org_id}/invites/{invite_id}/resend | members:write | admin | Makes a new invite for the same address and role, emails it and ends the old link. Subject to a send limit per address (429 rate_limited). Answers 201. |
revokeInvite | DELETE /orgs/{org_id}/invites/{invite_id} | members:write | admin | Answers 204. |
Audit log
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listAuditEvents | GET /orgs/{org_id}/audit | audit:read | admin | Paginated, newest first. Events a token caused have via set. |
Projects
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listProjects | GET /orgs/{org_id}/projects | projects:read | viewer | |
createProject | POST /orgs/{org_id}/projects | projects:write | admin | Body: name, allowedOrigins. Idempotency-Key. Also creates the first key, labelled Default. Answers 201. |
getProject | GET /orgs/{org_id}/projects/{project_id} | projects:read | viewer | Includes the project’s keys. |
updateProject | PATCH /orgs/{org_id}/projects/{project_id} | projects:write | admin | Send only what changes: name, allowedOrigins (replaces the whole list), reviewRequired, status (active or suspended), limits. |
Allowed origins
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listAllowedOrigins | GET /orgs/{org_id}/projects/{project_id}/origins | projects:read | viewer | |
addAllowedOrigin | POST /orgs/{org_id}/projects/{project_id}/origins | projects:write | admin | Body: origin. Adding one the project already has changes nothing. |
removeAllowedOrigin | DELETE /orgs/{org_id}/projects/{project_id}/origins?origin= | projects:write | admin | The origin is a query parameter. Removing one the project does not have changes nothing. |
SDK keys
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listProjectKeys | GET /orgs/{org_id}/projects/{project_id}/keys | keys:read | viewer | |
createProjectKey | POST /orgs/{org_id}/projects/{project_id}/keys | keys:write | admin | Body: label. Idempotency-Key. Answers 201. |
revokeProjectKey | DELETE /orgs/{org_id}/projects/{project_id}/keys/{key_id} | keys:write | admin | Cannot be undone. |
Integrations
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listIntegrations | GET /orgs/{org_id}/projects/{project_id}/integrations | integrations:read | viewer | The project’s integrations and the connection methods on offer. Secrets are never returned. |
listIntegrationOptions | GET /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}/options | integrations:read | admin | Live from the provider: Linear teams, labels and projects, or GitHub repositories and labels. |
startIntegrationOAuth | POST /orgs/{org_id}/projects/{project_id}/integrations/{provider}/oauth | integrations:write | admin | provider is linear or github. Returns a URL that a person opens to approve; the dashboard finishes the flow. |
connectLinearApiKey | POST /orgs/{org_id}/projects/{project_id}/integrations/linear/api-key | integrations:write | admin | Body: apiKey. Idempotency-Key. Choose the team afterwards with updateIntegration. Answers 201. |
connectGithubToken | POST /orgs/{org_id}/projects/{project_id}/integrations/github/pat | integrations:write | admin | Body: token. Idempotency-Key. Choose the repository afterwards with updateIntegration. Answers 201. |
createWebhook | POST /orgs/{org_id}/projects/{project_id}/integrations/webhook | integrations:write | admin | Body: url, events. Idempotency-Key. The signing secret is in the answer once. Answers 201. |
updateIntegration | PATCH /orgs/{org_id}/projects/{project_id}/integrations/{destination_id} | integrations:write | admin | Send only what changes. The fields depend on the kind: team and labels (Linear), repository and labels (GitHub), url and events (webhook), and status (active or paused). |
testIntegration | POST /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}/test | integrations:write | admin | A webhook gets a signed ping; Linear and GitHub are checked with the stored credentials. A failure is in the answer, not an HTTP error. |
rotateWebhookSecret | POST /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}/rotate-secret | integrations:write | admin | The new secret is in the answer once. The old one keeps signing for 24 hours. |
removeIntegration | DELETE /orgs/{org_id}/projects/{project_id}/integrations/{destination_id} | integrations:write | admin | Deletes the stored credentials and cancels pending deliveries. Answers 204. |
Deliveries
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listDeliveries | GET /orgs/{org_id}/projects/{project_id}/integrations/deliveries | integrations:read | viewer | Paginated, newest first. Filters: status, destination, session. |
retryDelivery | POST /orgs/{org_id}/projects/{project_id}/integrations/deliveries/{delivery_id}/retry | integrations:write | admin | Only for a dead or pending delivery; any other is not_found. |
Sessions
| Operation | Request | Scope | Role | Notes |
|---|---|---|---|---|
listSessions | GET /orgs/{org_id}/sessions | sessions:read | viewer | Paginated, newest first. Filters: project, status (active, ended or abandoned). |
getSession | GET /orgs/{org_id}/sessions/{session_id} | sessions:read | viewer | Adds mediaChunks and replaySegments, the amount of video and replay stored. |
getSessionEvents | GET /orgs/{org_id}/sessions/{session_id}/events | sessions:read | viewer | The page replay events (rrweb). Large; meant for a player. |
getSessionMedia | GET /orgs/{org_id}/sessions/{session_id}/media | sessions:read | viewer | The screen recording as one video stream. Supports byte ranges. |
retrySessionTickets | POST /orgs/{org_id}/sessions/{session_id}/ticket/retry | integrations:write | admin | Queues the session’s dead deliveries again. Answers ticketStatus. |
Signed-in people only
No token can call these. They answer 403 session_required. Creating an organisation is not open to a token because a token belongs to one organisation and cannot make another.
| Operation | Request | Notes |
|---|---|---|
createOrg | POST /orgs | Creates an organisation; the caller becomes its first owner. |
listApiTokens | GET /orgs/{org_id}/tokens | Lists the organisation’s tokens, and the scopes a new one can have. |
createApiToken | POST /orgs/{org_id}/tokens | Body: name, scopes, expiresInDays (1 to 365, default 30). The token is in the answer once. Answers 201. |
revokeApiToken | DELETE /orgs/{org_id}/tokens/{token_id} | Revoking a token that is already revoked changes nothing. |
Signing in, accepting an invite, the Linear and GitHub sign-in callbacks and GitHub’s webhook are browser or provider flows. They are not part of this API.