# Create tickets from your own app

> The new Tickets API lets your product open, update and close Brightdesk tickets, with the customer's account attached.

- URL: https://tanstack-start-example.notra.site/blog/tickets-api
- Published: 2026-09-02
- Authors: Kofi Mensah
- Tags: product, engineering

The best bug reports come from inside your product, where you already know who the user is, which plan they’re on and what page they were looking at. The Tickets API sends all of that to Brightdesk.

## Open a ticket

Create an API key under **Settings → API**, then send a `POST` with the customer’s email and the message:

**curl**

```bash
curl https://api.brightdesk.app/v1/tickets \
  -H "Authorization: Bearer $BRIGHTDESK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "sam@northwind.io",
    "subject": "Export stuck at 80%",
    "body": "The CSV export never finishes.",
    "metadata": { "plan": "pro", "page": "/reports/export" }
  }'
```

**TypeScript**

```typescript
const response = await fetch("https://api.brightdesk.app/v1/tickets", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGHTDESK_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    email: "sam@northwind.io",
    subject: "Export stuck at 80%",
    body: "The CSV export never finishes.",
    metadata: { plan: "pro", page: "/reports/export" },
  }),
});
const ticket = await response.json();
```

The response holds the ticket `id` and a `url` you can show the user, so they can follow the conversation without logging in.

## Metadata shows up next to the ticket

Anything in `metadata` appears in the sidebar of the ticket, and you can filter views by it. Send `plan` and Brightdesk uses it for [SLA targets](https://tanstack-start-example.notra.site/blog/sla-timers-that-pause).

## Limits

- 120 requests per minute per key
- Up to 20 keys in `metadata`, each value up to 500 characters
- Attachments up to 25 MB, sent as `multipart/form-data`

> **Tip**
>
> Use a separate key for each environment. Tickets created with a key marked **Test** never reach your team’s queue.
