---
title: "Send bug reports from your own app via REST API — bugd.one"
description: "Your own report form, bugd.one as the backend: send reports via POST, store the reporter token, fetch status and replies, badge counts via status batch."
url: https://bugd.one/guides/bug-reports-rest-api?lang=en
language: en
updated: 2026-11-22
type: guide
author: Eduard Ditler
alternate_de: https://bugd.one/guides/bug-reports-rest-api
alternate_en: https://bugd.one/guides/bug-reports-rest-api?lang=en
---
Guide · Last updated: 2026-11-22

# Send bug reports from your own app via REST API

Your own report form, bugd.one as the backend: send reports via POST, store the reporter token, fetch status and replies, badge counts via status batch.

Language: [Deutsch](https://bugd.one/guides/bug-reports-rest-api)

> **In short**
>
> - `POST https://bugd.one/api/v1/reports` with the header `X-API-Key: bk_live_…` and `{ "title": "…" }` creates a report. The response is `201` with `id`, `bug_number`, `status_url` and **`reporter_token`**.
> - The `reporter_token` is delivered only once — store it. With it the reporter reads and answers exactly this report (`GET /v1/reports/{id}`, `POST /v1/reports/{id}/messages`).
> - For a “news about your reports” badge, query up to 50 reports at once with `POST /v1/reports/status`.
> - Contract: [`docs/API.md`](https://bugd.one/api-reference.md) and [`/openapi.json`](https://bugd.one/openapi.json); the endpoints stay backward compatible.

The widget is convenient, but it does not fit every app: in a native app, a game or a site with its own design you want your own form. Then bugd.one is just the backend: you collect the data yourself, send it over HTTP and later show the user status and replies in your own interface.

## Prerequisites

- A bugd.one project and its **publishable key** (`bk_live_…`) under **Project → Settings**. It may live in web, Android and iOS apps.
- Optionally for server-side calls: the **server key** (`bk_server_…`). It is shown only once; if you lose it, you rotate it.
- The base URL is `https://bugd.one/api`. Errors always come as JSON `{ "error": "…", "code": "…" }`.

![Project settings with API key and allowed domains](https://bugd.one/screenshots/docs-api-key.webp)
*Project → Settings: this is where you find the API key (bk_live_…) and set the allowed domains.*

## Step by step

### Step 1: Send a report

The simplest call needs only a title:

```bash
curl -X POST https://bugd.one/api/v1/reports \
  -H "X-API-Key: bk_live_YOUR_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Login button does not respond",
    "description": "Nothing happens after tapping.",
    "app_version": "2.4.1",
    "source": "android",
    "metadata": { "device": "Pixel 8", "os": "Android 15" },
    "labels": ["login"]
  }'
```

The response:

```json
{
  "success": true,
  "id": "1f0c…",
  "bug_number": 42,
  "status": "new",
  "reporter_token": "x7Kq…",
  "status_url": "https://bugd.one/status/1f0c…"
}
```

The most important fields: `title` (required, max. 500 characters), `description` (max. 9,500), `app_version`, `source` (`web`, `android`, `ios` …), `environment` (default `production`), `url` (trimmed to origin and path), `metadata` (flat object, up to 30 keys), `labels` (up to 10). Your own custom fields from the dashboard go into `metadata[key]`; `GET /v1/config` tells you which ones exist.

If you send `user.email` or `user.name`, you also need `"consent": true` — the reporter must have agreed to storage, otherwise the API answers `422 consent_required`. With the email address the reporter receives emails on status changes. Put your own user ID in `user.id` (max. 200 characters); do not store an email address there.

### Step 2: Attach screenshots

Send small images as a data URI in `screenshot_url` (PNG, JPEG, GIF or WebP, max. 5 MB) and up to three more in `attachments`. For native apps `multipart/form-data` is more efficient because the Base64 overhead disappears:

```bash
curl -X POST https://bugd.one/api/v1/reports \
  -H "X-API-Key: bk_live_YOUR_PROJECT_KEY" \
  -F "title=Crash when saving" \
  -F "app_version=3.0.0" -F "source=ios" \
  -F "metadata={\"device\":\"iPhone 16\",\"os\":\"iOS 26\"}" \
  -F "screenshot=@screenshot.png;type=image/png"
```

### Step 3: Store the reporter token

The `reporter_token` is the reporter's key to exactly this report. It comes in this one response only. Store it with the `id` somewhere only your app reads: Keychain (iOS), `EncryptedSharedPreferences` (Android), `localStorage` (web). In TypeScript:

```ts
const API = 'https://bugd.one/api/v1'
const KEY = 'bk_live_YOUR_PROJECT_KEY'

export async function sendReport(title: string, description: string) {
  const res = await fetch(`${API}/reports`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', 'X-API-Key': KEY },
    body: JSON.stringify({ title, description, source: 'web', app_version: '2.4.1' }),
  })
  if (!res.ok) throw new Error((await res.json()).error ?? `HTTP ${res.status}`)
  const { id, bug_number, reporter_token } = await res.json()

  const list = JSON.parse(localStorage.getItem('myReports') ?? '[]')
  list.unshift({ id, bug_number, title, token: reporter_token })
  localStorage.setItem('myReports', JSON.stringify(list.slice(0, 50)))
  return bug_number as number
}
```

### Step 4: Show status and replies

With the token the app reads the current state — without an API key:

```ts
export async function loadReport(id: string, token: string) {
  const res = await fetch(`${API}/reports/${id}`, { headers: { 'X-Reporter-Token': token } })
  if (res.status === 404) return null          // deleted or token invalid
  return (await res.json()) as {
    report: { id: string; bug_number: number; title: string; status: string; fixed_in_version: string | null }
    messages: Array<{ id: string; content: string; from_reporter: boolean; created_at: string }>
  }
}
```

`status` runs through `new`, `confirmed`, `in_progress` and ends in `fixed`, `wont_fix` or `duplicate`. Only replies you marked in the dashboard as **reply to the reporter** are visible; internal comments stay internal.

### Step 5: Reply as the reporter

```ts
await fetch(`${API}/reports/${id}/messages`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'X-Reporter-Token': token },
  body: JSON.stringify({ content: 'Pixel 8 with Android 15' }),
})
```

The message (max. 5,000 characters) goes to the watchers of the report on your team. The endpoint expects `Content-Type: application/json`, otherwise it answers `415`.

### Step 6: A badge for new replies via status batch

To show “2 new replies” in your app, query all locally stored reports with a single call (up to 50, no API key, 30 requests per minute and IP):

```ts
const res = await fetch(`${API}/reports/status`, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ reports: list.map((r) => ({ id: r.id, token: r.token })) }),
})
const { reports } = await res.json()
// [{ id, status, updated_at, reply_count, last_reply_at } | { id, gone: true }]
```

Remember per report the last seen `status` and `reply_count`; the differences make up the number in the badge. `gone: true` means the report was deleted or the token is invalid — remove it locally.

### Step 7: Server-side: “My reports” without tokens

If your user is logged in, you can skip the tokens. Send `user.id` when reporting and query from your backend with the **server key**:

```bash
curl "https://bugd.one/api/v1/reports?external_user_id=usr_123&status=new&limit=50" \
  -H "Authorization: Bearer $BUGD_SERVER_KEY"
```

The response contains `reports` and a `next_cursor` for the next page. With `POST /v1/reports/{id}/messages` and the same server key you answer publicly as support (`{ "content": "…", "author": "Support-Bot" }`). The server key must never end up in an app or in the frontend.

### Step 8: Environment and test

Send `environment: "development"` (or `staging`) from debug builds. Such reports appear in the dashboard with a DEV marker but send no emails, webhooks or chat messages. First check with a test report that it shows up under **Reports**.

![Bug detail view with description, console output, metadata and screenshot](https://bugd.one/screenshots/bug-detail.webp)
*Bug detail: screenshot, page, browser and console errors arrive automatically. Change the status and the reporter is notified.*

## What gets stored

| Field | Content |
| --- | --- |
| Content | title, description, labels, custom fields from `metadata` |
| Context | `app_version`, `source`, `environment`, page (origin and path only) |
| Attachments | screenshot and up to 3 more files |
| Reporter | optionally name and email (with `consent`), your own user ID |
| Console | `console_logs` (max. 5,000 characters), appended to the description |

The field `replay` is silently ignored for older widget versions — session replay no longer exists.

## Limits and notes

> **Good to know**
>
> - **The publishable key is not a secret.** Allowed origins and Turnstile only protect browser calls; outside browsers, rate limits and quotas apply. Never hand out the server key.
> - **Browsers with Turnstile:** If Turnstile is active in the project, browser reports with an `Origin` header need a `cf_turnstile_token` (see `GET /v1/config`). Native apps without `Origin` are exempt.
> - **Body sizes:** JSON up to 25 MB, multipart up to 20 MB, single images up to 5 MB.
> - **No active plan:** after the 7-day trial ends without a booked plan you get `403 project_read_only`.

For crashes there is a separate endpoint, `POST /v1/crashes`, with the same keys — details in the guides for [Android](https://bugd.one/guides/android-crash-reporting-without-crashlytics?lang=en) and [Flutter](https://bugd.one/guides/flutter-crash-reporting?lang=en).

## Further reading

- [API reference (Markdown)](https://bugd.one/api-reference.md) and [OpenAPI specification](https://bugd.one/openapi.json)
- [Add a bug report button to your website](https://bugd.one/guides/bug-report-button-website?lang=en): the ready-made solution without your own code
- [Mobile integration](https://bugd.one/docs#mobile): the `/embed` form in a WebView

## Frequently asked questions

**Do I need an SDK to send reports?**
No. The whole public API is plain HTTP with JSON (or multipart for screenshots). The widget, the crash reporter and the mobile SDKs use exactly the same endpoints. The machine-readable specification is at `/openapi.json`, the detailed description at `/api-reference.md`.

**Which key may I ship in my app?**
Only the publishable key (`bk_live_…`). It may send reports and crashes and read the configuration. The server key (`bk_server_…`) reads all reports of the project and belongs in your backend or CI only.

**How does a user see the status of their report later?**
The response to `POST /v1/reports` contains a `reporter_token`. Store it together with the `id` locally (Keychain, SharedPreferences, `localStorage`). With `GET /v1/reports/{id}` and the header `X-Reporter-Token` the app reads status and public replies.

**Can I check several reports for changes at once?**
Yes. `POST /v1/reports/status` takes up to 50 pairs of `id` and `token` and returns status, number of team replies and time of the last reply per report — ideal for a badge. The endpoint needs no API key.

**Which limits apply?**
At most 20 reports per minute per IP; exceeding it returns `429 rate_limited`. There is no report quota. If the project owner has no active plan (trial ended), you get `403 project_read_only`.

## Related guides

- [Add a bug report button to your website](https://bugd.one/guides/bug-report-button-website?lang=en) — Embed a feedback widget with screenshots, annotation and “My reports” via one script tag — options, environments, privacy link and self-hosting via ZIP.
- [Android crash reporting without Crashlytics](https://bugd.one/guides/android-crash-reporting-without-crashlytics?lang=en) — Capture Kotlin/JVM crashes in Android apps without Firebase: Bugdone.configure, enableCrashCapture, environments and limits (no NDK, no ANR).
- [Flutter crash reporting without Firebase](https://bugd.one/guides/flutter-crash-reporting?lang=en) — Capture, group and get notified about Dart and Flutter errors automatically — with the bugd.one Flutter SDK, EU-hosted, no Firebase project needed.

## Up and running in two minutes

Create an account, add a project, paste your key — all Pro features free for 7 days, no credit card required.

[Try free for 7 days](https://bugd.one/login) · [Read the docs](https://bugd.one/docs) · [All guides](https://bugd.one/guides?lang=en)

---

bugd.one — https://bugd.one/guides/bug-reports-rest-api?lang=en · Overview for AI agents: [llms.txt](https://bugd.one/llms.txt) · API: [openapi.json](https://bugd.one/openapi.json)
