REST API
The REST API does from outside what the dashboard does inside: read issues, events, logs, traces, metrics and releases, triage issues, and manage alert rules and collector settings.
Base URL
The API lives on your organisation's own host:
https://<organisation>.bugtail.eu/api/v1
If your team reaches the dashboard on a hostname of your own, the API answers there too.
Authentication
Create a token under Settings > API tokens. Give it a name that says what it is for, an ability, and optionally an expiry in days. The token is shown once; only a hash of it is stored.
| Ability | Allows |
|---|---|
| Read only | Every GET request. |
| Read and write | Everything, including resolving issues and changing alert rules. |
Send the token as a bearer token:
curl "https://<organisation>.bugtail.eu/api/v1/issues?level=error" \
-H "Authorization: Bearer <token>"
A token only works for the organisation that issued it. API tokens read data; collector keys send it. Neither can do the other's job.
Reference
The full reference is an OpenAPI document, served without authentication. Point a client generator or an API tool at it:
https://<organisation>.bugtail.eu/api/v1/openapi.json
What you can do
| Resource | Endpoints |
|---|---|
| Projects | List and fetch. |
| Collectors | List, fetch, and change settings. |
| Issues | List with filters, fetch, triage (status, assignee, mute until), list events, counts over time. |
| Events | Fetch one event, and its stored payload. |
| Logs | Search by text, level, collector and time. |
| Performance | Operations with their latency, span shapes, latency over time, and one trace with its span tree. |
| Metrics | List, fetch with their series, and values over time. |
| Releases | Release health per release. |
| Alert rules | List, fetch, create, change and delete. |
Examples
Open errors in one project, most recent first:
curl "https://<organisation>.bugtail.eu/api/v1/issues?project_id=1&status=open&level=error" \
-H "Authorization: Bearer <token>"
Resolve an issue:
curl -X PATCH https://<organisation>.bugtail.eu/api/v1/issues/42 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"status":"resolved"}'
Pagination and errors
Lists are paginated with page and per_page, up to 100 per page. The response has the items under data and the paging details under links and meta.
Every failure has the same shape:
{ "error": { "code": "not_found", "message": "No issue with that id." } }