Skip to content

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

EnvironmentAPIDashboard
Productionhttps://api.showbugai.comhttps://app.showbugai.com
Preprodhttps://preprod-api.showbugai.comhttps://preprod.showbugai.com
Devhttps://dev-api.showbugai.comhttps://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 /me returns 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.

StatusCodeWhat it means and what to do
400, 422bad_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.
401unauthenticatedThe 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.
403insufficient_scopeThe 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.
403forbiddenThe token’s creator does not have the role this needs. A token acts with its creator’s current role, up to admin.
403owner_requiredOnly 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.
403session_requiredThe endpoint is only for a person signed in to the dashboard, such as managing tokens or creating an organisation.
403org_suspendedThe organisation is suspended. Contact Showbug support.
404not_foundThe 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.
409project_limit, key_limit, member_limit, invite_limit, token_limit, too_many_destinationsA limit is reached. Revoke or remove something first. See Limits and quotas.
409already_member, last_owner, slug_takenThe 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.
409idempotency_in_progressA request with the same Idempotency-Key is still running. Send yours again after a second.
413too_largeThe request body is over 16 KB.
422idempotency_key_reusedThe Idempotency-Key was already used for a different request. Use a new key.
422provider_refused, provider_unavailable, webhook_https_required, webhook_private_addressAn 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.
429rate_limitedThe token made more than 120 requests in a minute. Wait the number of seconds in Retry-After, then retry.
500internalA fault on Showbug’s side. Retry once; if it keeps happening, contact support.
503unavailableThe 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.

EndpointDefault limitMaximum limit
listSessions200200
listAuditEvents100200
listDeliveries100200
  • Send limit to choose the page size, from 1 up to the maximum. A value outside the range is a 422 error.
  • The answer has a nextCursor next to the list. Send it back as cursor to get the next page, with the same filters. It is null on 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 sendYou get
The same key and the same requestThe first answer again, with the header Idempotent-Replayed: true. Nothing is created twice.
The same key and a different request422 idempotency_key_reused
The same key while the first request is still running409 idempotency_in_progress. Send it again after a second.
The same key after a request that failedThe 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 is 422 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, connectLinearApiKey and connectGithubToken.
  • 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-Remaining and 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, in x-required-scope and x-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 operationId in snake_case: listProjects is list_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 above

Add 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-Signature is t=<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-Id is the same on every retry of one event.
  • For 24 hours after rotateWebhookSecret, the header carries two v1= 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")
done

List 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

OperationRequestScopeRoleNotes
getMeGET /meAny tokenAnyWorks with any valid token. Returns the user, the token’s organisation and the token’s name, scopes and expiry.

Organisation

OperationRequestScopeRoleNotes
getOrgGET /orgs/{org_id}org:readviewer
renameOrgPATCH /orgs/{org_id}org:writeadminBody: name.

Members and invites

OperationRequestScopeRoleNotes
listMembersGET /orgs/{org_id}/membersmembers:readviewer
changeMemberRolePATCH /orgs/{org_id}/members/{user_id}members:writeadminBody: role. A token cannot make someone an owner or change an owner’s role.
removeMemberDELETE /orgs/{org_id}/members/{user_id}members:writeviewerAnyone may remove themselves; removing someone else needs admin. Also revokes that person’s tokens. Answers 204.
listInvitesGET /orgs/{org_id}/invitesmembers:readadminPending invites.
createInvitePOST /orgs/{org_id}/invitesmembers:writeadminBody: email, role. Idempotency-Key. The invite is emailed, and its link is in the answer once. A token cannot invite an owner. Answers 201.
resendInvitePOST /orgs/{org_id}/invites/{invite_id}/resendmembers:writeadminMakes 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.
revokeInviteDELETE /orgs/{org_id}/invites/{invite_id}members:writeadminAnswers 204.

Audit log

OperationRequestScopeRoleNotes
listAuditEventsGET /orgs/{org_id}/auditaudit:readadminPaginated, newest first. Events a token caused have via set.

Projects

OperationRequestScopeRoleNotes
listProjectsGET /orgs/{org_id}/projectsprojects:readviewer
createProjectPOST /orgs/{org_id}/projectsprojects:writeadminBody: name, allowedOrigins. Idempotency-Key. Also creates the first key, labelled Default. Answers 201.
getProjectGET /orgs/{org_id}/projects/{project_id}projects:readviewerIncludes the project’s keys.
updateProjectPATCH /orgs/{org_id}/projects/{project_id}projects:writeadminSend only what changes: name, allowedOrigins (replaces the whole list), reviewRequired, status (active or suspended), limits.

Allowed origins

OperationRequestScopeRoleNotes
listAllowedOriginsGET /orgs/{org_id}/projects/{project_id}/originsprojects:readviewer
addAllowedOriginPOST /orgs/{org_id}/projects/{project_id}/originsprojects:writeadminBody: origin. Adding one the project already has changes nothing.
removeAllowedOriginDELETE /orgs/{org_id}/projects/{project_id}/origins?origin=projects:writeadminThe origin is a query parameter. Removing one the project does not have changes nothing.

SDK keys

OperationRequestScopeRoleNotes
listProjectKeysGET /orgs/{org_id}/projects/{project_id}/keyskeys:readviewer
createProjectKeyPOST /orgs/{org_id}/projects/{project_id}/keyskeys:writeadminBody: label. Idempotency-Key. Answers 201.
revokeProjectKeyDELETE /orgs/{org_id}/projects/{project_id}/keys/{key_id}keys:writeadminCannot be undone.

Integrations

OperationRequestScopeRoleNotes
listIntegrationsGET /orgs/{org_id}/projects/{project_id}/integrationsintegrations:readviewerThe project’s integrations and the connection methods on offer. Secrets are never returned.
listIntegrationOptionsGET /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}/optionsintegrations:readadminLive from the provider: Linear teams, labels and projects, or GitHub repositories and labels.
startIntegrationOAuthPOST /orgs/{org_id}/projects/{project_id}/integrations/{provider}/oauthintegrations:writeadminprovider is linear or github. Returns a URL that a person opens to approve; the dashboard finishes the flow.
connectLinearApiKeyPOST /orgs/{org_id}/projects/{project_id}/integrations/linear/api-keyintegrations:writeadminBody: apiKey. Idempotency-Key. Choose the team afterwards with updateIntegration. Answers 201.
connectGithubTokenPOST /orgs/{org_id}/projects/{project_id}/integrations/github/patintegrations:writeadminBody: token. Idempotency-Key. Choose the repository afterwards with updateIntegration. Answers 201.
createWebhookPOST /orgs/{org_id}/projects/{project_id}/integrations/webhookintegrations:writeadminBody: url, events. Idempotency-Key. The signing secret is in the answer once. Answers 201.
updateIntegrationPATCH /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}integrations:writeadminSend 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).
testIntegrationPOST /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}/testintegrations:writeadminA webhook gets a signed ping; Linear and GitHub are checked with the stored credentials. A failure is in the answer, not an HTTP error.
rotateWebhookSecretPOST /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}/rotate-secretintegrations:writeadminThe new secret is in the answer once. The old one keeps signing for 24 hours.
removeIntegrationDELETE /orgs/{org_id}/projects/{project_id}/integrations/{destination_id}integrations:writeadminDeletes the stored credentials and cancels pending deliveries. Answers 204.

Deliveries

OperationRequestScopeRoleNotes
listDeliveriesGET /orgs/{org_id}/projects/{project_id}/integrations/deliveriesintegrations:readviewerPaginated, newest first. Filters: status, destination, session.
retryDeliveryPOST /orgs/{org_id}/projects/{project_id}/integrations/deliveries/{delivery_id}/retryintegrations:writeadminOnly for a dead or pending delivery; any other is not_found.

Sessions

OperationRequestScopeRoleNotes
listSessionsGET /orgs/{org_id}/sessionssessions:readviewerPaginated, newest first. Filters: project, status (active, ended or abandoned).
getSessionGET /orgs/{org_id}/sessions/{session_id}sessions:readviewerAdds mediaChunks and replaySegments, the amount of video and replay stored.
getSessionEventsGET /orgs/{org_id}/sessions/{session_id}/eventssessions:readviewerThe page replay events (rrweb). Large; meant for a player.
getSessionMediaGET /orgs/{org_id}/sessions/{session_id}/mediasessions:readviewerThe screen recording as one video stream. Supports byte ranges.
retrySessionTicketsPOST /orgs/{org_id}/sessions/{session_id}/ticket/retryintegrations:writeadminQueues 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.

OperationRequestNotes
createOrgPOST /orgsCreates an organisation; the caller becomes its first owner.
listApiTokensGET /orgs/{org_id}/tokensLists the organisation’s tokens, and the scopes a new one can have.
createApiTokenPOST /orgs/{org_id}/tokensBody: name, scopes, expiresInDays (1 to 365, default 30). The token is in the answer once. Answers 201.
revokeApiTokenDELETE /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.