# Brigly API > Brigly runs restaurants (menus, 86s, bookings, floor plans, pre-orders, stock, schedules, feedback) and wholesale food suppliers (catalogs, purchase orders, pick lists, routes, tracked invoices, recalls). The REST API, webhooks, and drop-in website widgets are free on every plan with no per-call or per-cover fee. ## Key entry points - [Documentation](https://brigly.app/docs.html): Interactive API explorer, widget builder, and live samples - [AI Agent Skill (Markdown)](https://impartial-toad-141.convex.site/v1/skill.md): Complete instructions for building Brigly integrations - [AI Agent Skill (ZIP)](https://brigly.app/assets/docs/skill/brigly-api-skill.zip): Installable skill folder with SKILL.md and reference sheets - [OpenAPI 3.1 Spec](https://impartial-toad-141.convex.site/v1/openapi.json): Machine-readable schema for all restaurant and supplier routes - [Full Context (llms-full.txt)](https://brigly.app/llms-full.txt): Single-file documentation bundle for LLM context windows ## Restaurant API (/v1) - Public website reads with `?r=` (no secret in client code): restaurant profile, live menu with photos and allergen exclusions, 86 board, table availability, specials, happy hours, public events, catering offers, membership plans, open jobs, waitlist quotes, published 3D floor plan - Public guest actions with `?r=`: table reservations with pre-orders, waitlist/event reservations, catering requests, membership join requests, job applications, guest feedback (returns a one-time `manageKey` for guest self-service) - Server operations with `Authorization: Bearer brigly_live_<32 hex>`: dish 86 and portion-limit updates, full bookings list and status updates, waitlist management, catering/membership/event booking lists, stock items and purchase orders, schedules, approved briefings, feedback review, webhook CRUD and replay ## Supplier API (/v1/vendor) - Wholesale privacy defaults: `publicCatalog`, `publicPrices`, and `publicContact` default to `false`. Private catalogs return `403` (`catalog_private`) unless opted in under Settings > Developer & API or called with a bearer key - Public reads with `?vendor=`: supplier profile, announcements (when `publicNews` is true), product catalog (when `publicCatalog` is true; prices included only when `publicPrices` is true), open roles, and job applications - Server operations with `Authorization: Bearer brigly_vendor_<32 hex>`: catalog CRUD, today's availability counts, announcements, incoming orders and fulfillment transitions, pick lists, connected restaurants, standing orders, delivery routes, tracked invoices, batch recalls, and webhooks ## Protocol conventions - Errors return `{ "error": "...", "code": "...", "requestId": "req_..." }` - Every response includes `X-Request-Id`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` - Conditional GETs support `ETag` and `If-None-Match` (`304 Not Modified`) - `POST` writes support `Idempotency-Key` headers for safe retries (24-hour deduplication window) - Webhooks use HMAC-SHA256 signatures over the raw request body via `X-Brigly-Signature` --- # 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=` - 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=` - 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=` or `?vendor=` 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: ` (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
``` - **Supplier embed:** ```html
``` ## 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=`. Read `references/webhooks.md` for signature verification code and event names, and `references/endpoints.md` for every HTTP route and required scope. --- # Brigly API Endpoints Reference Base URL: `https://impartial-toad-141.convex.site` ## Discovery | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1` | Bearer key only | API root discovery index | | `GET` | `/v1/llms.txt` | Bearer key only | Concise LLM/agent API guide (text/plain) | | `GET` | `/v1/skill.md` | Bearer key only | Installable AI Agent Skill definition (text/markdown) | ## Restaurant | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/restaurant` | Public token or Bearer key | Public restaurant profile, address, hours, services and dining rules | ## Menu | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/menu` | Public token or Bearer key | The live menu with photos, 86 status, pairings, alternatives and allergen filtering | | `GET` | `/v1/menu/items` | Public token or Bearer key | The menu as one flat list with allergen/search filtering | | `GET` | `/v1/menu/items/{id}` | Public token or Bearer key | Single dish details with photo, allergens, pairings and live availability | | `PATCH` | `/v1/menu/items/{id}/limit` | Bearer key only | Set or clear remaining portions on a dish (menu:write bearer key) | | `GET` | `/v1/menu/86` | Public token or Bearer key | What is sold out right now | | `POST` | `/v1/menu/86` | Bearer key only | Mark a dish or ingredient 86’d (menu:write bearer key) | | `DELETE` | `/v1/menu/86/{id}` | Bearer key only | Restore an 86’d dish or ingredient back onto the menu (menu:write bearer key) | ## Reservations | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/reservations/availability` | Public token or Bearer key | Free time slots for a party | | `GET` | `/v1/reservations` | Bearer key only | List reservations across dates and statuses (reservations:read bearer key) | | `POST` | `/v1/reservations` | Public token or Bearer key | Book a table, optionally with the meal pre-ordered | | `GET` | `/v1/reservations/{id}` | Public token or Bearer key | Read a booking | | `PATCH` | `/v1/reservations/{id}` | Public token or Bearer key | Change a booking (time, party, note, pre-orders, or status with bearer key) | | `DELETE` | `/v1/reservations/{id}` | Public token or Bearer key | Cancel a booking | ## Waitlist | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/waitlist/quote` | Public token or Bearer key | Estimated walk-in wait time quote | | `GET` | `/v1/waitlist` | Bearer key only | List current waitlist parties (waitlist:read bearer key) | | `POST` | `/v1/waitlist` | Bearer key only | Add a party to the waitlist (waitlist:write bearer key) | | `DELETE` | `/v1/waitlist/{id}` | Bearer key only | Remove a party from the waitlist (waitlist:write bearer key) | ## Specials | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/specials` | Public token or Bearer key | Today’s specials, happy hours and events | | `GET` | `/v1/happy-hours` | Public token or Bearer key | Happy hours from a day on | | `GET` | `/v1/events` | Public token or Bearer key | Upcoming public events | | `GET` | `/v1/events/{id}/reservations` | Bearer key only | List bookings for a specific event (reservations:read bearer key) | | `POST` | `/v1/events/{id}/reservations` | Public token or Bearer key | Take places at an event | | `GET` | `/v1/events/reservations/{id}` | Public token or Bearer key | An event reservation | | `DELETE` | `/v1/events/reservations/{id}` | Public token or Bearer key | Cancel an event reservation | ## Requests | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/catering` | Public token or Bearer key | Catering and private dining the restaurant offers | | `GET` | `/v1/catering/requests` | Bearer key only | List catering and private-dining inquiries (reservations:read bearer key) | | `POST` | `/v1/catering/requests` | Public token or Bearer key | Send a catering or private dining request | | `GET` | `/v1/catering/requests/{id}` | Public token or Bearer key | Where a request stands | | `DELETE` | `/v1/catering/requests/{id}` | Public token or Bearer key | Withdraw a request | | `GET` | `/v1/memberships` | Public token or Bearer key | The membership plans the restaurant offers | | `GET` | `/v1/memberships/requests` | Bearer key only | List membership join requests (reservations:read bearer key) | | `POST` | `/v1/memberships/requests` | Public token or Bearer key | Ask to join a membership plan | | `GET` | `/v1/memberships/requests/{id}` | Public token or Bearer key | Where a membership request stands | | `DELETE` | `/v1/memberships/requests/{id}` | Public token or Bearer key | Withdraw a membership request | ## Operations | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/stock/items` | Bearer key only | List inventory items and par levels (stock:read bearer key) | | `GET` | `/v1/stock/orders` | Bearer key only | List supplier purchase orders (stock:read bearer key) | | `GET` | `/v1/schedule` | Bearer key only | Published staff shifts (schedule:read bearer key) | | `GET` | `/v1/briefings` | Bearer key only | Approved service briefings (schedule:read bearer key) | ## Feedback | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/feedback` | Bearer key only | List guest feedback (feedback:read bearer key) | | `POST` | `/v1/feedback` | Public token or Bearer key | Submit guest feedback (public token or feedback:write key) | ## Jobs | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/jobs` | Public token or Bearer key | Open roles for a restaurant or supplier team | | `GET` | `/v1/applications` | Bearer key only | Submitted job applications (bearer API key only) | | `POST` | `/v1/applications` | Public token or Bearer key | Apply for an open role | | `GET` | `/v1/applications/{id}` | Public token or Bearer key | Check an application’s status or inspect an application | | `DELETE` | `/v1/applications/{id}` | Public token or Bearer key | Withdraw an active application | ## Webhooks | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/webhooks` | Bearer key only | List webhooks | | `POST` | `/v1/webhooks` | Bearer key only | Register a webhook | | `PATCH` | `/v1/webhooks/{id}` | Bearer key only | Update a webhook URL, subscribed events, or active state | | `DELETE` | `/v1/webhooks/{id}` | Bearer key only | Remove a webhook | | `POST` | `/v1/webhooks/{id}/ping` | Bearer key only | Send a signed test ping delivery to a webhook | | `GET` | `/v1/webhooks/{id}/deliveries` | Bearer key only | List delivery attempts for a webhook | | `POST` | `/v1/webhooks/{id}/deliveries/{deliveryId}/replay` | Bearer key only | Replay a failed or stopped webhook delivery while retained | ## Floor plan | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/floor-plan` | Public token or Bearer key | Published restaurant geometry and table availability | | `PATCH` | `/v1/floor-plan` | Bearer key only | Change a restaurant layout through its shared reducer | ## Vendor | Method | Path | Access | Summary | |---|---|---|---| | `GET` | `/v1/vendor` | Public token or Bearer key | Supplier profile, delivery schedule, cutoff rules and privacy flags | | `GET` | `/v1/vendor/catalog` | Public token or Bearer key | Supplier product catalog (public opt-in or bearer key) | | `POST` | `/v1/vendor/catalog` | Bearer key only | Create a catalog product (vendor.catalog:write bearer key) | | `PUT` | `/v1/vendor/catalog/availability` | Bearer key only | Set daily stock counts for today or tomorrow (vendor.catalog:write bearer key) | | `GET` | `/v1/vendor/catalog/{id}` | Public token or Bearer key | Single supplier catalog product by id or SKU | | `PATCH` | `/v1/vendor/catalog/{id}` | Bearer key only | Update a catalog product (vendor.catalog:write bearer key) | | `DELETE` | `/v1/vendor/catalog/{id}` | Bearer key only | Delete a catalog product (vendor.catalog:write bearer key) | | `GET` | `/v1/vendor/news` | Public token or Bearer key | Supplier seasonal announcement note | | `PUT` | `/v1/vendor/news` | Bearer key only | Update the announcement sent to restaurants and websites (vendor.catalog:write bearer key) | | `GET` | `/v1/vendor/orders` | Bearer key only | List incoming restaurant purchase orders (vendor.orders:read bearer key) | | `GET` | `/v1/vendor/orders/{id}` | Bearer key only | Single purchase order details with customer card (vendor.orders:read bearer key) | | `PATCH` | `/v1/vendor/orders/{id}` | Bearer key only | Acknowledge, decline, or advance order fulfillment status (vendor.orders:write bearer key) | | `GET` | `/v1/vendor/pick-list` | Bearer key only | Aggregated warehouse pick list for a delivery date (vendor.orders:read bearer key) | | `GET` | `/v1/vendor/restaurants` | Bearer key only | Connected restaurants, terms, credit holds and price overrides (vendor.restaurants:read bearer key) | | `GET` | `/v1/vendor/standing-orders` | Bearer key only | Recurring standing orders from connected restaurants (vendor.restaurants:read bearer key) | | `GET` | `/v1/vendor/routes` | Bearer key only | Delivery routes, weekdays, drivers and stop sequences (vendor.orders:read bearer key) | | `GET` | `/v1/vendor/invoices` | Bearer key only | Tracked invoices with version and payment status (vendor.invoices:read bearer key) | | `GET` | `/v1/vendor/recalls` | Bearer key only | Sent batch recalls and restaurant acknowledgement status (vendor.recalls:read bearer key) | | `GET` | `/v1/vendor/jobs` | Public token or Bearer key | Open roles on the supplier’s team | | `POST` | `/v1/vendor/applications` | Public token or Bearer key | Submit a job application to a supplier team | | `GET` | `/v1/vendor/webhooks` | Bearer key only | List supplier webhooks (vendor.webhooks:manage bearer key) | | `POST` | `/v1/vendor/webhooks` | Bearer key only | Register a signed supplier webhook (vendor.webhooks:manage bearer key) | | `PATCH` | `/v1/vendor/webhooks/{id}` | Bearer key only | Update a supplier webhook | | `DELETE` | `/v1/vendor/webhooks/{id}` | Bearer key only | Delete a supplier webhook | | `POST` | `/v1/vendor/webhooks/{id}/ping` | Bearer key only | Send a test ping to a supplier webhook | | `GET` | `/v1/vendor/webhooks/{id}/deliveries` | Bearer key only | List delivery attempts for a supplier webhook | | `POST` | `/v1/vendor/webhooks/{id}/deliveries/{deliveryId}/replay` | Bearer key only | Replay a failed or stopped supplier webhook delivery | --- # Brigly Webhooks Reference ## Headers sent on every delivery - `X-Brigly-Event`: Event name (or `ping` on test pings) - `X-Brigly-Signature`: `sha256=` - `X-Brigly-Delivery`: Unique delivery id (`evt_...`), preserved across retries and manual replays - `X-Brigly-Timestamp`: Unix epoch milliseconds when the event was created ## Retry schedule & replay Network errors, `408`, `425`, `429`, and `5xx` responses are retried automatically up to 6 attempts over 1m, 5m, 30m, 2h, and 6h. Non-transient `4xx` responses fail immediately. Retries stop after 72 hours. Retained payloads can be manually replayed for 7 days. ## Signature verification example (Node.js / TypeScript) ```ts import { createHmac, timingSafeEqual } from "node:crypto"; export function verifyBriglyWebhook(rawBody: string | Buffer, header: string, secret: string): boolean { const expected = "sha256=" + createHmac("sha256", secret).update(rawBody).digest("hex"); const a = Buffer.from(expected, "utf8"); const b = Buffer.from(String(header || ""), "utf8"); return a.length === b.length && timingSafeEqual(a, b); } ``` ## Events | Event | Description | |---|---| | `menu.updated` | The menu or its availability changed | | `item.86ed` | A dish or ingredient went on or off the 86 board | | `restaurant.updated` | Restaurant profile, address or service hours changed | | `reservation.created` | A booking was made | | `reservation.updated` | A booking changed | | `reservation.cancelled` | A booking was cancelled or marked a no-show | | `specials.updated` | Specials, happy hours or events changed | | `floor.updated` | The floor layout, schedule or public visibility changed | | `catering.requested` | A catering or private-dining inquiry was submitted | | `catering.updated` | A catering inquiry changed or was withdrawn | | `membership.requested` | A guest requested to join a membership plan | | `membership.updated` | A membership join request was answered or withdrawn | | `jobs.updated` | Open roles or hiring settings changed | | `application.received` | A candidate submitted a job application | | `application.updated` | An application moved stages, was hired or was withdrawn | | `feedback.received` | A guest submitted ratings or feedback | | `vendor.profile.updated` | Supplier profile, delivery schedule, cutoff or logo changed | | `vendor.catalog.updated` | Supplier catalog items, prices, availability counts or announcement changed | | `vendor.order.received` | A connected restaurant submitted a new purchase order | | `vendor.order.updated` | A purchase order was acknowledged, proposed, dispatched, delivered, or declined | | `vendor.connection.requested` | A restaurant requested to connect to this supplier catalog | | `vendor.connection.updated` | A restaurant connection status or agreed pricing changed | | `vendor.invoice.updated` | A tracked invoice was created, issued, refreshed, approved, disputed, marked paid, or voided | | `vendor.recall.sent` | A lot/batch recall notice was sent to affected restaurants |