Skip to main content

API Overview

BugPin exposes a REST API for both the embeddable widget and programmatic admin access. The Widget API is public and uses API key authentication for submitting bug reports and fetching widget configuration. The Admin API requires session authentication and covers reports, projects, users, settings, and integrations. This page provides an overview of all endpoints, authentication methods, rate limiting, response formats, and CORS behavior.

Base URL​

All API endpoints are relative to your BugPin server URL:

https://your-bugpin-server.com/api

API Categories​

Widget API (Public)​

The widget API is used by the embeddable widget and does not require session authentication. It uses API keys for project identification.

EndpointMethodDescription
/api/widget/submitPOSTSubmit a bug report
/api/widget/config/:apiKeyGETGet widget configuration

See Widget API Reference for details.

Admin API (Authenticated)​

The admin API requires session authentication and is used by the admin dashboard.

EndpointDescription
/api/authAuthentication (login, logout, session)
/api/reportsBug report management
/api/projectsProject management
/api/usersUser management
/api/settingsApplication settings
/api/integrationsThird-party integrations (GitHub)
/api/webhooksOutgoing webhooks (Enterprise Edition)

Webhooks (Enterprise Edition)​

Webhooks send report events to your own endpoint. When a webhook has a signing secret, each delivery carries an X-BugPin-Signature header with an HMAC-SHA256 signature of the body in the form sha256=<hex>, next to X-BugPin-Event and X-BugPin-Delivery.

The signing secret is write-only. Webhook responses never include it; they return secretSet (true or false) instead. When updating a webhook with PATCH /api/webhooks/:id, leave out secret to keep the saved secret, send a new value to replace it, or send "" to remove it. The webhook editor in the Admin Console works the same way and has a Remove secret link.

Authentication​

Widget API​

Widget endpoints use API keys for authentication. Send the key in the X-Api-Key header; the apiKey query parameter is rejected with 400 DEPRECATED:

POST /api/widget/submit
X-Api-Key: bp_proj_abc123

Admin API​

Admin endpoints require session-based authentication:

  1. Call /api/auth/login with credentials
  2. Include the session cookie in subsequent requests

The Admin API is same-origin only. Browser requests from other origins are refused, while server-side clients such as curl work normally.

If the account still has to replace its initial password, every endpoint except /api/auth/change-password and /api/auth/logout returns 403 with the error PASSWORD_CHANGE_REQUIRED. API tokens of such a user (Enterprise Edition) are refused on every endpoint with the same error until the password is changed.

If the two-factor policy requires the account to set up a second factor and it has none yet, every endpoint except sign-out, password change and the two-factor and passkey endpoints under /api/auth returns 403 with the error TWO_FACTOR_SETUP_REQUIRED until it does. This also applies to requests made with that user's API tokens (Enterprise Edition).

# Login
curl -X POST https://bugs.example.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your-password"}' \
-c cookies.txt

# Use session cookie
curl https://bugs.example.com/api/reports \
-b cookies.txt

Rate Limiting​

Widget submission endpoints are rate limited to prevent abuse:

  • Default: 10 submissions per minute per client address, counted separately for each project
  • Configurable under Security → General in the Admin Console

Rate limit headers are included in responses:

X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 42

X-RateLimit-Reset is the number of seconds until the window resets.

When rate limited, the API returns a 429 Too Many Requests response.

Sign-in endpoints have fixed limits per client address, counted separately for each endpoint, and IPv6 clients are counted by their /64 network. See Rate Limiting.

Response Format​

All API responses follow a consistent format:

Success Response​

{
"success": true,
"data": { ... }
}

Error Response​

{
"success": false,
"error": "ERROR_CODE",
"message": "Human-readable error message",
"details": [ ... ] // Optional validation errors
}

Error Codes​

CodeHTTP StatusDescription
UNAUTHORIZED401Missing or invalid authentication
FORBIDDEN403Origin not allowed or insufficient permissions
NOT_FOUND404Resource not found
VALIDATION_ERROR400Request validation failed
DEPRECATED400API key sent as a query parameter instead of the X-Api-Key header
PASSWORD_CHANGE_REQUIRED403The account must replace its initial password first
TWO_FACTOR_SETUP_REQUIRED403The two-factor policy requires the account to set up a second factor first
RATE_LIMIT_EXCEEDED429Too many requests
TOO_MANY_ATTEMPTS429Second-factor sign-in is locked for 15 minutes after 10 failed attempts
FILE_TOO_LARGE413An uploaded file exceeds its size limit
UNSUPPORTED_MEDIA_TYPE415The file type is not accepted
SCREEN_RECORDING_DISABLED403A recording was sent although screen recording is off for the project
VIDEO_QUOTA_EXCEEDED429The project reached its daily video upload limit
RECORDING_AUDIO_NOT_ALLOWED400The recording has audio although microphone recording is not allowed
RECORDING_TOO_LONG400The recording exceeds the maximum recording duration
INTERNAL_ERROR500Server error

Content Types​

JSON Requests​

curl -X POST https://bugs.example.com/api/widget/submit \
-H "Content-Type: application/json" \
-H "X-Api-Key: your-project-api-key" \
-d '{"title": "Bug report", ...}'

Multipart Form Data​

For requests with file uploads (screenshots):

curl -X POST https://bugs.example.com/api/widget/submit \
-H "X-Api-Key: your-project-api-key" \
-F "data={\"title\": \"Bug report\", ...}" \

CORS​

The widget API (/api/widget/*) supports Cross-Origin Resource Sharing (CORS) for browser-based requests from any origin, without cookies or credentials. All other endpoints are same-origin only.

Origin Restrictions​

Projects can configure allowed origins in the admin panel. When configured:

  • Only requests from allowed origins are accepted
  • Subdomains of allowed domains are automatically permitted
Allowed: example.com
Accepts: example.com, www.example.com, app.example.com

Health Check​

A health check endpoint is available for monitoring:

GET /health

Returns 200 OK when the server is healthy.

We use cookies for analytics to improve our website. More information in our Privacy Policy.