# Partner API

For software that serves restaurants, shops, hotels or events and offers Pulse to the businesses that use it. A partner owns many Pulse accounts (one per location), pays for their pulses from one shared pool, sets the theme their feedback pages start from, and gets feedback through webhooks and a read API.

Base URL: `https://www.pulseapp.click/api/partner/v1`

## Getting access

Email support@pulseapp.click. We set up your partner account, its theme and badge, and your first pulses, and send you an API key. Pulses are invoiced to you, not to your customers.

## Requests

- Send `Authorization: Bearer pk_live_…` with every request.
- Bodies are JSON. Field names are `snake_case`.
- Errors look like `{ "error": { "code": "email_in_use", "message": "…" } }`. Status codes: `401` bad key, `404` not yours or not there, `409` conflict, `422` invalid input, `429` rate limited (see `retry-after`).
- Limits: 600 requests a minute per partner, and 60 a minute on `GET /feedback`.
- Your own IDs (`external_id`, the spot ID) are 1–100 letters, digits, `.`, `:`, `_` or `-`.

## The partner

| Method | Path | What |
| --- | --- | --- |
| `GET` | `/me` | Your settings, theme, badge and pool. |
| `PATCH` | `/me` | Change `contact_email`, `low_balance_at`, `default_question`, `default_accent`, `default_thank_you_message`, `default_summary_language`, `badge_label`, `badge_url`, `privacy_url`. `null` clears a field. |
| `GET` | `/balance` | `pulses_remaining`, `low_balance_at`, and every credit. |
| `GET` | `/usage?month=2026-12` | Pulses each account drew from your pool that month (UTC). Deleting notes or accounts never lowers it. |

**Theme.** Your defaults apply to every account that hasn't set its own value. Accents: `black`, `red`, `orange`, `green`, `blue`, `purple`.

**Badge.** The footer on feedback pages. `pulse` shows "Powered by Pulse". `cobrand` shows your `badge_label` (linked to `badge_url`) next to it. `none` shows only a link to your `privacy_url`. The mode is part of the deal, so Pulse sets it; you set the label and links.

## Accounts

| Method | Path | What |
| --- | --- | --- |
| `PUT` | `/accounts/{external_id}` | Create (`201`) or update (`200`). |
| `GET` | `/accounts?limit=&cursor=` | Oldest first. Follow `next_cursor`. |
| `GET` | `/accounts/{external_id}` | One account. |
| `DELETE` | `/accounts/{external_id}` | Deletes the account, its feedback and recordings. Can't be undone. |
| `PUT` | `/accounts/{external_id}/logo` | Multipart field `logo`: PNG, JPEG or WebP, up to 1 MB. |
| `DELETE` | `/accounts/{external_id}/logo` | Remove the logo. |

```json
PUT /accounts/loc_123
{
  "name": "Café Linde",
  "email": "owner@example.com",
  "summary_language": "de",
  "email_alerts": true,
  "branding": {
    "question": "Wie war es?",
    "accent": "green",
    "thank_you_message": "Danke!",
    "google_review_url": "https://g.page/r/…"
  }
}
```

- A new account needs `name` and `email`. The email is the owner's login to the Pulse dashboard, so it can't be changed through the API (`409 email_cannot_change`).
- An email that already has a Pulse account gives `409 email_in_use`. Ask Pulse to link it.
- `email_alerts: false` stops the owner's email for each new note.
- A `branding` field set to `null` falls back to your default.
- `summary_language` defaults to your `default_summary_language`, then English.

The response includes `code` and `feedback_url` (`/f/<code>`).

## Spots

A spot is anything with its own QR code: a table, a counter, a branch.

| Method | Path | What |
| --- | --- | --- |
| `PUT` | `/accounts/{external_id}/spots/{spot_id}` | `{ "name": "Table 6" }`. Create (`201`), rename (`200`), or bring back an archived one. |
| `GET` | `/accounts/{external_id}/spots` | Active spots. |
| `DELETE` | `/accounts/{external_id}/spots/{spot_id}` | Archive. Old notes keep their label. |

Each spot has a `feedback_url` like `/f/cafe-linde?spot=table-6`. Link to it or print it as a QR code. The slug never changes on rename, so printed codes keep working. An account can have up to 500 spots.

## Feedback

| Method | Path | What |
| --- | --- | --- |
| `GET` | `/feedback?account=&since=&limit=&cursor=` | Oldest first, up to 100 a page. |
| `GET` | `/feedback/{id}` | One note. |
| `GET` | `/feedback/{id}/audio` | `{ url, expires_in }`: a signed link to the recording, valid an hour. |

To sync, follow `next_cursor` until it is `null`, and keep the last cursor for next time.

```json
{
  "id": "2b0e…",
  "account": { "id": "…", "external_id": "loc_123" },
  "spot": { "id": "…", "external_id": "tbl_6", "name": "Table 6", "slug": "table-6" },
  "created_at": "2026-12-04T19:02:11.123Z",
  "status": "ready",
  "source": "voice",
  "channel": "qr",
  "duration": 34,
  "has_audio": true,
  "customer_name": null,
  "sentiment": "negative",
  "language": "Turkish",
  "transcript": "…",
  "translation": "…",
  "translation_language": "de",
  "summary": "…",
  "themes": ["wait time"],
  "context": null
}
```

`context` is whatever the page that embedded the widget passed in, as given. It can include that site's own user ID or email.

`status` is `processing`, `ready` or `failed` (nothing usable was said). A guest's reply address is never included.

## Webhooks

| Method | Path | What |
| --- | --- | --- |
| `POST` | `/webhooks` | `{ url, events?, description? }`. Returns the `secret` once. Up to 10 endpoints. |
| `GET` | `/webhooks` | Your endpoints. |
| `PATCH` | `/webhooks/{id}` | Change `url`, `events`, `description`, or `enabled`. |
| `DELETE` | `/webhooks/{id}` | Remove it and its log. |
| `POST` | `/webhooks/{id}/rotate-secret` | A new secret, shown once. The old one stops at once. |
| `POST` | `/webhooks/{id}/ping` | Send a `ping` now and return the delivery. |
| `GET` | `/webhook-deliveries?endpoint=&status=&cursor=` | The log, newest first. |
| `POST` | `/webhook-deliveries/{id}/retry` | Send again, with a fresh set of retries. |

**Events.** An endpoint with no `events` gets all of them.

| Event | When | `data` |
| --- | --- | --- |
| `feedback.created` | A note has been transcribed and analysed. | `{ feedback }` |
| `feedback.updated` | A note that failed was analysed again. | `{ feedback }` |
| `feedback.deleted` | The owner deleted a note. Delete your copy. | `{ feedback: { id, account } }` |
| `account.deleted` | An account was deleted. | `{ account: { id, external_id } }` |
| `pulses.low` | The pool reached `low_balance_at`, or 0. | `{ pulses_remaining, low_balance_at }` |
| `ping` | You asked for a test. | `{ message }` |

Treat `feedback.created` and `feedback.updated` as upserts on `data.feedback.id`.

**Payload.**

```json
{ "id": "evt_…", "type": "feedback.created", "created_at": "…", "data": { … } }
```

**Signing.** Deliveries follow [Standard Webhooks](https://www.standardwebhooks.com): headers `webhook-id`, `webhook-timestamp` and `webhook-signature` (`v1,<base64 HMAC-SHA256 of "id.timestamp.body">`, keyed with the base64 part of your `whsec_` secret). Any Standard Webhooks library verifies them. Reject timestamps older than 5 minutes, and dedupe on `webhook-id`, which stays the same across retries.

**Delivery.**

- Answer with any `2xx` within 10 seconds. Redirects are not followed.
- Failures are retried after at least 1 min, 5 min, 30 min, 2 h, 6 h, 12 h and 24 h, then marked `failed`. A retry goes out when it is due and Pulse next sends you an event or you call the API, and at least once a day.
- Treat `feedback.updated` as an upsert: if analysis was interrupted, a note can arrive as `updated` without a `created` first.
- Order isn't guaranteed.
- The endpoint must be public. Pulse looks up its address before every send and won't send to a private network.
- `410 Gone` turns the endpoint off. So does 3 days of nothing but failures. Turn it back on with `PATCH { "enabled": true }`.
- The log keeps 30 days. Entries for a deleted note or account are removed with it.

## Billing

Your accounts draw from your pool. An account's own pulses, if it bought any before joining you, go first. When the pool is empty, feedback pages stop taking notes, so watch `pulses.low`. Your contact gets an email at the same moment. To add pulses, write to support@pulseapp.click and we invoice you. Your accounts can't buy pulses themselves; their dashboard says their pulses come with you.
