---
name: brigly-api
description: Build integrations, websites, booking flows, live menus, supplier storefronts, and webhook workers with Brigly's Restaurant and Supplier APIs.
---

# Brigly Developer Skill

Use this guide whenever building websites, scripts, sync jobs, or backend integrations against the Brigly v1 HTTP API.

Base URL: `https://impartial-toad-141.convex.site`
Interactive docs: `https://brigly.app/docs.html`
OpenAPI 3.1 JSON: `https://impartial-toad-141.convex.site/v1/openapi.json`

## 1. Choose the right API surface

Brigly serves two distinct workspaces on the same base URL:

1. **Restaurant API (`/v1/...`)**
   - Public token query param: `?r=<restaurantId>`
   - Server API key prefix: `brigly_live_<32 hex>` (18 scopes, free on Free, Team, and Pro plans)
   - Use for: live menus, 86 sync, table reservations, waitlist, events, catering, memberships, jobs, guest feedback, floor plans, stock, schedules, briefings.

2. **Supplier API (`/v1/vendor/...`)**
   - Public token query param: `?vendor=<vendorId>`
   - Server API key prefix: `brigly_vendor_<32 hex>` (11 scopes, free on Brigly Vendor)
   - Use for: supplier product catalogs, wholesale ordering workflows, pick lists, delivery routes, connected restaurant terms, tracked invoices, batch recalls, supplier job boards.

## 2. Respect security and privacy rules

- Never place a `brigly_live_` or `brigly_vendor_` key in browser code, mobile app bundles, or public git repositories.
- Browser pages must use only `?r=<restaurantId>` or `?vendor=<vendorId>` for public endpoints or drop-in embeds.
- **Guest manage keys:** Guest POST endpoints (`POST /v1/reservations`, `POST /v1/events/{id}/reservations`, `POST /v1/catering/requests`, `POST /v1/memberships/requests`, `POST /v1/applications`) return `manageKey` once at creation. Persist it server-side or show the guest manage link; pass it as `?key=` or header `X-Brigly-Manage-Key`.
- **Supplier wholesale privacy:** New supplier accounts default to `publicCatalog: false`, `publicPrices: false`, and `publicContact: false`. Unauthenticated calls to `GET /v1/vendor/catalog?vendor=...` return `403` with `code: "catalog_private"` unless the supplier enables public catalog access in Settings > Developer & API. Even when a catalog is public, prices are omitted unless `publicPrices` is also enabled. Wholesale per-day availability (`today`) and `priceHistory` are only returned with a bearer API key.
- **Tracked supplier invoices:** Supplier invoices are records synchronized with restaurants; Brigly never processes payments between restaurants and suppliers via the API.

## 3. Protocol conventions and reliability

Always rely on these standard Brigly v1 behaviors when generating client code:

### Structured errors & request tracing
Every response sets `X-Request-Id: req_...`. Error responses always include:
```json
{
  "error": "A plain sentence explaining what to fix.",
  "code": "validation_error",
  "requestId": "req_a1b2c3d4e5f6"
}
```
Common `code` values: `invalid_key`, `revoked_key`, `api_disabled`, `insufficient_scope`, `rate_limited`, `idempotency_conflict`, `catalog_private`, `news_private`, `not_found`, `conflict`, `validation_error`.

### Rate limits & conditional caching
- Check headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (Unix epoch seconds). On `429`, wait `Retry-After` seconds.
- Pass `If-None-Match` with the previous response's `ETag` header on read endpoints (`/v1/menu`, `/v1/restaurant`, `/v1/floor-plan`, `/v1/vendor`, `/v1/vendor/catalog`, etc.) to receive `304 Not Modified`.

### Idempotent POST writes
For any critical `POST` create operation (bookings, catalog items, guest feedback, orders), send `Idempotency-Key: <unique-id>` (1 to 128 characters).
- Repeating the same `Idempotency-Key` and identical JSON body within 24 hours returns the cached response with header `Idempotency-Replayed: true`.
- Reusing an `Idempotency-Key` with a different payload returns `409 Conflict` (`code: "idempotency_conflict"`).
- Webhook creation endpoints (`POST /v1/webhooks`, `POST /v1/vendor/webhooks`) do not cache responses because signing secrets are returned once.

### Pagination & menu filtering
- List endpoints accept `limit` and `cursor` and return `nextCursor`, `hasMore`, and `total` (or collection-specific keys alongside pagination metadata).
- `GET /v1/menu` and `GET /v1/menu/items` support `q` (text search), `tag`, `dietary`, `exclude_allergens` (comma-separated allergen names or codes like `Peanuts,M`), `category`, and `include_86=false`.

## 4. Drop-in embeds (zero build step)

Instead of writing custom UI from scratch, you can embed Brigly's lightweight script tags directly on static HTML, WordPress, Webflow, or Shopify sites:

- **Restaurant embed:**
  ```html
  <div id="brigly-booking" data-restaurant="RESTAURANT_ID" data-theme="light"></div>
  <!-- Also available: #brigly-menu, #brigly-specials, #brigly-jobs -->
  <script src="https://brigly.app/assets/js/brigly-embed.js" defer></script>
  ```

- **Supplier embed:**
  ```html
  <div id="brigly-vendor-catalog" data-vendor="VENDOR_ID" data-theme="light"></div>
  <!-- Also available: #brigly-vendor-profile, #brigly-vendor-news, #brigly-vendor-jobs -->
  <script src="https://brigly.app/assets/js/brigly-vendor-embed.js" defer></script>
  ```

## 5. Verifying signed webhooks

Every webhook delivery uses HMAC-SHA256 over the raw UTF-8 request body using your endpoint secret (`whsec_...`), sent in `X-Brigly-Signature: sha256=<hex>`.
Read `references/webhooks.md` for signature verification code and event names, and `references/endpoints.md` for every HTTP route and required scope.
