{"openapi":"3.1.0","info":{"title":"Nine Tables Customer Data Platform API","version":"1.2.0","description":"The Nine Tables Customer Data Platform API: customers, bookings, tenant-defined attributes, segments and webhooks. This document is the reference, webhook payloads included, and the guides start at https://developer.ninetables.io/guides/getting-started/.","termsOfService":"https://ninetables.io/legal/terms-of-service","license":{"name":"Proprietary — use is governed by the Nine Tables Terms of Service","url":"https://ninetables.io/legal/terms-of-service"},"contact":{"name":"Nine Tables support","url":"https://ninetables.io"}},"tags":[{"name":"keys","description":"The API key itself: `GET /me` reads its scopes, its rate limit and every enforced limit."},{"name":"customers","description":"Guests: list, count and read them, create or find one by its contact details, and write their attribute values and your own key on them."},{"name":"bookings","description":"The booking diary and free times: list, read, create and change bookings, and write their attribute values and your own key on them."},{"name":"loyalty","description":"The restaurant’s loyalty club: read a guest’s membership, enrol a guest, and transfer members from another loyalty system. Nothing here sends the guest a message."},{"name":"categories","description":"The categories attribute definitions are filed under, archived rather than deleted."},{"name":"definitions","description":"The tenant-defined customer and booking attributes, archived rather than deleted."},{"name":"batch","description":"Attribute writes to many customers and bookings in one request, applied and answered item by item."},{"name":"segments","description":"The segments the restaurant builds in the Nine Tables app: their rules, counts and member customers."},{"name":"webhooks","description":"Webhook subscriptions and their delivery log, and the deliveries this API sends to your endpoint."},{"name":"restaurants","description":"The tenant’s restaurants, whose ids scope bookings, free times and webhook filters, and the directories of each one’s areas, tables and experiences."}],"components":{"responses":{"Unauthorized":{"description":"Missing, malformed, unknown or revoked API key (`unauthorized`), all four the identical response with `WWW-Authenticate: Bearer`. No key resolved, so it carries no `X-RateLimit-*`. See https://developer.ninetables.io/guides/errors/#the-identical-401.","headers":{"WWW-Authenticate":{"description":"Always `Bearer` — the API accepts no other authentication scheme.","schema":{"type":"string","const":"Bearer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemBody"},"example":{"type":"https://ninetables.io/problems/unauthorized","title":"Unauthorized","status":401,"detail":"Missing, malformed, unknown, or revoked API key","code":"UNAUTHORIZED"}}}},"PayloadTooLarge":{"description":"Request body over 1 MB (`payload-too-large`), drained before the response is written so you receive this rather than a reset connection. See https://developer.ninetables.io/guides/rate-limits/#limits.","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemBody"},"example":{"type":"https://ninetables.io/problems/payload-too-large","title":"Payload Too Large","status":413,"detail":"Request body exceeds 1048576 bytes","code":"PAYLOAD_TOO_LARGE"}}}},"IdempotencyKeyConflict":{"description":"The `Idempotency-Key` was already used for a different method, path, declared query parameters or raw body (`idempotency-key-conflict`), or for a request that was applied and cannot replay, which `detail` then says. Never re-send an applied request, with this key or without one. See https://developer.ninetables.io/guides/idempotency/.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemBody"},"example":{"type":"https://ninetables.io/problems/idempotency-key-conflict","title":"Idempotency Key Conflict","status":422,"detail":"This Idempotency-Key was already used for a different request","code":"IDEMPOTENCY_KEY_CONFLICT"}}}},"RateLimited":{"description":"The per-key fixed-window limit is exhausted (`rate-limited`): wait `Retry-After` seconds, then retry the same request. `X-RateLimit-Remaining` is 0, except on a `POST /batch` or `POST /loyalty/members/import` whose items did not fit, where it is how many still would. See https://developer.ninetables.io/guides/rate-limits/#rate-limits.","headers":{"Retry-After":{"description":"Seconds to wait before retrying the same request.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Tokens left in the current window: 0, except on a `POST /batch` or `POST /loyalty/members/import` refused because its items did not fit, where it is the most items it could still carry.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemBody"},"example":{"type":"https://ninetables.io/problems/rate-limited","title":"Too Many Requests","status":429,"detail":"Rate limited. Retry after 37s.","code":"RATE_LIMITED","retry_after":37}}}},"InternalError":{"description":"Unexpected server error (`internal`), retryable; the cause is captured server-side and never echoed. See https://developer.ninetables.io/guides/errors/#409-and-500.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemBody"},"example":{"type":"https://ninetables.io/problems/internal","title":"Internal Server Error","status":500,"code":"INTERNAL"}}}}},"securitySchemes":{"cdpApiKey":{"type":"http","scheme":"bearer","bearerFormat":"nt_<live|test>_<30 random + 6 checksum characters, base62>","description":"A CDP API key minted by a restaurant Owner in the Nine Tables app, sent as `Authorization: Bearer nt_live_…`: 44 characters matching `\\bnt_(?:live|test)_[0-9A-Za-z]{36}\\b`, `live` for production and `test` for staging and local deployments. The scheme is matched case-insensitively, so this lowercase `scheme` is safe to emit, and the credential case-sensitively. See https://developer.ninetables.io/guides/authentication/#key-format."},"ninetablesWebhookSignature":{"type":"apiKey","in":"header","name":"webhook-signature","description":"How an inbound delivery proves it came from Nine Tables: a Standard Webhooks signature (https://www.standardwebhooks.com) made with the subscription’s secret, not your API key. The value is `v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_`, and carries a second, space-separated entry during a 24-hour rotation overlap. Verify over the raw bytes before parsing and reject a `webhook-timestamp` more than 300 seconds off; https://developer.ninetables.io/guides/webhooks/#verifying-a-delivery has a verifier and an offline fixture."}},"schemas":{"WebhookEventType":{"type":"string","enum":["customer.created","customer.updated","customer.merged","customer.deleted","segment.customer.entered","segment.customer.exited","booking.created","booking.updated","booking.deleted","definition.computed"],"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event."},"WebhookCustomerDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Delivery id — equal to the `webhook-id` header on the same request, which the signature covers, and the key to dedupe on after verifying: delivery is at-least-once, and a retry or a redelivery carries the same id, so a second arrival must be a no-op in your store."},"type":{"type":"string","enum":["customer.created","customer.updated","customer.merged","customer.deleted"],"description":"Which of the four customer events this is, repeated from the `X-NineTables-Event` header. It decides the one member `data` carries beside `customer`: `changed` on `customer.updated`, `merged_customer_ids` on `customer.merged`, `reason` on `customer.deleted`, and none on `customer.created`."},"api_version":{"type":"string","enum":["1"],"description":"The API major version the body is rendered under — the value the `X-NT-API-Version` header carries on every API response, so one pinned value covers the reads and the deliveries."},"created_at":{"type":"string","format":"date-time","description":"RFC 3339 instant, microsecond precision and a literal `Z`, recording when the write that raised this event enqueued it, not when the delivery was sent. It is a clock time rather than a commit order, and deliveries arrive in no order, so when the order of two events matters read `GET /customers/{customerRef}` back rather than sorting by this member."},"data":{"type":"object","properties":{"customer":{"anyOf":[{"$ref":"#/components/schemas/WebhookDeliveryCustomer"},{"$ref":"#/components/schemas/WebhookDeletedCustomer"}],"description":"The guest as the write left it — `WebhookDeliveryCustomer`, a full snapshot rather than a diff, and on `customer.merged` the surviving guest — except on `customer.deleted`, where it is `WebhookDeletedCustomer`: the id and your own key only. Attribute values are not included; read them with `GET /customers/{customerRef}/attributes`."},"changed":{"type":"array","items":{"anyOf":[{"type":"string","enum":["firstname","lastname","email","phone","marketing_consent"]},{"type":"string","pattern":"^attributes\\.[a-z][a-z0-9_]*$"}]},"description":"On `customer.updated` only: the watched members of `customer` that changed, in the order `firstname`, `lastname`, `email`, `phone`, `marketing_consent`, then `attributes.<key>` for each attribute value set, changed or cleared, sorted by key. A value is never carried, and neither rewriting the value already held nor a computed value raises an event."},"merged_customer_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"On `customer.merged` only: the guests merged into `customer`, which now answer 404 by id while a `{system}:{key}` ref to any of their keys resolves to `customer`. A merge that filled the survivor’s empty email or phone also sends a `customer.updated` for those members."},"reason":{"type":"string","enum":["deleted","erased"],"description":"On `customer.deleted` only: `deleted` when the guest was trashed or deleted outright, `erased` when a GDPR erasure anonymized them. On `erased`, delete everything you hold about the guest."}},"required":["customer"],"description":"What the event is about: always `customer`, plus the one member the event adds. No `segment` or `booking` member ever appears here."}},"required":["id","type","api_version","created_at","data"],"description":"The JSON body of a customer delivery: `customer.created`, `customer.updated`, `customer.merged` or `customer.deleted`. The envelope matches every other delivery and only `data` differs, so verify the signature over the raw bytes, parse once, then branch on `type`. Produced from the write itself, one event per real change to the guest record; an import sends none."},"WebhookDeliveryCustomer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The Nine Tables customer id — stable, and the ref every `{customerRef}` route accepts."},"source_system":{"type":["string","null"],"description":"The `source_system` this subscription declared, or null. Populated only when the customer holds a key of that system — the same rule the REST routes apply to a path ref or a resolve criterion, so a pair you read here is always yours and never another integration’s."},"source_key":{"type":["string","null"],"description":"The key your declared system holds on this customer, or null. A customer can hold keys from several systems, and each subscription is sent its own system’s key only: both halves null means \"no key from your system\", never \"taken by someone else\"."},"firstname":{"type":["string","null"],"description":"Given name, or null when Nine Tables holds none. Sent on every delivery whatever `include_contact` says, unlike `email` and `phone`."},"lastname":{"type":["string","null"],"description":"Family name, or null when Nine Tables holds none. Sent on every delivery, on the same footing as `firstname`."},"created_at":{"type":"string","format":"date-time","description":"When Nine Tables first recorded the guest, which never changes. A guest an import brought in carries the time of the import, not of an earlier visit."},"email":{"type":["string","null"],"description":"Present only when the subscription sets `include_contact: true`."},"phone":{"type":["string","null"],"description":"Present only when the subscription sets `include_contact: true`."},"marketing_consent":{"anyOf":[{"$ref":"#/components/schemas/MarketingConsent"},{"type":"null"}],"description":"Present only when the subscription sets `include_contact: true`. The guest’s current marketing consent, or null when they have given none or withdrawn it."}},"required":["id","source_system","source_key","firstname","lastname","created_at"],"description":"The `data.customer` of a segment transition, of a customer event except `customer.deleted`, which carries `WebhookDeletedCustomer`, and of a booking event whose subscription sets `include_customer: true`. The subscription decides the members: `id`, the source-identity pair, `firstname`, `lastname` and `created_at` always, and `email`, `phone` and `marketing_consent` only with `include_contact: true`, so `POST /webhooks/{id}/test` sends exactly the set your parser will meet."},"MarketingConsent":{"type":"object","properties":{"granted_at":{"type":"string","format":"date-time","description":"When the consent was recorded. A grant the guest gave through the widget, the queue or their profile records the day only, as midnight UTC."},"source":{"$ref":"#/components/schemas/MarketingConsentSource"}},"required":["granted_at","source"],"description":"The guest’s current consent to marketing, read-only on this API: it is given and withdrawn in Nine Tables itself, and a withdrawal makes the member null. See https://developer.ninetables.io/guides/addressing/#marketing-consent."},"MarketingConsentSource":{"type":"string","enum":["widget","queue","import","staff","account","api"],"description":"Where the current marketing consent came from: `widget` the booking widget or an order form, `queue` the walk-in queue, `import` an imported file, `staff` a staff member in the Nine Tables app, `account` the guest’s own signed-in profile, `api` an integration enrolling the guest in the loyalty club (`POST /loyalty/members`). A grant recorded before sources were kept carries an inferred one, `import` when it fell inside an import of the guest and `widget` otherwise."},"WebhookDeletedCustomer":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The Nine Tables customer id of the guest that is gone."},"source_system":{"type":["string","null"],"description":"The `source_system` this subscription declared, or null — populated only when the guest held a key of that system, under the rule `WebhookDeliveryCustomer` states."},"source_key":{"type":["string","null"],"description":"The key your declared system held on this guest, or null: the handle to delete your own copy by. A trashed guest’s key is still sent, though the trash released it."}},"required":["id","source_system","source_key"],"description":"The `data.customer` of a `customer.deleted` delivery: the id and your own key, and never a name or contact member, whatever `include_contact` says."},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Delivery id — equal to the `webhook-id` header on the same request, which the signature covers, and the key to dedupe on after verifying: delivery is at-least-once, and a retry or a redelivery carries the same id, so a second arrival must be a no-op in your store."},"type":{"$ref":"#/components/schemas/WebhookEventType"},"api_version":{"type":"string","enum":["1"],"description":"The API major version the body is rendered under — the value the `X-NT-API-Version` header carries on every API response, so one pinned value covers the reads and the deliveries."},"created_at":{"type":"string","format":"date-time","description":"RFC 3339 instant the 5-minute membership sample observed the transition, not when it happened or when the delivery was sent. It is a clock time rather than a commit order, and deliveries arrive in no order, so when the order of two events matters read `GET /segments/{id}/customers` back rather than sorting by this member."},"data":{"type":"object","properties":{"segment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"customer":{"$ref":"#/components/schemas/WebhookDeliveryCustomer"}},"required":["segment","customer"],"description":"What the event happened to: the segment whose membership changed, and the customer it changed for. `segment.id` is the id `GET /segments/{id}/customers` takes, so a consumer can reconcile against the full membership straight from a delivery, and `segment.name` is a label the restaurant can rename at any time — key your own records on the id."}},"required":["id","type","api_version","created_at","data"],"description":"The JSON body of a segment membership delivery, `segment.customer.entered` or `segment.customer.exited`. Its envelope (`id`, `type`, `api_version`, `created_at`) is the one `WebhookCustomerDelivery` and `WebhookBookingDelivery` share, so one parser reads every delivery and only `data` branches on `type`. Verify the signature over the raw bytes before parsing: see https://developer.ninetables.io/guides/webhooks/#verifying-a-delivery."},"WebhookBookingDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Delivery id — equal to the `webhook-id` header on the same request, which the signature covers, and the key to dedupe on after verifying: delivery is at-least-once, and a retry or a redelivery carries the same id, so a second arrival must be a no-op in your store."},"type":{"type":"string","enum":["booking.created","booking.updated"],"description":"Which snapshot-carrying booking event this is, repeated from the `X-NineTables-Event` header. `booking.created` carries no `data.changed` and `booking.updated` always does, while `booking.deleted` has its own body, `WebhookBookingDeletedDelivery`."},"api_version":{"type":"string","enum":["1"],"description":"The API major version the body is rendered under — the value the `X-NT-API-Version` header carries on every API response, so one pinned value covers the reads and the deliveries."},"created_at":{"type":"string","format":"date-time","description":"RFC 3339 instant, microsecond precision and a literal `Z`, recording when the write that raised this event enqueued it, not when the delivery was sent or the visit starts. It is a clock time rather than a commit order, and deliveries arrive in no order, so when the order of two events matters read `GET /bookings/{bookingRef}` back rather than sorting by this member."},"data":{"type":"object","properties":{"booking":{"anyOf":[{"$ref":"#/components/schemas/BookingSummary"}],"description":"The full booking as it stood when the event was enqueued, byte-for-byte what `GET /bookings/{bookingRef}` returns, its key withheld unless your declared system holds it. Attribute values are not included; read them with `GET /bookings/{bookingRef}/attributes`."},"tables":{"type":"array","items":{"$ref":"#/components/schemas/Table"},"description":"Every table `booking.table_ids` names, in that order, as `GET /restaurants/{restaurantId}/tables?include_inactive=true` listed it when the event was enqueued, so a table move arrives with the new table’s `name`; `[]` when the booking holds none. Absent only on an event queued before deliveries carried it, which reaches you only as a retry or a redelivery."},"customer":{"anyOf":[{"$ref":"#/components/schemas/WebhookDeliveryCustomer"},{"type":"null"}],"description":"Present only when the subscription sets `include_customer: true`: the guest `booking.customer_id` names, as customer events carry them, with `email`, `phone` and `marketing_consent` under `include_contact`. Null when the booking has no guest or `GET /customers/{customerRef}` answers 404 for them."},"changed":{"type":"array","items":{"anyOf":[{"type":"string","enum":["start_time","end_time","status","guest_count","customer_id","customer_notes","staff_notes","allergens","dietary_preferences","requested_area_id","requested_table_count","table_ids"]},{"type":"string","pattern":"^attributes\\.[a-z][a-z0-9_]*$"}]},"description":"Present and never empty on `booking.updated`, absent on `booking.created`: the members of `booking` that one write moved, in enum order, or `attributes.<key>` for each attribute value set, changed or cleared, sorted by key. A write that moved members and tables together is one event listing both. A value is never carried and the source-identity pair is never an entry; see https://developer.ninetables.io/guides/webhooks/#booking-events."}},"required":["booking"],"description":"What the event is about: `booking`, its `tables`, the guest as `customer` when the subscription sets `include_customer: true`, and `changed` on an update, never a `segment` member. Without `include_customer`, reach the guest through `booking.customer_id`, which is null on a booking with no customer record."}},"required":["id","type","api_version","created_at","data"],"description":"The JSON body of a booking delivery that carries the snapshot, `booking.created` or `booking.updated`, while `booking.deleted` is `WebhookBookingDeletedDelivery`. The envelope matches every other delivery and only `data` differs, so verify the signature over the raw bytes, parse once, then branch on `type`. These events come from the booking write itself rather than from a 5-minute membership sample, so nothing is lost to a sampling window."},"BookingSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The booking id, and a valid `{bookingRef}` for every booking route — including the attribute read and write."},"source_system":{"type":["string","null"],"description":"The system you named — in the `{source_system}:{source_key}` path ref, in `?source_system=`, or as the `source_system` your webhook subscription declared — lower-cased, when this booking holds a key from it. A booking holds at most one key per external system, and only the key of the system you named is ever shown; null when you named none or the booking holds no key from yours."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this booking — a POS order number, typically. Verbatim, never case-folded, and null exactly when `source_system` is."},"start_time":{"type":"string","format":"date-time","description":"When the party is seated, and the instant `from`/`to` filter on; pages are ordered by booking id, so sort by this member for a timeline."},"end_time":{"type":"string","format":"date-time","description":"The end of the booking’s table slot, when the table is expected to free up; no filter reads it."},"status":{"anyOf":[{"$ref":"#/components/schemas/BookingStatus"}],"description":"The booking’s lifecycle status, set by `POST /bookings`, moved by `PATCH /bookings/{bookingRef}` and otherwise by Nine Tables itself."},"guest_count":{"type":["integer","null"],"description":"The party size the booking was made for — guests at the table, not a count of linked customer records."},"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant this booking belongs to, fixed when it is created, which `GET /restaurants` lists only with `include_inactive=true` once it is disabled or demo."},"customer_id":{"type":["string","null"],"format":"uuid","description":"The customer this booking is attributed to, and a valid `{customerRef}`; null when the booking carries no customer record."},"customer_notes":{"type":["string","null"],"description":"What the guest asked for, in their words, which the floor sees and the guest’s confirmation echoes; null when there is none or it is only whitespace."},"staff_notes":{"type":["string","null"],"description":"The venue’s internal note, never shown to the guest; null when there is none or it is only whitespace."},"allergens":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AllergenCode"},"description":"The party’s declarable allergens as codes, `[]` when none is declared — the whole set a `PATCH` replaces, so to add one, send this list with it."},"dietary_preferences":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DietaryPreferenceCode"},"description":"The party’s dietary preferences as codes, `[]` when none is stated, replaced as a set exactly as `allergens` is."},"requested_area_id":{"type":["string","null"],"format":"uuid","description":"The area the guest asked for, a preference that holds no table and can name an area the venue has since removed, which `GET /restaurants/{restaurantId}/areas?include_inactive=true` still names; null when they asked for none."},"requested_table_count":{"type":["integer","null"],"description":"How many tables the guest asked for, a request rather than an assignment; null when they named no number."},"table_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The tables the booking holds, in ascending id order and `[]` when it holds none, each named by `GET /restaurants/{restaurantId}/tables?include_inactive=true` even after the venue removes it. See https://developer.ninetables.io/guides/webhooks/#booking-events."}},"required":["id","source_system","source_key","start_time","end_time","status","guest_count","restaurant_id","customer_id","customer_notes","staff_notes","allergens","dietary_preferences","requested_area_id","requested_table_count","table_ids"],"description":"A booking’s own fields without its attribute values, as `GET /bookings`, `GET /bookings/{bookingRef}` and the `booking` member of `GET /bookings/{bookingRef}/attributes` return them, and the `data.booking` a `booking.created` or `booking.updated` webhook delivers. `POST /bookings` and `PATCH /bookings/{bookingRef}` write them and the `source-identity` routes the pair, while Nine Tables sets them for a booking made in the app or the widget. See https://developer.ninetables.io/guides/bookings/#reading-the-diary.","example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"BookingStatus":{"type":"string","enum":["booking_confirmed","booking_requested","waitlist_requested","guest_arrived","guest_seated","completed","guest_no_show","system_closed_confirmed_booking","system_closed_booking_request","system_closed_waitlist_request","guest_cancelled_confirmed_booking","restaurant_cancelled_confirmed_booking","guest_cancelled_booking_request","restaurant_declined_booking_request","guest_cancelled_waitlist_request","restaurant_declined_waitlist_request"],"description":"A booking’s lifecycle status, from a platform-fixed vocabulary that is the same on every tenant. `completed` is the finished visit, `guest_no_show` the no-show, `booking_confirmed`, `guest_arrived` and `guest_seated` hold a table, `booking_requested` and `waitlist_requested` await a staff decision, and every `*_cancelled_*`, `*_declined_*` and `system_closed_*` value is a terminal non-visit named for who ended it. See https://developer.ninetables.io/guides/bookings/#a-booking-status-is-a-fixed-vocabulary."},"AllergenCode":{"type":"string","enum":["gluten","crustaceans","eggs","fish","peanuts","soybeans","milk","tree_nuts","celery","mustard","sesame","sulphites","lupin","molluscs","other"],"description":"One declarable allergen: the first fourteen are the EU-14 of Annex II to Regulation (EU) No 1169/2011, which the kitchen ticket, the guest’s confirmation and the venue’s allergen filter render, and a code outside the set is refused. `other` means no more than “ask the guest”, so prefer a named code and put the detail in `customer_notes`."},"DietaryPreferenceCode":{"type":"string","enum":["vegan","vegetarian","pescatarian","halal","kosher","other"],"description":"One dietary preference, as the kitchen reads it: a choice rather than the medical fact an allergen is, so `vegan` here implies nothing about `allergens`. `other` means the guest stated something outside this list — name it in `customer_notes`, which the kitchen sees beside this."},"Table":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The table id — exactly the value `table_ids` takes on `POST /bookings` and `PATCH /bookings/{bookingRef}`, and that a booking’s `table_ids` carries."},"area_id":{"type":"string","format":"uuid","description":"The area the table stands in, an `id` that `GET /restaurants/{restaurantId}/areas` lists under the same `include_inactive`."},"name":{"type":"string","description":"The table’s label as the floor plan shows it, such as `12` or `Window 2`: plain text the venue typed, never translated."},"capacity_from":{"type":"integer","description":"The smallest party the venue seats at this table on its own."},"capacity_to":{"type":"integer","description":"The largest party the table seats on its own; a larger party can still be seated across several tables."},"active":{"type":"boolean","description":"False for a table the venue has removed, or one in an area it removed, which only `include_inactive=true` returns. Only an active table may be newly sent in `table_ids`; a booking that already holds a removed one keeps it."},"booking_priority":{"type":"integer","description":"The venue’s own ranking weight for the table, which Nine Tables reads after capacity and area when it suggests a table; compare it only between tables of one restaurant."},"shape":{"type":"string","enum":["round","rectangle"],"description":"How the floor plan draws the table; display only."}},"required":["id","area_id","name","capacity_from","capacity_to","active","booking_priority","shape"],"description":"One table on a restaurant’s floor plan, the directory that names the `table_ids` a booking carries and sends, and each entry of a booking delivery’s `data.tables`. Its `name` is the label the floor uses, and the one a `conflict-booking-overlap` names it by.","example":{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"12","capacity_from":2,"capacity_to":4,"active":true,"booking_priority":10,"shape":"rectangle"}},"WebhookBookingDeletedDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Delivery id — equal to the `webhook-id` header on the same request, which the signature covers, and the key to dedupe on after verifying: delivery is at-least-once, and a retry or a redelivery carries the same id, so a second arrival must be a no-op in your store."},"type":{"type":"string","enum":["booking.deleted"],"description":"Always `booking.deleted`, repeated from the `X-NineTables-Event` header."},"api_version":{"type":"string","enum":["1"],"description":"The API major version the body is rendered under — the value the `X-NT-API-Version` header carries on every API response, so one pinned value covers the reads and the deliveries."},"created_at":{"type":"string","format":"date-time","description":"RFC 3339 instant, microsecond precision and a literal `Z`, recording when the write that removed the booking enqueued this event; a `booking.updated` can still arrive after it. It is a clock time rather than a commit order, and deliveries arrive in no order, so when the order of two events matters read `GET /bookings/{bookingRef}`, which answers 404 once it is gone, back rather than sorting by this member."},"data":{"type":"object","properties":{"booking":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The Nine Tables booking id of the booking that is gone."},"source_system":{"type":["string","null"],"description":"The `source_system` this subscription declared, or null — populated only when the booking held a key of that system, under the same withholding rule as `BookingSummary`."},"source_key":{"type":["string","null"],"description":"The key your declared system held on this booking, or null: the handle to delete your own copy by. A trashed booking’s key is still sent, though the trash released it."},"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant the booking belonged to, so a consumer that keeps one store per restaurant can route the deletion without a lookup."}},"required":["id","source_system","source_key","restaurant_id"],"description":"The id, the restaurant and your own key — never a snapshot: no time, party, status or guest."}},"required":["booking"],"description":"One member, `booking`. No `changed`, `segment` or `customer` member ever appears here."}},"required":["id","type","api_version","created_at","data"],"description":"The JSON body of a `booking.deleted` delivery, `Content-Type: application/json`: a booking was moved to the trash or deleted outright. The envelope matches every other delivery; `data.booking` keeps only the id, the restaurant and the subscription’s own `source_system`/`source_key` pair."},"WebhookDefinitionComputedDelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Delivery id — equal to the `webhook-id` header on the same request, which the signature covers, and the key to dedupe on after verifying: delivery is at-least-once, and a retry or a redelivery carries the same id, so a second arrival must be a no-op in your store."},"type":{"type":"string","enum":["definition.computed"],"description":"Always `definition.computed`, repeated from the `X-NineTables-Event` header."},"api_version":{"type":"string","enum":["1"],"description":"The API major version the body is rendered under — the value the `X-NT-API-Version` header carries on every API response, so one pinned value covers the reads and the deliveries."},"created_at":{"type":"string","format":"date-time","description":"RFC 3339 instant, microsecond precision and a literal `Z`, recording when the computation that finished enqueued this event, not when the delivery was sent. It is a clock time rather than a commit order, and deliveries arrive in no order, so when the order of two events matters read `GET /definitions/{entity}/{key}` back rather than sorting by this member."},"data":{"type":"object","properties":{"definition":{"type":"object","properties":{"entity":{"type":"string","enum":["customer"],"description":"The entity the definition belongs to: always `customer`, the one entity whose values are computed."},"key":{"type":"string","description":"The definition’s `key`, which with `entity` addresses it in `GET /definitions/{entity}/{key}`."},"name":{"type":"string","description":"The definition’s `label` when the event was enqueued, a display name the tenant can change at any time, so key your own records on `key`."},"source":{"type":"string","enum":["tenant","system"],"description":"`tenant` for an attribute the tenant defined, `system` for one from the Nine Tables catalogue, as the definition’s own `source` reads."}},"required":["entity","key","name","source"],"description":"The computed definition whose computation finished."},"state":{"type":"string","enum":["ready","failed"],"description":"How the computation ended: `ready` once it has covered every guest, `failed` when it stopped after repeated errors, with the reason in the definition’s `computed.error`."},"guest_count":{"type":"integer","minimum":0,"description":"How many guests held a value for the definition when the event was enqueued, 0 on `failed`. Values move with bookings afterwards without another event."},"computed_at":{"type":["string","null"],"format":"date-time","description":"The definition’s `computed.computed_at` when the event was enqueued: when the computation this event reports became `ready`; `null` on `failed`, since each computation clears it when it starts."}},"required":["definition","state","guest_count","computed_at"],"description":"What the event is about: the definition, how its computation ended and how many guests hold a value. No `customer`, `segment` or `booking` member ever appears here."}},"required":["id","type","api_version","created_at","data"],"description":"The JSON body of a `definition.computed` delivery: a computed attribute finished its first computation or a recompute, or failed. The envelope matches every other delivery and only `data` differs, so verify the signature over the raw bytes, parse once, then branch on `type`. Read the values back after it, since computed values raise no `customer.updated`."},"CounterOp":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","enum":["increment"]},"key":{"type":"string","minLength":1,"maxLength":64},"by":{"type":"integer"},"at":{"type":"string","format":"date-time"}},"required":["op","key"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["set_key"]},"key":{"type":"string","minLength":1,"maxLength":64},"count":{"type":"integer","minimum":0},"last_at":{"type":"string","format":"date-time"}},"required":["op","key","count"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["remove_key"]},"key":{"type":"string","minLength":1,"maxLength":64}},"required":["op","key"],"additionalProperties":false}],"description":"One atomic change to one key of a `counter_list`, discriminated on `op`: `increment` adds `by` (default 1, negative to subtract, floored at zero) under the row lock, `set_key` pins an exact `count`, and `remove_key` deletes the key. Send one as the attribute’s value or several in a `CounterOpBatch`; any other data type answers `op_not_supported`. See https://developer.ninetables.io/guides/writing-attributes/.","example":{"op":"increment","key":"margherita","by":2,"at":"2026-08-18T19:22:00Z"}},"CounterOpBatch":{"type":"object","properties":{"ops":{"type":"array","items":{"$ref":"#/components/schemas/CounterOp"},"minItems":1,"maxItems":100,"description":"The ops to apply to this attribute, in order, each seeing the effect of the ones before it. An empty array, or any member beside `ops`, is `invalid_op`."}},"required":["ops"],"additionalProperties":false,"description":"Several counter ops on ONE attribute, applied in array order under the row lock — so `[+5 \"a\", remove_key \"a\", +2 \"a\"]` leaves a count of 2, not 7 and not absent."},"CounterEntry":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64,"description":"What is counted (`margherita`, `takeaway`), from an open key space: no definition declares the legal keys, and a new one appears the first time it is written. Keys compare exactly, so `Margherita` and `margherita` are two counters."},"count":{"type":"integer","minimum":0,"description":"How many, a whole number of zero or more (anything else is `invalid_counter_entry`). An entry written with `count: 0` removes the key, so a read never shows a zero."},"last_at":{"type":"string","format":"date-time","description":"When this key was last counted, which the `key_last_at_*` segment operators compare, as an RFC 3339 instant whose offset is required. Omitted on a write, the key keeps its stored `last_at`, or takes the moment of the write when it is new. See https://developer.ninetables.io/guides/timestamps/#what-is-accepted-on-input."}},"required":["key","count"],"additionalProperties":false,"description":"One key of a `counter_list` attribute and its tally: an array of these is the stored value, and sending one replaces the counter whole. A key may appear once per array (a repeat is `invalid_counter_entry`), and `CounterOp` adjusts one key without restating the rest. See https://developer.ninetables.io/guides/writing-attributes/.","example":{"key":"margherita","count":12,"last_at":"2026-08-18T19:22:00Z"}},"MultiSelectOp":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove"],"description":"`add` unions the listed values into the stored set and `remove` takes them out, both idempotent and both leaving the rest in place. There is no `set` op: a plain array is the full replace."},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":100,"description":"The option `value`s to add or remove, at least one (`invalid_op` otherwise): on `add` each must be one of the definition’s `options` (`unknown_option`), while on `remove` an unknown value takes nothing out. `Limits.multi_select_values_per_row` caps the resulting set, so a small `add` can still be refused."}},"required":["op","values"],"additionalProperties":false,"description":"An incremental change to a `multi_select`, applied on the server under the row lock so two writers never clobber each other as a full-replace array would. Any other data type answers `op_not_supported`, and a `counter_list` `invalid_op`. See https://developer.ninetables.io/guides/writing-attributes/.","example":{"op":"add","values":["ads"]}},"SelectOption":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":64,"description":"The STORED value — what an attribute write sends, and what `unknown_option` names when it sends something else. Append-only: an existing value can never be removed or renamed, only added to."},"label":{"type":"string","minLength":1,"description":"Display text. Editable at any time; carries no meaning on the wire."}},"required":["value","label"],"additionalProperties":false,"description":"One choice of a `select`/`multi_select` attribute. This list is CLOSED: a write whose value is not one of these `value`s answers `unknown_option`.","example":{"value":"gold","label":"Gold"}},"CounterGroup":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":64,"description":"The group’s own identifier — what a segment condition names as `group_key`. Append-only."},"label":{"type":"string","minLength":1,"description":"Display text for the group in the Nine Tables app’s key picker, editable at any time and, unlike `key`, not append-only. Nothing on the wire matches on it."},"item_keys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":200,"description":"The counter keys this group stands for, which constrain no write: a counter’s key space is open. Optional and append-only, and `Limits.counter_item_keys_per_group` bounds this declaration, not the keys a stored value carries."}},"required":["key","label"],"additionalProperties":false,"description":"A named bundle of counter keys (\"any pizza\"), which segment rules resolve and the Nine Tables app offers a person picking keys. It is metadata about the key space, never a constraint on it, and no counter read or write mentions a group. See https://developer.ninetables.io/guides/writing-attributes/#which-options-constrain-a-write-and-which-do-not.","example":{"key":"mains","label":"Mains","item_keys":["pizza","pasta"]}},"CounterListOptions":{"type":"object","properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/CounterGroup"},"maxItems":50,"description":"The named key bundles this counter_list declares; an empty array is legal, since groups constrain no write. Append-only: a group may be added and its `label` edited, but never removed."}},"required":["groups"],"additionalProperties":false,"description":"`options` for a `counter_list` attribute. `groups` is the only member.","example":{"groups":[{"key":"mains","label":"Mains","item_keys":["pizza","pasta"]}]}},"KeyIntrospection":{"type":"object","properties":{"key_id":{"type":"string","format":"uuid","description":"This key’s id — the dedupe scope for `Idempotency-Key` replays."},"key_name":{"type":"string","description":"The name the Owner gave this key in the Nine Tables app."},"key_prefix":{"type":"string","description":"The key’s displayable prefix, its first 12 characters. The secret itself is shown once, at issuance, and is never readable again — here or anywhere."},"tenant_id":{"type":"string","format":"uuid","description":"The restaurant tenant every request on this key is scoped to."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiScope"},"description":"The scopes THIS key holds — check before calling rather than discovering the gap as a 403."},"restaurant_ids":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"description":"The restaurants this key is limited to, or null for every restaurant of the tenant, including ones added later. What a limit narrows is listed at https://developer.ninetables.io/guides/authentication/#keys-limited-to-restaurants."},"rate_limit_per_min":{"type":"integer","description":"This key’s fixed-window budget, matching `X-RateLimit-Limit`. It overrides `limits.default_rate_limit_per_min`."},"created_at":{"type":"string","format":"date-time","description":"When the Owner issued this key in the Nine Tables app."},"last_used_at":{"type":["string","null"],"format":"date-time","description":"Last authenticated request on this key, as of BEFORE this one."},"limits":{"anyOf":[{"$ref":"#/components/schemas/Limits"}],"description":"Every limit this deployment enforces, the same for every key on every tenant, so a client can read them at runtime instead of parsing this document."}},"required":["key_id","key_name","key_prefix","tenant_id","scopes","restaurant_ids","rate_limit_per_min","created_at","last_used_at","limits"],"description":"The API key on this request, as the server sees it. A key can only describe itself, and issuing, rotating and revoking keys happen Owner-side in the Nine Tables app."},"ApiScope":{"type":"string","enum":["definitions:read","definitions:write","attributes:read","attributes:write","customers:read","customers:write","contacts:read","segments:read","webhooks:manage","bookings:read","bookings:write","loyalty:read","loyalty:write","loyalty:import"],"description":"API-key scopes, as `GET /me` reports them and `insufficient-scope` names them. A \"required by\" scope is checked before the rate-limit charge and costs nothing, while an \"also required\" one depends on what the request sends, so it is checked after the charge and its 403 costs a token. A webhook delivery carries what the matching read serves, so a key that may not read data cannot have it pushed to an endpoint either.\n\n- `definitions:read` — required by `GET /categories`, `GET /categories/{key}`, `GET /definitions`, `GET /definitions/{entity}/{key}`. Also required on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for a `definition.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers.\n- `definitions:write` — required by `POST /categories`, `PATCH /categories/{key}`, `POST /definitions`, `PATCH /definitions/{entity}/{key}`, `POST /definitions/proposals`, `POST /definitions/{entity}/{key}/recompute`.\n- `attributes:read` — required by `GET /customers/{customerRef}/attributes`, `GET /bookings/{bookingRef}/attributes`. Also required on `GET /customers` for `include=attributes`; on `GET /customers` for a `filter` or `sort`; on `GET /segments/{id}/customers` for `include=attributes`; on `GET /segments/{id}/customers` for a `filter` or `sort`. Also discloses the `values` member of `GET /customers/{customerRef}`, absent without it, the full value set in the echo of `PATCH …/attributes`, a `/batch` item, `POST /customers` and `POST /bookings`, which otherwise carries only the keys written, and the `computed.examples` of `POST /definitions/proposals`, `[]` unless the key holds both `customers:read` and `attributes:read`.\n- `attributes:write` — required by `PATCH /customers/{customerRef}/attributes`, `PUT /customers/{customerRef}/source-identity`, `DELETE /customers/{customerRef}/source-identity/{sourceSystem}`, `PATCH /bookings/{bookingRef}/attributes`, `PUT /bookings/{bookingRef}/source-identity`, `DELETE /bookings/{bookingRef}/source-identity/{sourceSystem}`, `POST /batch`. Also required on `POST /customers`, `POST /bookings` for a `values` member.\n- `customers:read` — required by `GET /customers`, `GET /customers/count`, `GET /customers/{customerRef}`. Also required on `GET /bookings`, `GET /bookings/{bookingRef}` for `include=customer`; on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers; on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers. Also discloses the `computed.examples` of `POST /definitions/proposals`, `[]` unless the key holds both `customers:read` and `attributes:read`.\n- `customers:write` — required by `POST /customers`.\n- `contacts:read` — required by `POST /customers/resolve`. Also required on `GET /customers` for `include=contact`; on `GET /segments/{id}/customers` for `include=contact`; on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers; on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers; on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for `include_contact: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers; on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers. Also discloses the `firstname`, `lastname`, `email`, `phone` and `marketing_consent` of a customer in every response that carries one.\n- `segments:read` — required by `GET /segments`, `GET /segments/{id}`, `GET /segments/{id}/count`, `GET /segments/{id}/customers`. Also required on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers.\n- `webhooks:manage` — required by `GET /webhooks`, `POST /webhooks`, `GET /webhooks/{id}`, `DELETE /webhooks/{id}`, `PATCH /webhooks/{id}`, `POST /webhooks/{id}/rotate-secret`, `POST /webhooks/{id}/test`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver`.\n- `bookings:read` — required by `GET /customers/{customerRef}/bookings`, `GET /bookings/{bookingRef}`, `GET /bookings`. Also required on `POST /webhooks`, `PATCH /webhooks/{id}`, `GET /webhooks/{id}/deliveries`, `GET /webhooks/{id}/deliveries/{deliveryId}`, `POST /webhooks/{id}/deliveries/{deliveryId}/redeliver` for a `booking.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers. Also discloses the booking diary on operations it does not gate: the `booking` member of `GET /bookings/{bookingRef}/attributes`, the diary members of the `PUT /bookings/{bookingRef}/source-identity` and `DELETE /bookings/{bookingRef}/source-identity/{sourceSystem}` answers, and the seven diary details, `customer_notes` through `table_ids`, of the `booking` member of `POST /bookings` and `PATCH /bookings/{bookingRef}`.\n- `bookings:write` — required by `PATCH /bookings/{bookingRef}`, `POST /bookings`.\n- `loyalty:read` — required by `GET /customers/{customerRef}/loyalty`.\n- `loyalty:write` — required by `POST /loyalty/members`.\n- `loyalty:import` — required by `POST /loyalty/members/import`."},"Limits":{"type":"object","properties":{"definitions_per_tenant":{"type":"integer","const":200,"description":"Tenant-defined attributes; archived INCLUDED, system attributes excluded."},"values_keys_per_request":{"type":"integer","const":200,"description":"Attribute keys one `values` or `expect` map may carry. Set to `definitions_per_tenant`, because a tenant cannot hold more definitions than that: a larger map is work guaranteed to fail, and the engine opens one subtransaction per key to collect per-key errors, so an uncapped map is how one request degrades the whole database rather than only its own response."},"categories_per_tenant":{"type":"integer","const":50,"description":"Attribute categories a tenant may hold, archived ones included and the `system` one not. See https://developer.ninetables.io/guides/writing-attributes/#categories."},"segments_per_tenant":{"type":"integer","const":200,"description":"Segments a tenant may hold, counting every row: archived, fixed and platform-seeded alike. Segments are authored in the Nine Tables app, so this bounds what `GET /segments` returns rather than anything you send."},"webhook_subscriptions_per_tenant":{"type":"integer","const":10,"description":"Webhook subscriptions per tenant across every key, inactive ones included, so only `DELETE /webhooks/{id}` frees a slot. `POST /webhooks` past the cap answers 400 `validation-failed` with one `(root)`/`invalid_value` entry."},"options_per_select":{"type":"integer","const":200,"description":"Entries in a select/multi_select `options` array."},"option_value_chars":{"type":"integer","const":64,"description":"Characters in one option `value`, on a definition’s `options` entry and wherever such a value is written (`MultiSelectOp.values`, the string array branch of `AttributeValueWrite`). The `label` beside it is not bounded by this limit."},"counter_groups_per_definition":{"type":"integer","const":50,"description":"Entries in a counter_list definition’s `options.groups`, a bound on the declaration only: a key in no group still increments. Groups are append-only, so a slot once spent stays spent."},"counter_item_keys_per_group":{"type":"integer","const":200,"description":"Counter keys one group may list in `item_keys`, a bound on the declaration rather than on stored values, which `counter_keys_per_row` bounds. See https://developer.ninetables.io/guides/writing-attributes/#which-options-constrain-a-write-and-which-do-not."},"counter_key_chars":{"type":"integer","const":64,"description":"Characters in a counter key, everywhere one appears: `CounterEntry.key`, the `key` of an `increment`/`set_key`/`remove_key` op, `CounterGroup.key`, an `item_keys` member, and a segment condition’s `key`/`group_key`. On a value write an over-long key answers `invalid_counter_entry` (inside a full-replace array) or `invalid_op` (inside an op object), keyed on the attribute rather than on a body path."},"multi_select_values_per_row":{"type":"integer","const":100,"description":"Values one multi_select attribute may hold for one entity, counted on the set after the write, so a small `add` is refused when the result would cross it. Over it answers `too_many_values`, keyed on the attribute."},"counter_keys_per_row":{"type":"integer","const":500,"description":"Distinct keys in one counter_list value. Count 0 removes the entry."},"counter_ops_per_attribute_per_request":{"type":"integer","const":100,"description":"Ops in one attribute’s `{ops: [...]}` array, per attribute rather than per request, applied in order under the row lock. Over it answers `too_many_values`, keyed on the attribute."},"groups_per_segment":{"type":"integer","const":10,"description":"OR-ed condition groups in a segment’s `rules.groups`, at least one. Segments are read-only here, so with `conditions_per_segment_group` it bounds the size of a rule you receive."},"conditions_per_segment_group":{"type":"integer","const":20,"description":"AND-ed conditions inside one group of a segment’s `rules`. At least one is required, so a group is never empty and never vacuously true."},"filters_per_condition":{"type":"integer","const":10,"description":"Booking-condition filters."},"list_filters":{"type":"integer","const":5,"description":"`filter` parameters one `GET /customers` or `GET /segments/{id}/customers` request may carry, ANDed. More answer 400 `validation-failed` keyed `filter`."},"batch_items_per_request":{"type":"integer","const":100,"description":"Rate cost is item-weighted: one token per item, so a key whose `rate_limit_per_min` is lower caps a batch at that many items instead."},"request_body_bytes":{"type":"integer","const":1048576,"description":"Bytes in one request body, enforced before anything is parsed and answered 413 `payload-too-large` rather than `validation-failed`. It binds independently of `batch_items_per_request`, so a legal batch with large values can reach it first: see https://developer.ninetables.io/guides/rate-limits/#limits."},"idempotent_stored_response_bytes":{"type":"integer","const":65536,"description":"Cap on the replay row this API stores, which is the gzip+base64 form when the verbatim JSON is larger, rather than on the response you receive. Only a response still over this size after compression goes unstored, and replaying its key then answers 422."},"idempotency_key_chars":{"type":"integer","const":128,"description":"Characters in the `Idempotency-Key` header, which must be 1 to this many and is published as that header parameter’s bound. A key outside it answers 400 `validation-failed` keyed `idempotency-key`."},"text_value_chars":{"type":"integer","const":4096,"description":"Characters in a `text` attribute value, past which a write answers `value_too_long`, keyed on the attribute. It is also the `maxLength` of `AttributeValueWrite`’s string branch, which must admit the longest string any data type takes."},"source_identity_half_chars":{"type":"integer","const":128,"description":"Each of source_system and source_key."},"guest_name_chars":{"type":"integer","const":255,"description":"Characters in a guest’s `firstname` or `lastname`, on `POST /bookings` (`customer`) and `POST /customers` alike. A name is 1 to this many: an empty one is refused rather than read as a name you do not hold — omit the member instead."},"member_page_size":{"type":"integer","const":100,"description":"Drops to 25 with `include=attributes`."},"segment_count_cap":{"type":"integer","const":10000,"description":"Counts above this serve 10000 with `is_capped: true`."},"segment_count_staleness_seconds":{"type":"integer","const":60,"description":"How many seconds behind the data the count `GET /segments/{id}/count` serves may be. The response carries no timestamp, so treat every count as possibly this old."},"webhook_events_per_segment_per_run":{"type":"integer","const":10000,"description":"The most segment events one membership sample sends a subscription: a page of the segment’s membership changes in customer-id order, which shrinks to 50000 divided by the number of subscriptions when more than five cover the segment. Changes past the page wait for the next samples rather than being dropped, and an `emit_initial` backfill takes what the page leaves."},"booking_events_per_subscription_per_write":{"type":"integer","const":2000,"description":"How many `booking.*` events one database statement can enqueue for one subscription: past it the excess, all but the lowest booking ids, is dropped permanently, and the subscription’s `last_capped_at` records when. Only a statement changing many bookings at once reaches it, so reconcile with `GET /bookings` after a bulk change; see https://developer.ninetables.io/guides/webhooks/#large-writes-are-capped."},"customer_events_per_subscription_per_write":{"type":"integer","const":2000,"description":"How many `customer.*` events one database statement can enqueue for one subscription: past it the excess, all but the lowest customer ids, is dropped permanently, and the subscription’s `last_capped_at` records when. Only a statement changing many guests at once reaches it, so reconcile with `GET /customers` after a bulk change; see https://developer.ninetables.io/guides/webhooks/#large-writes-are-capped."},"default_rate_limit_per_min":{"type":"integer","const":120,"description":"Fixed window, per key. The key’s own configured limit overrides it — read that one from `rate_limit_per_min` on this same response."}},"required":["definitions_per_tenant","values_keys_per_request","categories_per_tenant","segments_per_tenant","webhook_subscriptions_per_tenant","options_per_select","option_value_chars","counter_groups_per_definition","counter_item_keys_per_group","counter_key_chars","multi_select_values_per_row","counter_keys_per_row","counter_ops_per_attribute_per_request","groups_per_segment","conditions_per_segment_group","filters_per_condition","list_filters","batch_items_per_request","request_body_bytes","idempotent_stored_response_bytes","idempotency_key_chars","text_value_chars","source_identity_half_chars","guest_name_chars","member_page_size","segment_count_cap","segment_count_staleness_seconds","webhook_events_per_segment_per_run","booking_events_per_subscription_per_write","customer_events_per_subscription_per_write","default_rate_limit_per_min"],"description":"Every enforced limit, each pinned with `const` to the value the database guards, and what `GET /me` returns as `limits`. A limit a JSON Schema can express is also the bound on its payload’s wire schema, so a generated client catches it, while the per-tenant counts, byte and time budgets, the rate limit and the webhook event caps are enforced at runtime only. See https://developer.ninetables.io/guides/rate-limits/#limits.","example":{"definitions_per_tenant":200,"values_keys_per_request":200,"categories_per_tenant":50,"segments_per_tenant":200,"webhook_subscriptions_per_tenant":10,"options_per_select":200,"option_value_chars":64,"counter_groups_per_definition":50,"counter_item_keys_per_group":200,"counter_key_chars":64,"multi_select_values_per_row":100,"counter_keys_per_row":500,"counter_ops_per_attribute_per_request":100,"groups_per_segment":10,"conditions_per_segment_group":20,"filters_per_condition":10,"list_filters":5,"batch_items_per_request":100,"request_body_bytes":1048576,"idempotent_stored_response_bytes":65536,"idempotency_key_chars":128,"text_value_chars":4096,"source_identity_half_chars":128,"guest_name_chars":255,"member_page_size":100,"segment_count_cap":10000,"segment_count_staleness_seconds":60,"webhook_events_per_segment_per_run":10000,"booking_events_per_subscription_per_write":2000,"customer_events_per_subscription_per_write":2000,"default_rate_limit_per_min":120}},"ProblemBody":{"type":"object","properties":{"type":{"anyOf":[{"$ref":"#/components/schemas/ProblemType"}],"description":"WHAT went wrong, from the closed `ProblemType` vocabulary, and the member to branch on rather than `status`, which several causes share. Compare it as a string; it is a nominal URI, never dereferenced."},"title":{"type":"string","description":"A short label fixed per `type` (\"Validation Failed\"), for logs and operator screens; never branch on it."},"status":{"type":"integer","description":"The HTTP status, repeated so a stored problem or a `/batch` item’s `problem` stays self-describing. Coarser than `type`, it is for the retry decision."},"detail":{"type":"string","description":"What went wrong this time, for a developer reading a log; never parse it. Absent where the `type` alone is the whole story."},"code":{"anyOf":[{"$ref":"#/components/schemas/ProblemCode"}],"description":"The SCREAMING_SNAKE spelling of the `type` slug (`VALIDATION_FAILED`), derived from `type` and never disagreeing with it."},"errors":{"type":"array","items":{"$ref":"#/components/schemas/FieldError"},"description":"On `validation-failed`: EVERY offending field, not just the first."},"blockers":{"type":"array","items":{"$ref":"#/components/schemas/ArchiveBlocker"},"description":"On `conflict-archive-blocked` and `conflict-definition-in-use`: every resource still referencing the one you tried to archive or switch off that your key may read. Archive or re-point these first."},"hidden_blockers":{"type":"integer","minimum":0,"description":"On `conflict-archive-blocked` and `conflict-definition-in-use`, always present: how many more resources still reference it that your key’s restaurant limit hides. They are never named, and the refusal stands until they are re-pointed or archived too."},"required_scope":{"anyOf":[{"$ref":"#/components/schemas/ApiScope"}],"description":"On `insufficient-scope`: the ONE scope missing where the request was refused, never the scopes your key holds (`GET /me` lists those). A key’s scopes are fixed at issue, so no retry changes it."},"resource":{"type":"string","enum":["customer","booking","segment","category","definition","webhook","delivery"],"description":"On `not-found`: which resource kind the route was looking for."},"drifted":{"type":"array","items":{"type":"string"},"description":"On `conflict-stale-write`: the attribute keys whose `updated_at` no longer matches the token you guarded on. Re-read exactly these and retry — the rest of your `values` map was never written, so there is nothing else to reconcile."},"conflicting_tables":{"type":"array","items":{"$ref":"#/components/schemas/TableConflict"},"description":"On `conflict-booking-overlap`: every table of your `table_ids` an existing booking holds across the window (`TableConflict`). Absent when the overlap was caught at the moment of writing, so test for presence and re-read the tables then."},"conflicting_id":{"type":"string","format":"uuid","description":"On `identity-already-assigned`: the id of the record that already holds the pair. Its data is never disclosed."},"pending_attributes":{"type":"array","items":{"type":"string"},"description":"On `segment-pending`: the keys of the computed attributes the segment’s rules read whose `compute_state` is `computing` or `failed`. Retry once they are `ready`; one may settle before the refusal names it, leaving this empty."},"retry_after":{"type":"integer","description":"On `rate-limited`: seconds to wait, mirroring the `Retry-After` header so a client that only parses JSON is not stranded."}},"required":["type","title","status","code"],"additionalProperties":{},"description":"RFC 9457 problem body (`application/problem+json`): dispatch on `type`, from the `ProblemType` vocabulary. The optional members are slug-specific extensions, absent where they do not apply. See https://developer.ninetables.io/guides/errors/#the-problem-body.","example":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"member_tier","code":"unknown_option","detail":"Unknown option 'platinum'"}]}},"ProblemType":{"type":"string","enum":["https://ninetables.io/problems/validation-failed","https://ninetables.io/problems/invalid-ref","https://ninetables.io/problems/unauthorized","https://ninetables.io/problems/insufficient-ai-credits","https://ninetables.io/problems/insufficient-scope","https://ninetables.io/problems/app-not-installed","https://ninetables.io/problems/tenant-wide-key-required","https://ninetables.io/problems/not-found","https://ninetables.io/problems/segment-archived","https://ninetables.io/problems/conflict-key-exists","https://ninetables.io/problems/conflict-archive-blocked","https://ninetables.io/problems/conflict-definition-in-use","https://ninetables.io/problems/conflict-reserved-key","https://ninetables.io/problems/conflict-category-archived","https://ninetables.io/problems/conflict-source-identity","https://ninetables.io/problems/conflict-secret-rotation","https://ninetables.io/problems/conflict-webhook-inactive","https://ninetables.io/problems/conflict-delivery-erased","https://ninetables.io/problems/conflict-stale-write","https://ninetables.io/problems/conflict-booking-overlap","https://ninetables.io/problems/concurrent-modification","https://ninetables.io/problems/identity-already-assigned","https://ninetables.io/problems/ambiguous-ref","https://ninetables.io/problems/segment-pending","https://ninetables.io/problems/loyalty-not-installed","https://ninetables.io/problems/idempotency-key-in-flight","https://ninetables.io/problems/idempotency-key-conflict","https://ninetables.io/problems/payload-too-large","https://ninetables.io/problems/rate-limited","https://ninetables.io/problems/method-not-allowed","https://ninetables.io/problems/unknown-endpoint","https://ninetables.io/problems/internal","https://ninetables.io/problems/upstream-unavailable"],"description":"Every `type` this API emits, `https://ninetables.io/problems/<slug>`: the closed member to dispatch on, which separates causes one HTTP status merges (`not-found`, `unknown-endpoint` and `segment-archived` are all 404). Statuses: validation-failed=400, invalid-ref=400, unauthorized=401, insufficient-ai-credits=402, insufficient-scope=403, app-not-installed=403, tenant-wide-key-required=403, not-found=404, segment-archived=404, conflict-key-exists=409, conflict-archive-blocked=409, conflict-definition-in-use=409, conflict-reserved-key=409, conflict-category-archived=409, conflict-source-identity=409, conflict-secret-rotation=409, conflict-webhook-inactive=409, conflict-delivery-erased=409, conflict-stale-write=409, conflict-booking-overlap=409, concurrent-modification=409, identity-already-assigned=409, ambiguous-ref=409, segment-pending=409, loyalty-not-installed=409, idempotency-key-in-flight=409, idempotency-key-conflict=422, payload-too-large=413, rate-limited=429, method-not-allowed=405, unknown-endpoint=404, internal=500, upstream-unavailable=502."},"ProblemCode":{"type":"string","enum":["VALIDATION_FAILED","INVALID_REF","UNAUTHORIZED","INSUFFICIENT_AI_CREDITS","INSUFFICIENT_SCOPE","APP_NOT_INSTALLED","TENANT_WIDE_KEY_REQUIRED","NOT_FOUND","SEGMENT_ARCHIVED","CONFLICT_KEY_EXISTS","CONFLICT_ARCHIVE_BLOCKED","CONFLICT_DEFINITION_IN_USE","CONFLICT_RESERVED_KEY","CONFLICT_CATEGORY_ARCHIVED","CONFLICT_SOURCE_IDENTITY","CONFLICT_SECRET_ROTATION","CONFLICT_WEBHOOK_INACTIVE","CONFLICT_DELIVERY_ERASED","CONFLICT_STALE_WRITE","CONFLICT_BOOKING_OVERLAP","CONCURRENT_MODIFICATION","IDENTITY_ALREADY_ASSIGNED","AMBIGUOUS_REF","SEGMENT_PENDING","LOYALTY_NOT_INSTALLED","IDEMPOTENCY_KEY_IN_FLIGHT","IDEMPOTENCY_KEY_CONFLICT","PAYLOAD_TOO_LARGE","RATE_LIMITED","METHOD_NOT_ALLOWED","UNKNOWN_ENDPOINT","INTERNAL","UPSTREAM_UNAVAILABLE"],"description":"The top-level `code`, always the SCREAMING_SNAKE of the `type` slug — a convenience restatement of `type`, never an independent vocabulary."},"FieldError":{"type":"object","properties":{"key":{"type":"string","description":"WHERE the failure is, as a name rather than a typed pointer: an attribute key, `(root)`, a dotted path into the body, a query-parameter name or a lower-cased request-header name. An unrecognized member keys on its container (`(root)`, `items.0`) with `detail` naming it, and no operation declares one name in two places. See https://developer.ninetables.io/guides/errors/#field-errors."},"code":{"anyOf":[{"$ref":"#/components/schemas/FieldErrorCode"}],"description":"WHAT is wrong at that `key`, from the closed `FieldErrorCode` vocabulary: the member to branch on, where `detail` beside it is the human half and is not parseable."},"detail":{"type":"string","description":"The specific failure at that `key`, in one sentence for a developer reading a log. Never parse it: its wording is not part of the contract, and what you can act on is in `key` and `code`."}},"required":["key","code","detail"],"description":"One thing wrong with a request: `key` says where, `code` says what and `detail` says it in prose. The `errors[]` of a `validation-failed` problem lists every offending field, in `values` order on an attribute write, while an `invalid-ref` carries none. See https://developer.ninetables.io/guides/errors/#field-errors.","example":{"key":"member_tier","code":"unknown_option","detail":"Unknown option 'platinum'"}},"FieldErrorCode":{"type":"string","enum":["schema_invalid","unknown_attribute","entity_mismatch","type_mismatch","op_not_supported","invalid_op","unknown_option","not_api_writable","attribute_archived","value_too_long","too_many_values","invalid_counter_entry","invalid_value","not_catalogue","reserved_key","computed_cap","computed_type_mismatch","system_locked"],"description":"Per-field `errors[].code` on a `validation-failed` problem and on a `/batch` item’s `problem`: the closed vocabulary a write path branches on, while the sibling `key` says where. See https://developer.ninetables.io/guides/errors/#field-error-codes."},"ArchiveBlocker":{"type":"object","properties":{"kind":{"type":"string","enum":["definition","segment"],"description":"How the blocker references what you archived: `definition` is a live definition still filed in the category, `segment` a live dynamic segment whose rules name the definition. Only `definition` appears when archiving a category, and only `segment` when archiving a definition."},"name":{"type":"string","description":"The definition key for `definition`, or the segment’s display name for `segment`, which `GET /segments` lists since this API has no name-to-id lookup."}},"required":["kind","name"],"description":"A live resource still referencing what an archive tried to archive, as the `blockers` array of a 409 `conflict-archive-blocked` lists it. The list names every one your key may read and `hidden_blockers` counts the rest, all of which must be re-pointed or archived to clear the refusal. See https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete.","example":{"kind":"segment","name":"Big spenders"}},"TableConflict":{"type":"object","properties":{"table_id":{"type":"string","format":"uuid","description":"The table that is taken — exactly the value you sent in `table_ids`, so a retry can drop it from the set without matching on anything else."},"table_name":{"type":"string","description":"What the venue calls that table on its floor plan (`7`, `Bar 2`), for a person to read. It is not an identifier, since names repeat across restaurants and change: address the table by `table_id`."}},"required":["table_id","table_name"],"description":"One table an existing booking already holds across the window you asked for, as the `conflicting_tables` of a 409 `conflict-booking-overlap` lists it; the whole write was refused. See https://developer.ninetables.io/guides/bookings/#a-reservation-does-not-need-a-table.","example":{"table_id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","table_name":"7"}},"Category":{"type":"object","properties":{"key":{"type":"string","description":"The tenant-unique identifier an `AttributeDefinition.category` names. Immutable, and kept reserved while the category is archived."},"label":{"type":"string","description":"The name the Nine Tables app shows for the section, 1 to 200 characters in the tenant’s own language. It carries no machine meaning, so it is the part to change."},"display_order":{"type":"integer","description":"Sort position among the tenant’s categories, ascending, with ties broken on `key`. Nothing ever re-numbers, so leave room (10, 20, 30)."},"is_system":{"type":"boolean","description":"`true` only on `system`, the category Nine Tables provisions for the built-in attributes. Its label cannot be changed and it cannot be archived."},"archived_at":{"type":["string","null"],"format":"date-time","description":"When the category was archived, or `null` while it is live. An archived category accepts no new definition; see https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete."},"created_at":{"type":"string","format":"date-time","description":"When the category was created. Server-assigned and never changes."},"updated_at":{"type":"string","format":"date-time","description":"When the category itself last changed, never moved by the definitions filed under it. Every accepted PATCH carrying a member moves it, even one re-sending the current value."}},"required":["key","label","display_order","is_system","archived_at","created_at","updated_at"],"description":"One display group for attribute definitions: the Nine Tables app renders a record’s attributes as one section per category, and a category grants no permission and namespaces nothing. See https://developer.ninetables.io/guides/writing-attributes/#categories.","example":{"key":"pos_data","label":"POS data","display_order":10,"is_system":false,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"}},"CategoryCreateBody":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","description":"Category key: lowercase snake_case, max 64 chars.","example":"pos_data"},"label":{"type":"string","minLength":1,"maxLength":200,"description":"The display name for the section, 1 to 200 characters. Unlike `key`, it can be changed later."},"display_order":{"type":"integer","minimum":0,"description":"Sort position among the tenant’s categories, ascending; any integer of 0 or more, defaulting to `0`. Nothing re-numbers for you, so space values out (10, 20, 30)."}},"required":["key","label"],"additionalProperties":false,"description":"The body of `POST /categories`: `key` and `label` are required, and the rest is defaulted or server-owned. `is_system` is always `false` on a category you create.","example":{"key":"pos_data","label":"POS data","display_order":10}},"CategoryPatchBody":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200,"description":"A new display name, 1 to 200 characters; a label can be replaced but never cleared. Refused on the built-in `system` category."},"display_order":{"type":"integer","minimum":0,"description":"A new sort position, any integer of 0 or more. Editable on every category, the built-in one included."},"archived":{"type":"boolean","description":"`true` archives the category and `false` restores it. The built-in `system` category cannot be archived."}},"additionalProperties":false,"description":"The body of `PATCH /categories/{key}`, applying only the members present. `key` has no member, because a category’s key is immutable.","example":{"label":"Point-of-sale data","display_order":20}},"AttributeDefinition":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/AttributeEntity"},"key":{"type":"string","description":"The identifier you write values under, unique per entity rather than globally. Immutable, and kept reserved while the definition is archived."},"label":{"type":"string","description":"The name the Nine Tables app shows for this attribute, 1 to 200 characters in the tenant’s own language. It carries no machine meaning, so hold on to `key` instead."},"description":{"type":["string","null"],"description":"Helper text for the staff who fill the attribute in, up to 2000 characters, or `null` when none was given. It affects no validation and no behaviour."},"category":{"type":"string","description":"The `key` of the `Category` this attribute is filed under, a display grouping and nothing more. It always names a category that exists, which is archived only while this definition is too."},"data_type":{"$ref":"#/components/schemas/AttributeDataType"},"options":{"description":"Type-specific configuration: `select` and `multi_select` take an array of `SelectOption`, a closed list the write path enforces that needs at least one entry at creation, `counter_list` takes a `CounterListOptions` of advisory groups, and every other type takes none (`type_mismatch`). Option values, group keys and item keys are append-only, so a `PATCH` sends the full list and may only add entries and edit labels. See https://developer.ninetables.io/guides/writing-attributes/#data-types.","oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"maxItems":200,"description":"select / multi_select. Values must be distinct."},{"$ref":"#/components/schemas/CounterListOptions"},{"type":"null"}]},"display_hint":{"type":["string","null"],"description":"How the Nine Tables app formats a `number`: `currency` (a major-unit amount), `percent` (a 0–100 scale), `duration_minutes`, or `null` for a plain one. Presentation only, constraining no value."},"display_order":{"type":"integer","description":"Sort position, ascending, with ties broken on `key`: the order of `GET /definitions` and of the attributes within each category section in the app."},"show_on_customer_card":{"type":"boolean","description":"Whether the Nine Tables app shows this `customer` attribute in the summary on a guest’s customer card. A display preference that changes nothing over this API."},"show_on_booking_panel":{"type":"boolean","description":"Whether the Nine Tables app shows this `booking` attribute on the panel staff work a booking from. A display preference that changes nothing over this API."},"ui_writable":{"type":"boolean","description":"Whether staff may edit this attribute in the Nine Tables app; it governs nothing on this API. Always `false` on a built-in and on a `counter_list`."},"api_writable":{"type":"boolean","description":"Whether a value for this attribute may be written over THIS API, where `false` refuses every write `not_api_writable`. Always `false` on a built-in."},"source":{"type":"string","description":"`tenant` for a definition you created, or `system` for a computed built-in whose meaning belongs to Nine Tables. On a built-in only where it appears is yours to change; see https://developer.ninetables.io/guides/writing-attributes/#system-attributes-are-computed."},"enabled":{"type":"boolean","description":"Whether the attribute is in use: always `true` on a definition you created, and on a `system` built-in whether it is switched on, which `PATCH /definitions/{entity}/{key}` with `enabled` changes. A built-in that is off is not computed and has no values."},"computed":{"anyOf":[{"$ref":"#/components/schemas/ComputedAttribute"},{"type":"null"}],"description":"On an attribute whose values the platform computes from bookings, its rule and where computing stands (`ComputedAttribute`), on a built-in that is off too. `null` on an attribute whose values are entered; see https://developer.ninetables.io/guides/computed-attributes/#rules."},"compute_state":{"anyOf":[{"$ref":"#/components/schemas/ComputeState"},{"type":"null"}],"description":"On a computed attribute that is in use, where computing its values stands (`ComputeState`), the same as `computed.state`: `computing` right after it was switched on or its rule changed, until every guest holds a value. `null` on an attribute whose values are entered, and on a built-in that is off."},"archived_at":{"type":["string","null"],"format":"date-time","description":"When the definition was archived, or `null` while it is live. An archived definition keeps its values and refuses writes; see https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete."},"created_at":{"type":"string","format":"date-time","description":"When the definition was created. Server-assigned and never changes."},"updated_at":{"type":"string","format":"date-time","description":"When the definition itself last changed, never moved by the values written against it: every accepted PATCH carrying a member moves it, even one re-sending the current value, except one carrying only a `computed` member that means the stored rule, which changes nothing. A computed definition’s also moves with its computation, with no request of yours: when one starts, as its `computed.progress` or `computed.error` is recorded, and when it settles `ready` or `failed`. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute."}},"required":["entity","key","label","description","category","data_type","display_hint","display_order","show_on_customer_card","show_on_booking_panel","ui_writable","api_writable","source","enabled","computed","compute_state","archived_at","created_at","updated_at"],"description":"The schema of one custom field on a customer or a booking, which must exist before any value for it can be written: its identity, its value contract, where the app shows it and who may write it. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","example":{"entity":"customer","key":"lifetime_spend","label":"Lifetime spend","description":"Total spend across all completed bookings.","category":"pos_data","data_type":"number","options":null,"display_hint":"currency","display_order":10,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":true,"source":"tenant","enabled":true,"computed":null,"compute_state":null,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"}},"AttributeEntity":{"type":"string","enum":["customer","booking"],"description":"Which kind of record an attribute is attached to, a guest (`customer`) or a single visit (`booking`), each a separate namespace of keys fixed at creation. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","example":"customer"},"AttributeDataType":{"type":"string","enum":["text","number","boolean","date","datetime","select","multi_select","counter_list"],"description":"What kind of value an attribute holds, which fixes the JSON shape of every write to it and whether it takes `options`. It is immutable, so a wrong choice is a new definition; see https://developer.ninetables.io/guides/writing-attributes/#data-types.","example":"number"},"ComputedAttribute":{"allOf":[{"$ref":"#/components/schemas/ComputedRule"},{"type":"object","properties":{"state":{"anyOf":[{"$ref":"#/components/schemas/ComputeState"},{"type":"null"}],"description":"Where computing the values stands (`ComputeState`), always equal to the definition’s `compute_state`. `null` on a built-in that is off, which computes nothing."},"progress":{"anyOf":[{"$ref":"#/components/schemas/ComputedProgress"},{"type":"null"}],"description":"How far the running computation has come (`ComputedProgress`), present only while `state` is `computing`. `null` in every other state."},"computed_at":{"type":["string","null"],"format":"date-time","description":"When the last computation finished and `state` became `ready`, or `null` while none has. Values move after it as bookings change, without moving it."},"error":{"type":["string","null"],"description":"Why computing last failed, while `state` is `failed` or a retry is running after a failure. `null` once a computation succeeds."}},"required":["state","progress","computed_at","error"],"additionalProperties":{}}],"description":"A computed attribute’s rule and where computing its values stands, on every definition whose values the platform derives from bookings. See https://developer.ninetables.io/guides/computed-attributes/#rules.","additionalProperties":{},"example":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]},"state":"computing","progress":{"processed":1200,"total":4800},"computed_at":null,"error":null}},"ComputeState":{"type":"string","enum":["computing","ready","failed"],"description":"Where a computed attribute stands: `computing` while the platform fills in its values (after it was switched on or its rule changed), `ready` once every guest holds a current value, or `failed` when computing it kept failing."},"ComputedProgress":{"type":"object","properties":{"processed":{"type":"integer","minimum":0,"description":"How many guests have been computed so far in this run, never more than `total`."},"total":{"type":"integer","minimum":0,"description":"How many guests the run set out to compute, counted when it started."}},"required":["processed","total"],"additionalProperties":false,"description":"How far a running computation has come: the guests computed so far out of those it set out to compute. See https://developer.ninetables.io/guides/computed-attributes/#recompute.","example":{"processed":1200,"total":4800}},"ComputedRule":{"type":"object","properties":{"operation":{"type":"string","enum":["count","distinct_restaurants","sum","avg","max","min","first","latest","share","typical_interval_days","lifecycle_stage","loyalty_member","loyalty_tier","loyalty_visits_period","loyalty_member_since","loyalty_joined_via","loyalty_join_source"],"description":"How the matching bookings become one value: a `count`, the `distinct_restaurants` visited, an aggregate of `measure`, the `first` or `latest` start time, or the `share` of decided bookings in the status class. `typical_interval_days`, `lifecycle_stage` and the loyalty club’s `loyalty_member`, `loyalty_tier`, `loyalty_visits_period`, `loyalty_member_since`, `loyalty_joined_via` and `loyalty_join_source` appear only on Nine Tables attributes; the loyalty ones read the guest’s membership, not bookings."},"measure":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["guest_count"]}},"required":["field"],"additionalProperties":false},{"type":"object","properties":{"attribute_key":{"type":"string"}},"required":["attribute_key"],"additionalProperties":false},{"type":"null"}],"description":"What `sum`, `avg`, `max` and `min` aggregate, which they require: the party size (`{\"field\": \"guest_count\"}`) or a live `number` booking attribute (`{\"attribute_key\": …}`). `null` or absent on every other operation."},"bookings":{"type":"object","properties":{"status_class":{"type":["string","null"],"enum":["completed","no_show","cancelled","upcoming",null],"description":"Which bookings count by outcome, or `null` (or absent) for every status. A `share` takes `completed`, `no_show` or `cancelled`, the decided bookings it divides by."},"window":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["all_time"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["last_days"]},"days":{"type":"integer","minimum":1,"maximum":36500}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["next_days"]},"days":{"type":"integer","minimum":1,"maximum":36500}},"required":["type","days"],"additionalProperties":false}],"description":"Which bookings count by start time, as a segment’s booking window reads it: all of them, or those in the last or next `days` days. Upcoming bookings take no `last_days` window."},"filters":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"field":{"type":"string","enum":["restaurant_id"]},"operator":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1}},"required":["field","operator","value"],"additionalProperties":false},{"type":"object","properties":{"field":{"type":"string","enum":["guest_count"]},"operator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte"]},"value":{"type":"integer","minimum":1,"maximum":1000}},"required":["field","operator","value"],"additionalProperties":false},{"type":"object","properties":{"field":{"type":"string","enum":["guest_count"]},"operator":{"type":"string","enum":["between"]},"value":{"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}},"required":["field","operator","value"],"additionalProperties":false},{"type":"object","properties":{"attribute_key":{"type":"string"},"operator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","between","in","not_in","is_set","is_not_set"]},"value":{}},"required":["attribute_key","operator"],"additionalProperties":false}],"description":"One narrowing of which bookings count: the tenant’s own restaurants (`in`), a party size from 1 to 1000, or a live booking attribute under the operators its `data_type` takes in a segment (`SegmentBookingFilter`)."},"maxItems":10,"description":"At most 10 narrowings, AND-ed with each other and with `window`. Omitted or empty, every booking in the window counts."}},"required":["window"],"additionalProperties":false,"description":"Which of the guest’s bookings the rule reads: a status class, a window and filters, all AND-ed."}},"required":["operation","bookings"],"additionalProperties":{},"description":"How a computed attribute’s value is derived from each guest’s bookings: which bookings count and the one operation that turns them into a value. A write naming a member the rule does not have is refused; see https://developer.ninetables.io/guides/computed-attributes/#rules.","example":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]}}},"DefinitionCreateBody":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/AttributeEntity"},"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","example":"lifetime_spend"},"label":{"type":"string","minLength":1,"maxLength":200,"description":"The display name staff see, 1 to 200 characters. It carries no machine meaning, so it is free to change later."},"category":{"type":"string","minLength":1,"maxLength":64,"description":"The `key` of an existing, live `Category` to file the attribute under, a display grouping and nothing more. There is no default and no auto-create, so create it with `POST /categories` first."},"data_type":{"$ref":"#/components/schemas/AttributeDataType"},"computed":{"anyOf":[{"$ref":"#/components/schemas/ComputedRule"}],"description":"A rule (`ComputedRule`) that makes this a computed `customer` attribute, whose values the platform derives from each guest’s bookings and fills in after the 202. The rule decides `data_type`, `display_hint` and `options`, so the body leaves them out, and neither flag can be `true`."},"description":{"type":"string","maxLength":2000,"description":"Helper text for the staff who fill the attribute in, up to 2000 characters, affecting no validation. Omit it for `description: null`."},"options":{"description":"Type-specific configuration: `select` and `multi_select` take an array of `SelectOption`, a closed list the write path enforces that needs at least one entry at creation, `counter_list` takes a `CounterListOptions` of advisory groups, and every other type takes none (`type_mismatch`). Option values, group keys and item keys are append-only, so a `PATCH` sends the full list and may only add entries and edit labels. See https://developer.ninetables.io/guides/writing-attributes/#data-types.","oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"maxItems":200,"description":"select / multi_select. Values must be distinct."},{"$ref":"#/components/schemas/CounterListOptions"},{"type":"null"}]},"display_hint":{"type":["string","null"],"enum":["currency","percent","duration_minutes",null],"description":"How the Nine Tables app formats a `number`: `currency` (a major-unit amount), `percent` (a 0–100 scale) or `duration_minutes`. Omit it, or send `null`, for a plain number; it changes nothing about which values are accepted."},"display_order":{"type":"integer","minimum":0,"description":"Sort position, ascending; any integer of 0 or more, defaulting to `0`. Nothing re-numbers for you, so space values out (10, 20, 30)."},"show_on_customer_card":{"type":"boolean","description":"Whether the Nine Tables app shows this `customer` attribute in the summary on a guest’s customer card, defaulting to `false`. Display only."},"show_on_booking_panel":{"type":"boolean","description":"Whether the Nine Tables app shows this `booking` attribute on the booking panel, defaulting to `false`. Display only."},"ui_writable":{"type":"boolean","description":"Whether staff may edit this attribute in the Nine Tables app; it governs nothing on this API. Defaults to `true`, except on a `counter_list`, which defaults to `false` and refuses `true`."},"api_writable":{"type":"boolean","description":"Whether values may be written over THIS API, defaulting to `true`. Send `false` for an attribute the app maintains and your integration only reads."}},"required":["entity","key","label","category"],"additionalProperties":false,"description":"The body of `POST /definitions`: `entity`, `key`, `label` and `category` are required, `data_type` too unless `computed` carries a rule, and every other member has a server-side default. The schema states that `options` belongs only to a `select`, `multi_select` or `counter_list`, and that a rule belongs to a `customer` definition without the members it decides, so a generated client can catch either mistake without a round trip.","example":{"entity":"booking","key":"spend","label":"Spend","category":"pos_data","data_type":"number","display_hint":"currency","show_on_booking_panel":true},"dependentSchemas":{"options":{"anyOf":[{"properties":{"options":{"type":"null"}}},{"properties":{"data_type":{"enum":["select","multi_select","counter_list"]}}}]},"computed":{"properties":{"entity":{"const":"customer"}},"not":{"anyOf":[{"required":["data_type"]},{"required":["display_hint"]},{"required":["options"]}]}}}},"DefinitionProposal":{"type":"object","properties":{"kind":{"type":"string","enum":["computed","catalogue","entered"],"description":"What the description turned into: a rule over bookings (`computed`), a Nine Tables built-in to switch on (`catalogue`) or an attribute your team fills in (`entered`). The member of the same name carries the rest."},"sentence":{"type":"string","description":"One plain sentence, in the language of the description, saying what would be tracked for each guest. A suggestion for the definition’s `label` or `description`."},"computed":{"type":"object","properties":{"rule":{"anyOf":[{"$ref":"#/components/schemas/ComputedRule"}],"description":"The rule (`ComputedRule`) the platform validated, ready to send as `computed` on `POST /definitions` as it stands or adjusted."},"data_type":{"anyOf":[{"$ref":"#/components/schemas/AttributeDataType"}],"description":"What the rule computes (`AttributeDataType`), which the definition it creates carries."},"display_hint":{"type":["string","null"],"description":"How the app formats the value, lent by a measured booking attribute, or `null` for a plain value."},"coverage":{"type":["object","null"],"properties":{"matching":{"type":"integer","minimum":0,"description":"How many guests the rule finds something for today; a `count` of 0 does not match."},"total":{"type":"integer","minimum":0,"description":"How many live guests the tenant has, the denominator of `matching`."}},"required":["matching","total"],"description":"How many of the tenant’s guests the rule describes, measured on their bookings now and never stored. `null` when measuring took too long, which leaves `examples` empty while the rule stays valid."},"examples":{"type":"array","items":{"type":"object","properties":{"customer":{"anyOf":[{"$ref":"#/components/schemas/CustomerSummary"}],"description":"The guest (`CustomerSummary`), whose contact members appear only when the key holds `contacts:read`."},"value":{"description":"The value the rule computes for this guest today, shaped by `data_type`."}},"required":["customer"]},"maxItems":3,"description":"The matching guests holding the lowest, the median and the highest value the rule finds, in that order, a tie broken by guest id; fewer when fewer than three guests match. Listed only for a key that also holds `customers:read` and `attributes:read`; otherwise `[]`."}},"required":["rule","data_type","display_hint","coverage","examples"],"description":"On a `computed` proposal: the rule, what it computes and how it reads on the tenant’s guests today. Absent on the other kinds."},"catalogue":{"type":"object","properties":{"key":{"type":"string","description":"The built-in’s key, its `customer` definition’s `{key}`."},"name":{"type":"string","description":"The built-in’s label."},"enabled":{"type":"boolean","description":"Whether the tenant already has it switched on; when `false`, `PATCH /definitions/customer/{key}` with `{\"enabled\": true}` does."}},"required":["key","name","enabled"],"description":"On a `catalogue` proposal: the built-in that already answers the description, which is switched on rather than created. Absent on the other kinds."},"entered":{"type":"object","properties":{"data_type":{"anyOf":[{"$ref":"#/components/schemas/AttributeDataType"}],"description":"The `AttributeDataType` to create the definition with."},"display_hint":{"type":["string","null"],"enum":["currency","percent","duration_minutes",null],"description":"How the app would format a `number`, or `null`."},"options":{"description":"Type-specific configuration: `select` and `multi_select` take an array of `SelectOption`, a closed list the write path enforces that needs at least one entry at creation, `counter_list` takes a `CounterListOptions` of advisory groups, and every other type takes none (`type_mismatch`). Option values, group keys and item keys are append-only, so a `PATCH` sends the full list and may only add entries and edit labels. See https://developer.ninetables.io/guides/writing-attributes/#data-types.","oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"maxItems":200,"description":"select / multi_select. Values must be distinct."},{"$ref":"#/components/schemas/CounterListOptions"},{"type":"null"}]}},"required":["data_type","display_hint"],"description":"On an `entered` proposal: the type members of the definition to create. Absent on the other kinds."}},"required":["kind","sentence"],"description":"What a description of something to know about guests turns into, created nowhere: a validated rule with its coverage, a built-in to switch on, or an entered attribute's type. See https://developer.ninetables.io/guides/computed-attributes/#proposals.","example":{"kind":"computed","sentence":"I’ll track how many times each guest has dined at Oslo in the last 12 months.","computed":{"rule":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]}},"data_type":"number","display_hint":null,"coverage":{"matching":1830,"total":4800},"examples":[{"customer":{"id":"0198a5b0-7c00-7a10-8b20-000000000003","source_system":null,"source_key":null,"created_at":"2026-05-27T19:41:37.811000Z"},"value":1},{"customer":{"id":"0198a5b0-7c00-7a10-8b20-000000000002","source_system":null,"source_key":null,"created_at":"2026-03-02T12:05:10.004000Z"},"value":2},{"customer":{"id":"0198a5b0-7c00-7a10-8b20-000000000001","source_system":null,"source_key":null,"created_at":"2026-02-11T18:20:44.120000Z"},"value":6}]}}},"CustomerSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The customer’s Nine Tables id, a `{customerRef}` that always works on the customer routes, assigned by the platform and stable for the life of the record."},"source_system":{"type":["string","null"],"description":"The system you named — in a path ref, a resolve criterion or `?source_system=` — lower-cased, when this customer holds a key from it. Only that system’s key is ever shown; null when you named none or it holds no key from yours."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this customer, verbatim, and null exactly when `source_system` is. A key held by a guest later merged into this one shows here."},"created_at":{"type":"string","format":"date-time","description":"When Nine Tables first recorded the guest, which never changes. A guest an import brought in carries the time of the import, not of an earlier visit."},"firstname":{"type":["string","null"],"description":"Present only when the key holds `contacts:read`. The guest’s given name, read-only on this API and nullable."},"lastname":{"type":["string","null"],"description":"Present only when the key holds `contacts:read`. The guest’s family name, read-only on this API and nullable."},"email":{"type":["string","null"],"description":"Present only when the key holds `contacts:read`. The guest’s email as stored, read-only and null when the record has none."},"phone":{"type":["string","null"],"description":"Present only when the key holds `contacts:read`. The guest’s phone in E.164, the form `resolve` normalises a `phone` criterion to, read-only and null when the record has none."},"marketing_consent":{"anyOf":[{"$ref":"#/components/schemas/MarketingConsent"},{"type":"null"}],"description":"Present only when the key holds `contacts:read`. The guest’s current marketing consent, or null when they have given none or withdrawn it."}},"required":["id","source_system","source_key","created_at"],"description":"A customer. `source_system`/`source_key` are the key the customer holds for the system you named yourself — in the path ref, in a resolve criterion or in `?source_system=` — and null otherwise, so another integration’s identifier is never handed to you as though it were your own."},"DefinitionProposalBody":{"type":"object","properties":{"description":{"type":"string","minLength":3,"maxLength":500,"description":"What you want to know about your guests, in your own words and any language, 3 to 500 characters once trimmed. A vague one still gets a proposal, built on its most likely reading."}},"required":["description"],"additionalProperties":false,"description":"The body of `POST /definitions/proposals`: the description alone, since the tenant’s restaurants, booking attributes and the catalogue are read server-side.","example":{"description":"How often each guest has eaten at Oslo this past year"}},"DefinitionPatchBody":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200,"description":"A new display name, 1 to 200 characters; a label can be replaced but never cleared. Refused on a `source: \"system\"` built-in."},"description":{"type":["string","null"],"maxLength":2000,"description":"New helper text, up to 2000 characters, or `null` to clear it, where omitting the member leaves it. Refused on a `source: \"system\"` built-in."},"category":{"type":"string","minLength":1,"maxLength":64,"description":"The `key` of an existing `Category` to move the attribute into, which must not be archived while the definition is live. A `source: \"system\"` built-in may move too while it is switched on; a switched-off one stays in the `system` category."},"options":{"description":"The FULL options value, not a delta — send the existing entries plus the new ones. Additions and label edits only (dropping an option value, a group key or an item key is rejected), and refused on a computed attribute, whose rule decides it.","oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"maxItems":200,"description":"select / multi_select. Values must be distinct."},{"$ref":"#/components/schemas/CounterListOptions"},{"type":"null"}]},"display_hint":{"type":["string","null"],"enum":["currency","percent","duration_minutes",null],"description":"A new number-formatting hint, or `null` for a plain number. Presentation only, and refused on a `source: \"system\"` built-in and on a computed attribute, whose rule decides it."},"display_order":{"type":"integer","minimum":0,"description":"A new sort position, any integer of 0 or more. Editable on every definition, built-ins included."},"show_on_customer_card":{"type":"boolean","description":"Whether the Nine Tables app shows this `customer` attribute in the summary on a guest’s customer card. Editable on every definition, built-ins included."},"show_on_booking_panel":{"type":"boolean","description":"Whether the Nine Tables app shows this `booking` attribute on the booking panel. Editable on every definition, built-ins included."},"ui_writable":{"type":"boolean","description":"Whether staff may edit this attribute in the Nine Tables app; it governs nothing on this API. `true` is refused on a built-in and on a `counter_list`."},"api_writable":{"type":"boolean","description":"Whether values may be written over THIS API: `false` refuses later writes `not_api_writable`, and `true` reopens them. `true` is refused on a built-in."},"archived":{"type":"boolean","description":"`true` archives the definition and `false` restores it, keeping its stored values either way. A built-in cannot be archived."},"enabled":{"type":"boolean","description":"On a `source: \"system\"` built-in only: `true` switches it on, and the platform starts computing its values for every guest (`compute_state: \"computing\"`, answered 202); `false` switches it off, its values go and it returns to the `system` category, where switching it on again leaves it. Sent alone, and refused on your own definitions (`not_catalogue`), which are always in use, and, for `false`, while a dynamic segment reads the attribute (`conflict-definition-in-use`)."},"computed":{"anyOf":[{"$ref":"#/components/schemas/ComputedRule"}],"description":"A new rule (`ComputedRule`) for a computed attribute of your own, whose values the platform then recomputes for every guest (answered 202 while the attribute is live; a rule meaning the same as the stored one changes nothing and is answered 200). Its result must keep the `data_type` (`computed_type_mismatch`), it decides `display_hint` and `options`, and a built-in (`system_locked`) or an entered definition refuses it."}},"additionalProperties":false,"description":"The body of `PATCH /definitions/{entity}/{key}`, applying only the members present; `entity`, `key` and `data_type` are immutable and have no member. A built-in refuses `label`, `description`, `options`, `display_hint`, `computed`, `archived: true` and a `true` writability flag, and only a built-in takes `enabled`.","example":{"label":"Lifetime spend (NOK)","display_order":20,"show_on_customer_card":true}},"CustomersPage":{"allOf":[{"$ref":"#/components/schemas/PaginationEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/CustomerListRow"},{"$ref":"#/components/schemas/RecordTombstone"}]}}}}],"description":"One page of customers: by customer id ascending, with `sort` by that attribute and then id, or with `updated_since` by `changed_at` and then id, tombstones included.","example":{"data":[],"next_cursor":null,"has_more":false}},"CustomerListRow":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The Nine Tables customer id. Stable, and a valid `{customerRef}` for every customer route — this is how to address a customer whose source identity is absent or withheld."},"source_system":{"type":["string","null"],"description":"The system you named in `?source_system=`, lower-cased, when this customer holds a key from it, and null otherwise. A customer holds at most one key per system, and only yours is ever shown."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this customer, verbatim — it is never case-folded. Null exactly when `source_system` is."},"created_at":{"type":"string","format":"date-time","description":"When Nine Tables first recorded the guest, which never changes. A guest an import brought in carries the time of the import, not of an earlier visit."},"firstname":{"type":["string","null"],"description":"Present only with `include=contact`, which additionally requires the `contacts:read` scope."},"lastname":{"type":["string","null"],"description":"Present only with `include=contact` (which additionally requires `contacts:read`). Null when the customer has no surname on file."},"email":{"type":["string","null"],"description":"Present only with `include=contact`, which additionally requires the `contacts:read` scope."},"phone":{"type":["string","null"],"description":"Present only with `include=contact` (which additionally requires `contacts:read`). The stored number, which `POST /customers/resolve` matches after normalising your criterion to the same international form (a leading `+` and digits)."},"marketing_consent":{"anyOf":[{"$ref":"#/components/schemas/MarketingConsent"},{"type":"null"}],"description":"Present only with `include=contact`, which additionally requires `contacts:read`. The guest’s current marketing consent, or null when they have given none or withdrawn it."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"}],"description":"Present only with `include=attributes`, which additionally requires `attributes:read` and caps the page at 25 rows. The customer’s attribute values keyed by definition key, each with its own `updated_at` and `source`."},"deleted_at":{"type":["string","null"],"format":"date-time","description":"When the record was moved to the trash, or null for a live one; present only with `updated_since`, which returns trashed records as themselves while id order hides them. A record that comes back out of the trash appears again with this null."},"changed_at":{"type":"string","format":"date-time","description":"When the record last changed, as the change feed stamped it: the time of the write’s own statement, not of its commit. Present only with `updated_since`, whose page is ordered by this member, then by `id`."}},"required":["id","source_system","source_key","created_at"],"description":"One customer in `GET /customers`, carrying exactly what the request asked for: identity and `created_at` by default, contact members and marketing consent with `include=contact`, the attribute value set with `include=attributes`. A member you did not ask for is ABSENT rather than null, so test for presence and not for a null value.","example":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z"}},"ValuesEchoRecord":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AttributeValueEcho"},"description":"A record’s attribute values keyed by attribute key, each an `AttributeValueEcho`, as every value read and successful write returns them; `{}` when none is set. Values of archived definitions are left out unless the route takes `include_archived=true`. See https://developer.ninetables.io/guides/writing-attributes/#reading-values.","example":{"company_name":{"value":"Acme AS","updated_at":"2026-08-19T17:02:27.273000Z","source":"api"},"total_visits":{"value":12,"updated_at":"2026-08-19T17:02:02.854000Z","source":"system"}}},"AttributeValueEcho":{"type":"object","properties":{"value":{"description":"The stored value, shaped by the attribute’s `data_type` (an array of `CounterEntry` for a counter_list), and never an op object, which is write-only. `null` where a row exists with no value, or on a computed attribute whose `state` is `computing` or `failed` before this record has a value; a never-set attribute has no key at all.","anyOf":[{"type":"null"},{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"$ref":"#/components/schemas/CounterEntry"}}]},"updated_at":{"type":["string","null"],"description":"When this value last changed, per attribute, unmoved by a write that leaves the value as it was; for a computed value, when the platform last computed it. RFC 3339 with a six-digit fraction, `null` only beside a computed value not computed yet, and also the concurrency token: copy it verbatim into `ExpectRecord` as the string you read, not as a parsed datetime, which can drop the microseconds the comparison uses. See https://developer.ninetables.io/guides/writing-attributes/#guard-a-write-on-the-value-you-read."},"source":{"anyOf":[{"$ref":"#/components/schemas/AttributeValueSource"}],"description":"Which channel last changed this value (`AttributeValueSource`), unchanged by a write that leaves the value as it was. Whether you may write is the definition’s `api_writable`, not this member."},"state":{"anyOf":[{"$ref":"#/components/schemas/ComputeState"}],"description":"On a computed value read from a record (`ComputeState`): whether the platform is still computing the attribute. Absent on an entered value and on a write echo."}},"required":["updated_at","source"],"description":"One attribute’s value as the server holds it, with when and by whom it last changed, as every value read and successful write returns it. A never-set attribute has no entry at all. See https://developer.ninetables.io/guides/writing-attributes/#reading-values.","example":{"value":"Acme AS","updated_at":"2026-08-19T17:02:27.273000Z","source":"api"}},"AttributeValueSource":{"type":"string","enum":["api","app","system","computed"],"description":"Which channel last changed the value: `api` (this API), `app` (a person in the Nine Tables app), `system` (the platform, including every built-in computed attribute) or `computed` (computed by the platform from a rule the restaurant defined). A `system` or `computed` value is never writable here (`not_api_writable`), while an `app` one is whenever its definition is `api_writable`."},"RecordTombstone":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The Nine Tables id of the record that is gone, and the only identity a tombstone carries: the record’s source identity went with it. A consumer that keys its records by its own `source_key` keeps this id beside it, so a tombstone can still be matched."},"removed":{"type":"boolean","enum":[true],"description":"Always true, and present only on a tombstone: test for it before reading an item as a record."},"reason":{"type":"string","enum":["erased","deleted"],"description":"Why the record is gone, in the vocabulary of `customer.deleted`: `erased` when a data-protection erasure anonymised it — delete everything you hold about it — and `deleted` when it was deleted outright. A record moved to the trash is not a tombstone: it is returned as itself, with `deleted_at` set."},"changed_at":{"type":"string","format":"date-time","description":"When the record was erased or deleted, as the change feed stamped it."}},"required":["id","removed","reason","changed_at"],"description":"A record an `updated_since` page reports as gone, at the position the record itself would hold: erased for a data-protection erasure, or deleted outright. Never returned in id order, which simply omits such records.","examples":[{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e0e5","removed":true,"reason":"erased","changed_at":"2026-10-16T08:12:44.120511Z"},{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4ed1","removed":true,"reason":"deleted","changed_at":"2026-10-16T09:40:03.004217Z"}]},"PaginationEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{},"description":"This page’s rows in the route’s own order, narrowed by each concrete page to its row type. It may hold fewer rows than `limit`, even none, while `has_more` is true, so `has_more` alone is the stopping condition."},"next_cursor":{"type":["string","null"],"description":"Opaque — pass back verbatim as `cursor`. null = last page."},"has_more":{"type":"boolean","description":"Whether a further page exists, exact rather than estimated: keep passing `next_cursor` back as `cursor` while it is true. The envelope carries no total."}},"required":["data","next_cursor","has_more"],"description":"Shared cursor-pagination envelope. Concrete pages narrow `data` to their row type; `next_cursor` and `has_more` mean the same thing on every paginated route.","example":{"data":[],"next_cursor":null,"has_more":false}},"EntityRef":{"type":"string","minLength":1,"maxLength":257,"pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|[A-Za-z0-9._~-]{1,128}:[A-Za-z0-9._~-]{1,128})$","description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","examples":["0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","pos_x:cust-889"]},"AttributesPatchBody":{"type":"object","properties":{"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesRecord"}],"description":"The attributes to write on this entity, as `ValuesRecord` describes; required, and `{}` writes nothing."},"expect":{"anyOf":[{"$ref":"#/components/schemas/ExpectRecord"}],"description":"Optional guard on the `updated_at` tokens you read (`ExpectRecord`); omit it for last-write-wins. Its keys and those of `values` are independent, so guard only the keys you are reconciling."}},"required":["values"],"additionalProperties":false,"description":"The body of `PATCH /customers/{customerRef}/attributes` and `PATCH /bookings/{bookingRef}/attributes`: the values to write and, optionally, the tokens they are conditional on, succeeding or failing whole. A success echoes the entity’s full value set when the key holds `attributes:read`, and only the keys sent otherwise. See https://developer.ninetables.io/guides/writing-attributes/.","example":{"values":{"birthdate":"1988-04-12","company_name":"Acme AS","member_tier":"gold","consent_flags":{"op":"add","values":["ads"]},"items_purchased":{"ops":[{"op":"increment","key":"margherita","by":2,"at":"2026-08-18T19:22:00Z"},{"op":"increment","key":"tiramisu"}]},"old_field":null},"expect":{"member_tier":"2026-09-01T10:00:00+00:00"}}},"ValuesRecord":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AttributeValueWrite"},"maxProperties":200,"description":"Attribute key → new value, merged: a key you leave out keeps its value and `null` clears one, each key resolved against the definitions of the entity written (`entity_mismatch` for the other entity’s). The map is atomic, one refused key writing nothing, and `errors[]` names every offending key in the order sent. See https://developer.ninetables.io/guides/writing-attributes/.","example":{"member_tier":"gold","consent_flags":{"op":"add","values":["ads"]}}},"AttributeValueWrite":{"description":"The new value: `null` clears it, a scalar or a full-replace array sets it, and `{op,…}` or `{ops:[…]}` mutates it atomically, each attribute accepting the forms of its `data_type`. A form it does not accept answers a `FieldErrorCode` keyed on the attribute (`type_mismatch`, `op_not_supported`, `invalid_op` or `unknown_option`). See https://developer.ninetables.io/guides/writing-attributes/.","anyOf":[{"type":"null"},{"type":"string","maxLength":4096},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":100},{"$ref":"#/components/schemas/MultiSelectOp"},{"type":"array","items":{"$ref":"#/components/schemas/CounterEntry"},"maxItems":500},{"$ref":"#/components/schemas/CounterOp"},{"$ref":"#/components/schemas/CounterOpBatch"}]},"ExpectRecord":{"type":"object","additionalProperties":{"type":"string"},"maxProperties":200,"description":"Attribute key → the `updated_at` token last read for it (`\"\"` for never set): a listed key whose value has changed since refuses the whole PATCH with 409 `conflict-stale-write`, while unlisted keys write unconditionally. A write re-sending the stored value does not move `updated_at`, so a token survives it. See https://developer.ninetables.io/guides/writing-attributes/#guard-a-write-on-the-value-you-read."},"GuestMatchReason":{"type":"string","enum":["new","source_key","source_key_alias","phone_email","phone_email_name","phone_name","email_name","phone_name_partial","email_name_partial","phone_alias_name","email_alias_name","phone","email","conflict"],"description":"On what evidence a guest was recognised, or why a new one was made; none of these values means the guest’s profile was overwritten. Each is explained at https://developer.ninetables.io/guides/bookings/#which-guest-and-why."},"CustomerCreateBody":{"type":"object","properties":{"firstname":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\S","description":"The guest’s first name, stored as you send it. It decides BETWEEN the profiles an email or phone reached, and a name contradicting a reached profile’s creates a separate guest rather than overwriting that person.","example":"Kari"},"lastname":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\S","description":"The guest’s surname, read exactly as `firstname` is. A component you omit is silent — it never counts as a difference.","example":"Nordmann"},"email":{"type":"string","maxLength":255,"format":"email","description":"The guest’s email address, matched case-insensitively and whole; one of `email` and `phone` is required. Sending both makes the match stronger rather than wider: either channel can reach the profile, and an agreeing name then confirms it.","example":"kari@example.com"},"phone":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[\\s\\u00A0\\u202F().-]*(?:\\+|0[\\s\\u00A0\\u202F().-]*0)[\\s\\u00A0\\u202F().-]*[1-9](?:[\\s\\u00A0\\u202F().-]*[0-9]){6,14}[\\s\\u00A0\\u202F().-]*$","description":"An international number of 7–15 digits behind an explicit `+` or `00` prefix (spaces, dashes, dots and parentheses ignored), stored in the canonical `+`-and-digits form: `+47 90 00 00 01` and `004790000001` both come back as `+4790000001`. A number alone narrows to the profiles holding it and the name settles which, so a household’s shared number does not attribute one guest to another.","example":"+4790000001"},"restaurant_id":{"type":"string","format":"uuid","description":"Which of the tenant’s restaurants this guest came to you through, by its `id` from `GET /restaurants`: it decides which restaurant-limited staff can see the guest in the Nine Tables app. Omit it only when the tenant, or your limited key, has exactly one live restaurant.","example":"0198a5b0-1234-7abc-8def-0123456789ab"},"source_system":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own system name, lower-cased when stored and legal only beside `source_key`. The pair is attached in this same call to the guest created or matched, and is consulted before email and phone."},"source_key":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"The guest’s identifier inside that system, stored verbatim with its case and legal only beside `source_system`. A pair a guest already holds reuses that guest rather than moving, and the two cases that answer 409 are at https://developer.ninetables.io/guides/addressing/#creating-a-customer."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesRecord"}],"description":"Attribute values to write on the guest in the same transaction, in the `ValuesRecord` forms. It needs `attributes:write` on top of `customers:write`, and a refused attribute key leaves no guest behind."}},"additionalProperties":false,"description":"The guest to create or reuse, for `POST /customers`: an `email` or a `phone`, whatever names you hold, and optionally your `source_system`/`source_key` pair. The schema states all three rules (the `+` or `00` prefix as `phone`’s `pattern`, `email`-or-`phone` as an `anyOf`, the pair as a mutual `dependentRequired`), so a generated client refuses a body this route would.","anyOf":[{"required":["email"]},{"required":["phone"]}],"dependentRequired":{"source_key":["source_system"],"source_system":["source_key"]},"example":{"firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","source_system":"pos_x","source_key":"cust-889"}},"ResolveCriteria":{"type":"object","properties":{"email":{"type":["string","null"],"description":"The email searched on, lower-cased; null when you sent none, which tells \"found nothing\" from \"never searched\"."},"phone":{"type":["string","null"],"description":"The phone in canonical E.164 form."},"source_system":{"type":["string","null"],"description":"The system name searched on, lower-cased as `PUT …/source-identity` stores it; null when you sent none, and then no match discloses its key."},"source_key":{"type":["string","null"],"description":"The key searched on, unchanged, since it is matched exactly; null when you sent none."}},"required":["email","phone","source_system","source_key"],"description":"The criteria as the server canonicalized them (email lower-cased, phone in E.164, source_system case-folded), null where you sent none. An empty `matches` with the criteria you expected means the guest is absent."},"CustomerResolveBody":{"type":"object","properties":{"email":{"type":"string","maxLength":255,"format":"email","description":"The guest’s email address, matched whole and case-insensitively (`Kari@Example.com` finds `kari@example.com`). An invalid address is `schema_invalid`, not an empty result."},"phone":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[\\s\\u00A0\\u202F().-]*(?:\\+|0[\\s\\u00A0\\u202F().-]*0)[\\s\\u00A0\\u202F().-]*[1-9](?:[\\s\\u00A0\\u202F().-]*[0-9]){6,14}[\\s\\u00A0\\u202F().-]*$","description":"The guest’s phone, an international number behind an explicit `+` or `00` prefix (spaces, dashes, dots and parentheses ignored), normalised to E.164 before matching. A number without the prefix is refused rather than guessed at.","example":"+4790000001"},"source_system":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your system name (`SourceIdentity.source_system`), matched case-insensitively: it narrows the search to guests holding a key from it and makes each match’s key disclosable. It may accompany `email` or `phone`, but is never a criterion on its own."},"source_key":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"The guest’s identifier in that system, matched exactly and only beside `source_system`. Send a key a URL path cannot carry as this pair rather than as a ref."}},"additionalProperties":false,"description":"What to look a guest up by, for `POST /customers/resolve`: at least one of `email`, `phone` or the `source_system`+`source_key` pair, AND-ed together. The route only reads, answering `matches` (empty when no guest holds these details) and the canonical `criteria` it searched on. See https://developer.ninetables.io/guides/addressing/#resolve-finds-a-guest-and-never-creates-one.","anyOf":[{"required":["email"]},{"required":["phone"]},{"required":["source_system","source_key"]}],"dependentRequired":{"source_key":["source_system"]},"example":{"email":"kari@example.com","phone":"+4790000001"}},"SourceIdentity":{"type":"object","properties":{"source_system":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"A name for your own system (`pos_x`, `loyalty`), established by the first identity you attach and lower-cased, so `POS_X` and `pos_x` are one system. It decides disclosure, a record’s key being shown only to a caller naming its system, and takes any storable character: the path charset applies to path refs only."},"source_key":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"The record’s identifier inside that system, stored verbatim and matched case-sensitively. A customer pair is unique per tenant and a booking pair per restaurant, so a pair another record holds answers 409 `identity-already-assigned`."}},"required":["source_system","source_key"],"additionalProperties":false,"description":"The pair tying a Nine Tables customer or booking to your own record, after which `{source_system}:{source_key}` addresses it on every `{ref}` route. A record holds one key per system and this API never replaces it: a different key answers 409 `conflict-source-identity`, the identical pair is idempotent, and `DELETE …/source-identity/{sourceSystem}` frees the slot. See https://developer.ninetables.io/guides/addressing/#one-key-per-system-per-record.","example":{"source_system":"pos_x","source_key":"cust-889"}},"CustomerBookingsPage":{"allOf":[{"$ref":"#/components/schemas/PaginationEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerBookingRow"}}}}],"description":"One page of a customer’s bookings, ordered by booking id ascending.","example":{"data":[],"next_cursor":null,"has_more":false}},"CustomerBookingRow":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The booking id, and a valid `{bookingRef}` for every booking route — including the attribute read and write."},"source_system":{"type":["string","null"],"description":"The system you named — in the `{source_system}:{source_key}` path ref, in `?source_system=`, or as the `source_system` your webhook subscription declared — lower-cased, when this booking holds a key from it. A booking holds at most one key per external system, and only the key of the system you named is ever shown; null when you named none or the booking holds no key from yours."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this booking — a POS order number, typically. Verbatim, never case-folded, and null exactly when `source_system` is."},"start_time":{"type":"string","format":"date-time","description":"When the party is seated, and the instant `from`/`to` filter on; pages are ordered by booking id, so sort by this member for a timeline."},"end_time":{"type":"string","format":"date-time","description":"The end of the booking’s table slot, when the table is expected to free up; no filter reads it."},"status":{"anyOf":[{"$ref":"#/components/schemas/BookingStatus"}],"description":"The booking’s lifecycle status, set by `POST /bookings`, moved by `PATCH /bookings/{bookingRef}` and otherwise by Nine Tables itself."},"guest_count":{"type":["integer","null"],"description":"The party size the booking was made for — guests at the table, not a count of linked customer records."},"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant this booking belongs to, fixed when it is created, which `GET /restaurants` lists only with `include_inactive=true` once it is disabled or demo."},"customer_notes":{"type":["string","null"],"description":"What the guest asked for, in their words, which the floor sees and the guest’s confirmation echoes; null when there is none or it is only whitespace."},"staff_notes":{"type":["string","null"],"description":"The venue’s internal note, never shown to the guest; null when there is none or it is only whitespace."},"allergens":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AllergenCode"},"description":"The party’s declarable allergens as codes, `[]` when none is declared — the whole set a `PATCH` replaces, so to add one, send this list with it."},"dietary_preferences":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DietaryPreferenceCode"},"description":"The party’s dietary preferences as codes, `[]` when none is stated, replaced as a set exactly as `allergens` is."},"requested_area_id":{"type":["string","null"],"format":"uuid","description":"The area the guest asked for, a preference that holds no table and can name an area the venue has since removed, which `GET /restaurants/{restaurantId}/areas?include_inactive=true` still names; null when they asked for none."},"requested_table_count":{"type":["integer","null"],"description":"How many tables the guest asked for, a request rather than an assignment; null when they named no number."},"table_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The tables the booking holds, in ascending id order and `[]` when it holds none, each named by `GET /restaurants/{restaurantId}/tables?include_inactive=true` even after the venue removes it. See https://developer.ninetables.io/guides/webhooks/#booking-events."}},"required":["id","source_system","source_key","start_time","end_time","status","guest_count","restaurant_id","customer_notes","staff_notes","allergens","dietary_preferences","requested_area_id","requested_table_count","table_ids"],"description":"One booking of the customer named in the path, as `GET /customers/{customerRef}/bookings` pages them. Deliberately narrower than `BookingSummary`: it carries no `customer_id`, because every row belongs to the customer you addressed.","example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"BookingDetail":{"allOf":[{"$ref":"#/components/schemas/BookingSummary"},{"type":"object","properties":{"customer":{"anyOf":[{"$ref":"#/components/schemas/CustomerSummary"},{"type":"null"}],"description":"Present only with `include=customer`, which needs `customers:read`: the guest `customer_id` names, as `GET /customers/{customerRef}` returns them to this key without `values`. Null when the booking has no guest or that read answers 404 for them."}}}],"description":"One booking in `GET /bookings/{bookingRef}`: a `BookingSummary`, plus its guest as `customer` with `include=customer`.","example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"BookingsPage":{"allOf":[{"$ref":"#/components/schemas/PaginationEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/BookingListItem"},{"$ref":"#/components/schemas/RecordTombstone"}]}}}}],"description":"One page of bookings: by booking id ascending, or with `updated_since` by `changed_at` and then id, tombstones included.","example":{"data":[],"next_cursor":null,"has_more":false}},"BookingListItem":{"allOf":[{"$ref":"#/components/schemas/BookingSummary"},{"type":"object","properties":{"deleted_at":{"type":["string","null"],"format":"date-time","description":"When the record was moved to the trash, or null for a live one; present only with `updated_since`, which returns trashed records as themselves while id order hides them. A record that comes back out of the trash appears again with this null."},"changed_at":{"type":"string","format":"date-time","description":"When the record last changed, as the change feed stamped it: the time of the write’s own statement, not of its commit. Present only with `updated_since`, whose page is ordered by this member, then by `id`."},"customer":{"anyOf":[{"$ref":"#/components/schemas/CustomerSummary"},{"type":"null"}],"description":"Present only with `include=customer`, which needs `customers:read`: the guest `customer_id` names, as `GET /customers/{customerRef}` returns them to this key without `values`. Null when the booking has no guest or that read answers 404 for them."}}}],"description":"One booking in `GET /bookings`: a `BookingSummary`, plus `deleted_at` and `changed_at` on an `updated_since` page, and its guest as `customer` with `include=customer`.","example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"BookingCreated":{"type":"object","properties":{"booking":{"anyOf":[{"$ref":"#/components/schemas/BookingWriteEcho"}],"description":"The reservation as it now stands — with `bookings:read` the same shape every booking read returns, so this response can be stored exactly as a `GET /bookings/{bookingRef}` body would be. `id` is what addresses it from here on, and the source identity is echoed when you supplied one."},"guest":{"anyOf":[{"$ref":"#/components/schemas/BookingGuestOutcome"}],"description":"Which guest the reservation hangs off, and whether this call created them."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"}],"description":"Present only when the request carried `values`: the attribute values as stored, each with its own `updated_at` and `source`. With `attributes:read` it is the FULL value set `GET /bookings/{bookingRef}/attributes` would answer, and without it only the keys this request wrote."},"accepted_outside_opening_hours":{"type":"boolean","description":"Whether the reservation starts outside the venue’s own opening hours for that service day, which this API reports rather than enforces. True means the booking stands AND that the floor will see a party arriving while the venue is published as shut."},"accepted_above_online_party_limit":{"type":"boolean","description":"Whether `guest_count` is above the largest party the venue takes online — its widget’s own ceiling, or 7 where it has configured none. Like the opening-hours flag this is a notice and not a refusal: the booking stands, and the response says so because the same party would have been turned away on the widget and somebody will ask how it reached the diary."}},"required":["booking","guest","accepted_outside_opening_hours","accepted_above_online_party_limit"],"description":"The 201 body of `POST /bookings`: the reservation that now exists, the guest it was attributed to, its attribute values when the request wrote any, and the two warnings about limits this API accepts a booking past. Store `booking.id` — or attach your own `source_system`/`source_key` so you need not — because every later read and write of this reservation is addressed by one of the two.","example":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"booking_confirmed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"guest":{"customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","created":true,"match_reason":"new"},"values":{"spend":{"value":1240,"updated_at":"2026-08-19T17:02:02.854000Z","source":"api"}},"accepted_outside_opening_hours":false,"accepted_above_online_party_limit":false}},"BookingWriteEcho":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The booking id, and a valid `{bookingRef}` for every booking route — including the attribute read and write."},"source_system":{"type":["string","null"],"description":"The system you named — in the `{source_system}:{source_key}` path ref, in `?source_system=`, or as the `source_system` your webhook subscription declared — lower-cased, when this booking holds a key from it. A booking holds at most one key per external system, and only the key of the system you named is ever shown; null when you named none or the booking holds no key from yours."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this booking — a POS order number, typically. Verbatim, never case-folded, and null exactly when `source_system` is."},"start_time":{"type":"string","format":"date-time","description":"When the party is seated, and the instant `from`/`to` filter on; pages are ordered by booking id, so sort by this member for a timeline."},"end_time":{"type":"string","format":"date-time","description":"The end of the booking’s table slot, when the table is expected to free up; no filter reads it."},"status":{"anyOf":[{"$ref":"#/components/schemas/BookingStatus"}],"description":"The booking’s lifecycle status, set by `POST /bookings`, moved by `PATCH /bookings/{bookingRef}` and otherwise by Nine Tables itself."},"guest_count":{"type":["integer","null"],"description":"The party size the booking was made for — guests at the table, not a count of linked customer records."},"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant this booking belongs to, fixed when it is created, which `GET /restaurants` lists only with `include_inactive=true` once it is disabled or demo."},"customer_id":{"type":["string","null"],"format":"uuid","description":"The customer this booking is attributed to, and a valid `{customerRef}`; null when the booking carries no customer record."},"customer_notes":{"type":["string","null"],"description":"Present only when the key holds `bookings:read`. What the guest asked for, in their words, which the floor sees and the guest’s confirmation echoes; null when there is none or it is only whitespace."},"staff_notes":{"type":["string","null"],"description":"Present only when the key holds `bookings:read`. The venue’s internal note, never shown to the guest; null when there is none or it is only whitespace."},"allergens":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AllergenCode"},"description":"Present only when the key holds `bookings:read`. The party’s declarable allergens as codes, `[]` when none is declared — the whole set a `PATCH` replaces, so to add one, send this list with it."},"dietary_preferences":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DietaryPreferenceCode"},"description":"Present only when the key holds `bookings:read`. The party’s dietary preferences as codes, `[]` when none is stated, replaced as a set exactly as `allergens` is."},"requested_area_id":{"type":["string","null"],"format":"uuid","description":"Present only when the key holds `bookings:read`. The area the guest asked for, a preference that holds no table and can name an area the venue has since removed, which `GET /restaurants/{restaurantId}/areas?include_inactive=true` still names; null when they asked for none."},"requested_table_count":{"type":["integer","null"],"description":"Present only when the key holds `bookings:read`. How many tables the guest asked for, a request rather than an assignment; null when they named no number."},"table_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Present only when the key holds `bookings:read`. The tables the booking holds, in ascending id order and `[]` when it holds none, each named by `GET /restaurants/{restaurantId}/tables?include_inactive=true` even after the venue removes it. See https://developer.ninetables.io/guides/webhooks/#booking-events."}},"required":["id","source_system","source_key","start_time","end_time","status","guest_count","restaurant_id","customer_id"],"description":"A booking as `POST /bookings` and `PATCH /bookings/{bookingRef}` answer it: its id, your pair and the reservation itself under `bookings:write` alone. With `bookings:read` it also carries the notes, allergens, dietary preferences, requests and tables, making it the same object as `BookingSummary`; without that scope they are absent. See https://developer.ninetables.io/guides/bookings/#reading-the-diary.","example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"BookingGuestOutcome":{"type":"object","properties":{"customer_id":{"type":"string","format":"uuid","description":"The guest the reservation is attributed to, a valid `{customerRef}` on every customer route, and ALWAYS present. Details too weak to tie to one profile safely are refused (400 on `customer`) rather than booked against nobody."},"created":{"type":"boolean","description":"Whether this call created the guest: false for a returning guest is the duplicate you did not get, not an error. Always false when you supplied `customer_id`."},"match_reason":{"anyOf":[{"$ref":"#/components/schemas/GuestMatchReason"},{"type":"null"}],"description":"Why the resolver landed where it did, as listed on `GuestMatchReason`, and never `source_key` or `source_key_alias`: the booking’s own `source_system`/`source_key` takes no part in resolving its guest. Null when you supplied `customer_id`, since nothing was resolved.","examples":["new","phone_email_name","conflict"]}},"required":["customer_id","created","match_reason"],"description":"What became of the guest half of a booking write: which customer the reservation hangs off, whether that customer is new, and on what evidence. Read `created` before you create a guest of your own — a false here is the de-duplication working.","example":{"customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","created":true,"match_reason":"new"}},"BookingCreateBody":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant the party is coming to, by its id from `GET /restaurants`; it fixes the timezone this request’s times are judged in and the tables `table_ids` may name. An id of no restaurant this key may book at — unknown, another tenant’s, disabled, demo or outside a limited key’s restaurants — answers 400 on this member, not 404."},"customer_id":{"anyOf":[{"$ref":"#/components/schemas/EntityRef"}],"description":"The guest, when you already hold them: a Nine Tables customer id or the `{source_system}:{source_key}` pair you attached, which skips identity resolution. An id that matches no customer of this tenant answers 400 on this member."},"customer":{"$ref":"#/components/schemas/BookingGuestDetails"},"start_time":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$","examples":["2026-08-18T19:00:00Z","2026-08-18T19:00:00+02:00"],"description":"When the party is seated, as an RFC 3339 instant with an explicit offset (`Z` or `+02:00`); a wall-clock time with none is refused. Any instant, past or future, is accepted, which is how a POS backfills its history."},"end_time":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$","examples":["2026-08-18T19:00:00Z","2026-08-18T19:00:00+02:00"],"description":"When the table frees up again, in the same instant form and after `start_time`; exactly one of this and `duration_minutes` is required. It is the window the double-booking guard judges, so it decides whether a table is free."},"duration_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"How long the table is held, at most 1440 minutes — the alternative to `end_time`, and exactly one of the two is required. The end is `start_time` plus that exact duration, so across a daylight-saving change the table is held for the minutes you asked for.","example":120},"guest_count":{"type":"integer","minimum":1,"maximum":999,"description":"How many guests are coming — people at the table, not a count of customer records. The venue’s own online ceiling is NOT enforced; a party above it is accepted and reported in `accepted_above_online_party_limit`.","example":4},"table_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50,"description":"The tables the party holds, each an active one `GET /restaurants/{restaurantId}/tables` lists for `restaurant_id` (a removed table, or one in a removed area, answers 400); duplicates collapse. Omit it or send `[]` for a complete reservation that holds no table, and a table another blocking booking holds across this window answers 409 naming it, writing nothing."},"status":{"anyOf":[{"$ref":"#/components/schemas/BookingStatus"}],"description":"The status to create the reservation in, `booking_confirmed` by default; any of the sixteen is accepted, so a POS can backfill `completed` or `guest_no_show` history. A create is not a transition: creating straight into a status runs none of the effects a `PATCH` into it would, except that `completed` still counts towards loyalty."},"customer_notes":{"type":["string","null"],"maxLength":4096,"description":"What the guest asked for, in their words — shown to the floor and echoed in their confirmation, so write it as they would read it. At most 4096 characters.","example":"Window table if one is free"},"staff_notes":{"type":["string","null"],"maxLength":4096,"description":"A note for the venue’s own staff, at most 4096 characters. It is never shown to the guest or sent in any message, so this is where an internal flag belongs.","example":"Regular — give table 7 if free"},"allergens":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AllergenCode"},"maxItems":15,"description":"The party’s declarable allergens, as codes — the whole set, since there is no add/remove form. It reaches the kitchen ticket, so an allergen you leave out is one the kitchen never hears about."},"dietary_preferences":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DietaryPreferenceCode"},"maxItems":6,"description":"The party’s dietary preferences, as codes, replacing nothing because the reservation is new. Kept separate from `allergens`: one is a choice, the other is medical."},"requested_area_id":{"type":"string","format":"uuid","description":"The area the guest asked for — a preference the floor sees, not a seating decision. It does not assign a table and does not have to agree with `table_ids`; the ids come from `GET /restaurants/{restaurantId}/areas`, and an area the venue has removed answers 400 on this member."},"requested_table_count":{"type":"integer","minimum":1,"maximum":50,"description":"How many tables the guest asked for, for the venues that sell by the table rather than by the cover. A request the floor reads, again not a seating decision: it neither assigns nor constrains `table_ids`.","example":2},"source_system":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own system’s name, stored lower-cased as half of the reservation’s source identity, as `PUT /bookings/{bookingRef}/source-identity` would attach it, and sent with `source_key`. It lets you address the reservation as `{source_system}:{source_key}` instead of storing its id, and makes the pair disclosable back to you."},"source_key":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own identifier for this reservation, typically an order number, stored verbatim and sent with `source_system`. The pair is unique per RESTAURANT, so one another live booking there holds answers 409 and writes nothing — a second guard against a retry duplicating the reservation."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesRecord"}],"description":"Attribute values to write on the new reservation, resolved against the tenant’s BOOKING definitions, so a customer attribute answers `entity_mismatch` (`ValuesRecord` has the key rules and forms). It needs `attributes:write` ON TOP of `bookings:write`, and a refused key leaves no reservation and no `booking.created` event behind, so a corrected retry cannot book twice."}},"required":["restaurant_id","start_time","guest_count"],"additionalProperties":false,"description":"A reservation to write: `restaurant_id`, `start_time`, `guest_count`, one of the two guest forms and one of `end_time`/`duration_minutes` are required, and everything else has a default. The booking type, channel and source are fixed to the API’s own and are not members. See https://developer.ninetables.io/guides/bookings/#every-booking-you-create-is-an-api-booking.","allOf":[{"anyOf":[{"required":["customer_id"]},{"required":["customer"]}]},{"anyOf":[{"required":["end_time"]},{"required":["duration_minutes"]}]}],"dependentRequired":{"source_system":["source_key"],"source_key":["source_system"]},"example":{"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer":{"firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001"},"start_time":"2026-08-18T19:00:00Z","duration_minutes":120,"guest_count":4,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"],"customer_notes":"Window table if one is free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"source_system":"pos_x","source_key":"order-777","values":{"spend":1240}}},"BookingGuestDetails":{"type":"object","properties":{"firstname":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\S","description":"The guest’s first name, stored as you send it. It decides BETWEEN the profiles an email or phone reached, and a name contradicting a reached profile’s creates a separate guest rather than overwriting that person.","example":"Kari"},"lastname":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\S","description":"The guest’s surname, read exactly as `firstname` is. A component you omit is silent — it never counts as a difference.","example":"Nordmann"},"email":{"type":"string","maxLength":255,"format":"email","description":"The guest’s email address, matched case-insensitively and whole; one of `email` and `phone` is required. Sending both makes the match stronger rather than wider: either channel can reach the profile, and an agreeing name then confirms it.","example":"kari@example.com"},"phone":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[\\s\\u00A0\\u202F().-]*(?:\\+|0[\\s\\u00A0\\u202F().-]*0)[\\s\\u00A0\\u202F().-]*[1-9](?:[\\s\\u00A0\\u202F().-]*[0-9]){6,14}[\\s\\u00A0\\u202F().-]*$","description":"An international number of 7–15 digits behind an explicit `+` or `00` prefix (spaces, dashes, dots and parentheses ignored), stored in the canonical `+`-and-digits form: `+47 90 00 00 01` and `004790000001` both come back as `+4790000001`. A number alone narrows to the profiles holding it and the name settles which, so a household’s shared number does not attribute one guest to another.","example":"+4790000001"}},"additionalProperties":false,"description":"The guest, when you hold only their details, resolved against the tenant’s existing guests so a returning guest is reused. Exactly one of this and `customer_id` is required.","anyOf":[{"required":["email"]},{"required":["phone"]}],"example":{"firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001"}},"BookingUpdated":{"type":"object","properties":{"booking":{"anyOf":[{"$ref":"#/components/schemas/BookingWriteEcho"}],"description":"The reservation after the write, in the shape every booking read returns once the key also holds `bookings:read`, which the diary details need."},"changed":{"type":"array","items":{"type":"string"},"description":"The members this request actually moved, named as in the request body, so an empty array means the reservation already said what you asked for — a replay, not a failure. A request that moved anything raises one `booking.updated` naming the members that moved, `table_ids` among them.","examples":[["start_time","end_time","status"]]},"accepted_outside_opening_hours":{"type":"boolean","description":"Whether the reservation starts outside the venue’s own opening hours for that service day, which this API reports rather than enforces. True means the booking stands AND that the floor will see a party arriving while the venue is published as shut."},"accepted_above_online_party_limit":{"type":"boolean","description":"Whether `guest_count` is above the largest party the venue takes online — its widget’s own ceiling, or 7 where it has configured none. Like the opening-hours flag this is a notice and not a refusal: the booking stands, and the response says so because the same party would have been turned away on the widget and somebody will ask how it reached the diary."}},"required":["booking","changed","accepted_outside_opening_hours","accepted_above_online_party_limit"],"description":"The 200 body of `PATCH /bookings/{bookingRef}`: the reservation as it now stands, which of your members actually moved it, and the two limit warnings — the same two the create route reports, re-evaluated on the new window and party size, because a patch can move a reservation outside opening hours just as a create can.","example":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T20:00:00.000000Z","end_time":"2026-08-18T22:00:00.000000Z","status":"guest_seated","guest_count":5,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"changed":["start_time","end_time","guest_count","status"],"accepted_outside_opening_hours":false,"accepted_above_online_party_limit":false}},"BookingPatchBody":{"type":"object","properties":{"start_time":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$","examples":["2026-08-18T19:00:00Z","2026-08-18T19:00:00+02:00"],"description":"Moves when the party is seated, as an instant with an explicit offset; the resulting window must still end after it starts, so a start moved past an unchanged `end_time` is refused. The new window is re-judged against the tables the booking holds, and one occupied then answers 409 with the booking left where it was."},"end_time":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$","examples":["2026-08-18T19:00:00Z","2026-08-18T19:00:00+02:00"],"description":"Moves when the table frees up, as an instant with an explicit offset. There is no duration form here, since a duration would be ambiguous against a `start_time` the same request may move."},"guest_count":{"type":"integer","minimum":1,"maximum":999,"description":"Changes the party size. The venue’s online ceiling is not enforced here either; a size above it is accepted and reported back."},"status":{"anyOf":[{"$ref":"#/components/schemas/BookingStatus"}],"description":"Moves the lifecycle status to any of the sixteen, from any of them: this API enforces no transition order. Several values do real work beyond the column — `completed`, `guest_arrived` and `guest_no_show` touch money or loyalty — and the guide lists each."},"customer_id":{"anyOf":[{"$ref":"#/components/schemas/EntityRef"},{"type":"null"}],"description":"Re-attributes the reservation to another guest by id or `{source_system}:{source_key}` pair, or detaches it with `null`, keeping the details it was made with; either way both guests’ visit counts and loyalty progress are recounted. A ref matching no customer of this tenant answers 400 on this member."},"table_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50,"description":"Replaces the table set wholesale, `[]` detaching every table, and every id must belong to the reservation’s restaurant. A table the set ADDS must be an active one `GET /restaurants/{restaurantId}/tables` lists (400 otherwise, while one already held may be sent back), and one another blocking booking holds across the window answers 409 with the tables left as they were."},"customer_notes":{"type":["string","null"],"maxLength":4096,"description":"Replaces what the guest asked for; `null` clears it. Shown to the floor and echoed in guest messages."},"staff_notes":{"type":["string","null"],"maxLength":4096,"description":"Replaces the venue’s internal note; `null` clears it. Never shown to the guest."},"allergens":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AllergenCode"},"maxItems":15,"description":"Replaces the declarable allergens with this exact set; `null` clears them. A code you omit is removed, so to add one, send the `allergens` a booking read returns with the new code in it."},"dietary_preferences":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DietaryPreferenceCode"},"maxItems":6,"description":"Replaces the dietary preferences with this exact set; `null` clears them. Same replace-not-merge rule as `allergens`: add one by sending the `dietary_preferences` a booking read returns with it."},"requested_area_id":{"type":["string","null"],"format":"uuid","description":"Changes the area the guest asked for, or clears it with `null` — a preference the floor reads, which moves no table. An area the venue has removed answers 400 on this member, though a reservation whose area was removed after it was made stays patchable."},"requested_table_count":{"type":["integer","null"],"minimum":1,"maximum":50,"description":"Changes how many tables the guest asked for, or clears it with `null`. A request, not an assignment: `table_ids` is what actually holds tables."}},"additionalProperties":false,"description":"The reservation members to change: every member is optional, only the ones you send are touched, and they are written all or none. An empty body and a body of only unknown members are refused, so a misspelled member never reads as a successful no-op.","example":{"start_time":"2026-08-18T20:00:00Z","end_time":"2026-08-18T22:00:00Z","guest_count":5,"status":"guest_seated"}},"BookingSourceIdentityEcho":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The booking id, and a valid `{bookingRef}` for every booking route — including the attribute read and write."},"source_system":{"type":["string","null"],"description":"The system you named — in the `{source_system}:{source_key}` path ref, in `?source_system=`, or as the `source_system` your webhook subscription declared — lower-cased, when this booking holds a key from it. A booking holds at most one key per external system, and only the key of the system you named is ever shown; null when you named none or the booking holds no key from yours."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this booking — a POS order number, typically. Verbatim, never case-folded, and null exactly when `source_system` is."},"start_time":{"type":"string","format":"date-time","description":"Present only when the key holds `bookings:read`. When the party is seated, and the instant `from`/`to` filter on; pages are ordered by booking id, so sort by this member for a timeline."},"end_time":{"type":"string","format":"date-time","description":"Present only when the key holds `bookings:read`. The end of the booking’s table slot, when the table is expected to free up; no filter reads it."},"status":{"anyOf":[{"$ref":"#/components/schemas/BookingStatus"}],"description":"Present only when the key holds `bookings:read`. The booking’s lifecycle status, set by `POST /bookings`, moved by `PATCH /bookings/{bookingRef}` and otherwise by Nine Tables itself."},"guest_count":{"type":["integer","null"],"description":"Present only when the key holds `bookings:read`. The party size the booking was made for — guests at the table, not a count of linked customer records."},"restaurant_id":{"type":"string","format":"uuid","description":"Present only when the key holds `bookings:read`. The restaurant this booking belongs to, fixed when it is created, which `GET /restaurants` lists only with `include_inactive=true` once it is disabled or demo."},"customer_id":{"type":["string","null"],"format":"uuid","description":"Present only when the key holds `bookings:read`. The customer this booking is attributed to, and a valid `{customerRef}`; null when the booking carries no customer record."},"customer_notes":{"type":["string","null"],"description":"Present only when the key holds `bookings:read`. What the guest asked for, in their words, which the floor sees and the guest’s confirmation echoes; null when there is none or it is only whitespace."},"staff_notes":{"type":["string","null"],"description":"Present only when the key holds `bookings:read`. The venue’s internal note, never shown to the guest; null when there is none or it is only whitespace."},"allergens":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AllergenCode"},"description":"Present only when the key holds `bookings:read`. The party’s declarable allergens as codes, `[]` when none is declared — the whole set a `PATCH` replaces, so to add one, send this list with it."},"dietary_preferences":{"type":["array","null"],"items":{"$ref":"#/components/schemas/DietaryPreferenceCode"},"description":"Present only when the key holds `bookings:read`. The party’s dietary preferences as codes, `[]` when none is stated, replaced as a set exactly as `allergens` is."},"requested_area_id":{"type":["string","null"],"format":"uuid","description":"Present only when the key holds `bookings:read`. The area the guest asked for, a preference that holds no table and can name an area the venue has since removed, which `GET /restaurants/{restaurantId}/areas?include_inactive=true` still names; null when they asked for none."},"requested_table_count":{"type":["integer","null"],"description":"Present only when the key holds `bookings:read`. How many tables the guest asked for, a request rather than an assignment; null when they named no number."},"table_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Present only when the key holds `bookings:read`. The tables the booking holds, in ascending id order and `[]` when it holds none, each named by `GET /restaurants/{restaurantId}/tables?include_inactive=true` even after the venue removes it. See https://developer.ninetables.io/guides/webhooks/#booking-events."}},"required":["id","source_system","source_key"],"description":"A booking as `PUT /bookings/{bookingRef}/source-identity` and `DELETE /bookings/{bookingRef}/source-identity/{sourceSystem}` answer: its id and the pair your system holds on it. With `bookings:read` it also carries the diary members, making it the same object as `BookingSummary`; without that scope they are absent. See https://developer.ninetables.io/guides/addressing/#one-key-per-system-per-record.","example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"LoyaltyMembership":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"customer_id":{"type":"string","format":"uuid","description":"The guest, addressable as `{customerRef}` on the customer operations."},"status":{"type":"string","enum":["active","paused"],"description":"`paused` while the restaurant has paused the membership in the app: visits still count, and a reward they reach waits until it is resumed."},"tier":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]}},"required":["id","name"],"description":"The tier the visits in the period reach, or null below the first."},"visits":{"type":"object","properties":{"period":{"type":"integer","description":"Visits counted in the current period, which the tiers read."},"total":{"type":"integer","description":"Every visit counted since joining."}},"required":["period","total"]},"period_start":{"type":["string","null"],"format":"date-time","description":"When the current period began."},"renews_at":{"type":["string","null"],"format":"date-time","description":"When the period ends and the count starts again, or null for a club whose period never resets."},"joined_at":{"type":"string","format":"date-time"},"joined_via_restaurant_id":{"type":["string","null"],"format":"uuid","description":"The restaurant the guest joined through, when one is known."},"join_source":{"type":["string","null"],"description":"The campaign or channel code the guest joined under, such as `student`."},"imported_from":{"type":["string","null"],"description":"The `source_system` of the transfer that brought the member in, or null for a member who joined in Nine Tables."}},"required":["id","customer_id","status","tier","visits","period_start","renews_at","joined_at","joined_via_restaurant_id","join_source","imported_from"],"description":"A guest’s membership of the restaurant’s loyalty club.","example":{"id":"0198a5b0-5e1f-7c21-9a44-2b6d7e8f9a01","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","status":"active","tier":{"id":"0198a5b0-3c4d-7e5f-8a6b-7c8d9e0f1a2b","name":"Silver"},"visits":{"period":4,"total":11},"period_start":"2026-03-01T00:00:00.000000Z","renews_at":"2027-03-01T00:00:00.000000Z","joined_at":"2025-03-01T00:00:00.000000Z","joined_via_restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","join_source":"student","imported_from":"diller"}},"LoyaltyEnrollBody":{"type":"object","properties":{"phone":{"type":"string","minLength":3,"maxLength":30,"description":"The guest’s phone number, which identifies them: the guest holding it is enrolled, and a guest is created when nobody does. It is stored in E.164.","example":"+4790000001"},"first_name":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\S","description":"Stored only when the guest has no first name yet; never overwrites one.","example":"Kari"},"last_name":{"type":"string","minLength":1,"maxLength":255,"pattern":"\\S","description":"Stored only when the guest has no surname yet.","example":"Nordmann"},"email":{"type":"string","maxLength":255,"format":"email","description":"Stored only when the guest has no email address yet. It never identifies the guest.","example":"kari@example.com"},"marketing_consent":{"type":"boolean","description":"True when the guest agreed to marketing, recorded with source `api` on a guest who has none, while a guest’s existing consent is never changed. A club that asks for consent to join refuses the enrolment without it."},"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant the guest joined through, by its `id` from `GET /restaurants`. A key limited to one live restaurant joins through it when this is omitted, and one limited to several must send it.","example":"0198a5b0-1234-7abc-8def-0123456789ab"},"source":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,39}$","description":"A campaign or channel code the guest joined under, such as `student`: lower-case, matching `^[a-z][a-z0-9-]{0,39}$`.","example":"student"}},"required":["phone"],"additionalProperties":false,"description":"The guest to enrol in the loyalty club, for `POST /loyalty/members`."},"LoyaltyImportResult":{"oneOf":[{"type":"object","properties":{"dry_run":{"type":"boolean","enum":[true]},"summary":{"$ref":"#/components/schemas/LoyaltyImportDryRunSummary"},"members":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyImportDryRunLine"}}},"required":["dry_run","summary","members"]},{"type":"object","properties":{"dry_run":{"type":"boolean","enum":[false]},"import_job_id":{"type":"string","format":"uuid","description":"The import job, which the restaurant can undo in the app."},"summary":{"$ref":"#/components/schemas/LoyaltyImportCounts"},"members":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyImportLine"}}},"required":["dry_run","import_job_id","summary","members"]}],"description":"One line per member, in request order, with `dry_run` saying whether anything was written."},"LoyaltyImportDryRunSummary":{"type":"object","properties":{"rows":{"type":"integer","description":"Members sent."},"decisions":{"type":"object","properties":{"create_customer":{"type":"integer"},"create_membership":{"type":"integer"},"update":{"type":"integer"},"skip_existing_member":{"type":"integer"},"rejected":{"type":"integer"}},"required":["create_customer","create_membership","update","skip_existing_member","rejected"],"description":"Members per decision."},"rejected_by_reason":{"type":"object","additionalProperties":{"type":"integer"},"description":"Rejected members per `reason`."},"conflicts":{"type":"integer","description":"Known guests whose name or email differs from the member’s. The import keeps the guest’s."},"key_phone_conflicts":{"type":"integer","description":"Members whose `member_id` is already filed under another guest than the one holding the phone."},"consent":{"type":"object","properties":{"new_guests":{"type":"integer","description":"Guests the import creates with marketing consent."},"at_from_file":{"type":"integer","description":"Of those, consented at `consent_at`."},"at_from_joined":{"type":"integer","description":"Of those, consented at `joined_at`, having no `consent_at`."},"yes_in_source_not_in_nine_tables":{"type":"integer","description":"Known guests who consented in your system and not in Nine Tables. Their consent is left as it is."},"no_in_source_yes_in_nine_tables":{"type":"integer","description":"Known guests who declined in your system and consented in Nine Tables. Their consent is left as it is."}},"required":["new_guests","at_from_file","at_from_joined","yes_in_source_not_in_nine_tables","no_in_source_yes_in_nine_tables"]},"tiers":{"type":"array","items":{"type":"object","properties":{"tier_id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"threshold":{"type":"integer","description":"The tier’s threshold, in visits."},"members":{"type":"integer","description":"Members the import places here."}},"required":["tier_id","name","threshold","members"]}},"members_without_tier":{"type":"integer","description":"Members below the first tier."},"external":{"type":"array","items":{"type":"object","properties":{"tier_id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"threshold":{"type":"integer","description":"The tier’s threshold, in visits."},"rewards":{"type":"integer","description":"Rewards recorded as already given by your system, never paid again."}},"required":["tier_id","name","threshold","rewards"]}},"first_visit_rewards":{"type":"array","items":{"type":"object","properties":{"tier_id":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"threshold":{"type":"integer","description":"The tier’s threshold, in visits."},"reward_type":{"type":"string"},"rewards":{"type":"integer","description":"Rewards the members’ next visit pays."},"amount":{"type":["number","null"],"description":"Their sum, for a gift card."}},"required":["tier_id","name","threshold","reward_type","rewards","amount"]},"description":"Rewards reached and never given, which the next visit pays. Members carrying one are rejected with `first_visit_reward_not_allowed` unless the request sets `allow_first_visit_rewards`."},"first_visit_gift_cards":{"type":"integer","description":"Gift cards among `first_visit_rewards`."},"first_visit_gift_card_amount":{"type":"number","description":"Their sum, in `currency`."},"currency":{"type":["string","null"]},"nt_visits_after_extract":{"type":"object","properties":{"visits":{"type":"integer","description":"Nine Tables visits after `extracted_at`, added on top of the counts sent."},"members":{"type":"integer","description":"Members who have them."}},"required":["visits","members"]},"periods_expired":{"type":"integer","description":"Members whose period ended before today. They are imported, and the club’s rollover starts their next period."},"extract_age_days":{"type":"integer","description":"Calendar days from the date of `extracted_at` to today, both in the tenant’s time zone, so an extract taken yesterday is 1 at any hour."},"extract_stale":{"type":"boolean","description":"True when `extract_age_days` is over 7."},"messages_to_send":{"type":"integer","description":"Always 0: the import sends nothing."},"gift_cards_to_create":{"type":"integer","description":"Always 0: the import issues nothing."}},"required":["rows","decisions","rejected_by_reason","conflicts","key_phone_conflicts","consent","tiers","members_without_tier","external","first_visit_rewards","first_visit_gift_cards","first_visit_gift_card_amount","currency","nt_visits_after_extract","periods_expired","extract_age_days","extract_stale","messages_to_send","gift_cards_to_create"],"description":"The numbers the dry run in the Nine Tables app shows. They name no guest."},"LoyaltyImportDryRunLine":{"type":"object","properties":{"row":{"type":"integer","description":"The member’s 1-based position in `members`."},"member_id":{"type":["string","null"]},"reason":{"type":"string","description":"Why the member was rejected or skipped: `invalid_phone`, `missing_required`, `invalid_date`, `future_date`, `invalid_number`, `visits_inconsistent`, `duplicate_in_file`, `ambiguous_identity`, `key_phone_conflict`, `phone_in_use`, `first_visit_reward_not_allowed`, `invalid_member_id`, or `existing_member` for a guest already in the club. Any other value is the SQLSTATE of a database refusal."},"decision":{"type":"string","enum":["create_customer","create_membership","update","skip_existing_member","rejected"],"description":"`create_customer` makes a guest and a membership, `create_membership` enrols a known guest, `update` refreshes a member an earlier import of the same `source_system` brought in, `skip_existing_member` leaves a guest already in the club as it is."},"warnings":{"type":"array","items":{"type":"string"},"description":"What was repaired or ignored: `invalid_email_ignored`, `source_ignored`, `consent_unreadable`, `several_departments`, `period_start_before_join` or `period_expired`."}},"required":["row","member_id","decision"],"description":"What the import would do with one member."},"LoyaltyImportCounts":{"type":"object","properties":{"members":{"type":"integer","description":"Members sent."},"created":{"type":"integer","description":"Members created, with a new guest where none held the phone."},"updated":{"type":"integer","description":"Members an earlier import of the same `source_system` brought in, refreshed."},"skipped":{"type":"integer","description":"Guests already in the club, left as they are."},"rejected":{"type":"integer","description":"Members not imported."}},"required":["members","created","updated","skipped","rejected"],"description":"The import’s lines, counted."},"LoyaltyImportLine":{"type":"object","properties":{"row":{"type":"integer","description":"The member’s 1-based position in `members`."},"member_id":{"type":["string","null"]},"reason":{"type":"string","description":"Why the member was rejected or skipped: `invalid_phone`, `missing_required`, `invalid_date`, `future_date`, `invalid_number`, `visits_inconsistent`, `duplicate_in_file`, `ambiguous_identity`, `key_phone_conflict`, `phone_in_use`, `first_visit_reward_not_allowed`, `invalid_member_id`, or `existing_member` for a guest already in the club. Any other value is the SQLSTATE of a database refusal."},"status":{"type":"string","enum":["created","updated","skipped","rejected"]}},"required":["row","member_id","status"],"description":"What the import did with one member."},"LoyaltyImportBody":{"type":"object","properties":{"source_system":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,39}$","description":"Your loyalty system, lower-case (`diller`). The members’ keys are filed under `{source_system}-member`, a later import of the same system updates the members this one brought in, and the import can be undone in the app.","example":"diller"},"extracted_at":{"type":"string","format":"date-time","description":"When the members were taken out of your system. Nine Tables visits from then on are added on top of the counts you send, so a visit is never counted twice.","example":"2026-10-28T06:00:00Z"},"restaurant_map":{"type":"object","additionalProperties":{"type":["string","null"],"format":"uuid"},"description":"Each `department` value to the restaurant it names, by its `id` from `GET /restaurants`, or to null for a department that is no venue (a web shop). A department not in the map is kept as the member’s `source`.","example":{"Katla":"0198a5b0-1234-7abc-8def-0123456789ab","Nettbutikk":null}},"allow_first_visit_rewards":{"type":"boolean","description":"Off by default: a member whose counts reach a tier your system never rewarded is rejected with `first_visit_reward_not_allowed`, because their next visit would pay it. Set true to import them and let that visit pay."},"dry_run":{"type":"boolean","description":"True to plan the import and write nothing: the answer is what the import would do, in numbers and per-member decisions."},"members":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyImportMember"},"minItems":1,"maxItems":100}},"required":["source_system","extracted_at","members"],"additionalProperties":false,"description":"Members to transfer from another loyalty system, for `POST /loyalty/members/import`."},"LoyaltyImportMember":{"type":"object","properties":{"member_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"The member’s id in your system, filed as the key `{source_system}-member:{member_id}`, so a later import of the same id updates the member and the guest is addressable as that `{customerRef}`. Without it the phone is the key.","example":"M-1001"},"phone":{"type":"string","minLength":1,"maxLength":64,"description":"The member’s phone number, which identifies the guest: an international number behind `+` or `00`, or a Norwegian mobile number without its country code. Anything else rejects the member with `invalid_phone`.","example":"+4791234567"},"first_name":{"type":["string","null"],"maxLength":100,"description":"Stored on a new guest, and on a known guest only where the field is empty.","example":"Kari"},"last_name":{"type":["string","null"],"maxLength":100,"description":"As `first_name`.","example":"Nordmann"},"email":{"type":["string","null"],"maxLength":254,"description":"As `first_name`. An address that is not one is ignored with the warning `invalid_email_ignored`, and the member is still imported.","example":"kari@example.com"},"sms_consent":{"type":["boolean","null"],"description":"Whether the member agreed to marketing by SMS in your system."},"email_consent":{"type":["boolean","null"],"description":"Whether the member agreed to marketing by email in your system."},"consent":{"type":["boolean","null"],"description":"One answer for both channels, for a system that keeps a single consent: a guest the import creates gets marketing consent when this, or both `sms_consent` and `email_consent`, is true. A known guest’s consent is never changed."},"consent_at":{"type":["string","null"],"maxLength":64,"description":"When the member consented, as an ISO 8601 date (`2025-10-22`) or local date and time (`2025-10-22 16:35`), read in the account’s time zone, or an instant with its offset (`2025-10-22T16:35:20+02:00`). Without it `joined_at` stands in.","example":"2025-10-22 16:35:20"},"joined_at":{"type":"string","minLength":1,"maxLength":64,"description":"When the member joined your club, as an ISO 8601 date (`2025-10-22`) or local date and time (`2025-10-22 16:35`), read in the account’s time zone, or an instant with its offset (`2025-10-22T16:35:20+02:00`).","example":"2025-10-22"},"period_start":{"type":"string","minLength":1,"maxLength":64,"description":"When the member’s current earning period began, as an ISO 8601 date (`2025-10-22`) or local date and time (`2025-10-22 16:35`), read in the account’s time zone, or an instant with its offset (`2025-10-22T16:35:20+02:00`). It is no later than `extracted_at`.","example":"2026-03-01"},"period_visits":{"type":"integer","minimum":0,"maximum":100000,"description":"Visits counted in the current period: the count the tiers read.","example":7},"total_visits":{"type":["integer","null"],"minimum":0,"maximum":1000000,"description":"Every visit since joining, at least `period_visits`.","example":12},"department":{"type":["string","null"],"maxLength":200,"description":"The venue the member joined through, as your system names it, which `restaurant_map` translates. Several separated by `,` or `;` keep the first.","example":"Katla"},"source":{"type":["string","null"],"maxLength":200,"description":"A campaign or channel code the member joined under, folded to lower case and hyphens (`Student 2025` becomes `student-2025`). One that folds to nothing usable is ignored with the warning `source_ignored`.","example":"student"},"rewarded_thresholds":{"type":["array","null"],"items":{"type":"integer","minimum":1,"maximum":100000},"maxItems":50,"description":"The thresholds, in visits, of this club’s tiers whose reward your system already gave this period, recorded as given and never paid again. Left out, every tier the count reaches counts as given; `[]` means none was.","example":[3,5]}},"required":["phone","joined_at","period_start","period_visits"],"additionalProperties":false,"description":"One member to transfer, in the field names of the loyalty import’s file template. A member the import cannot use is rejected on its own line rather than failing the call."},"AvailabilityPeriod":{"type":"object","properties":{"key":{"type":"string","description":"A stable, opaque handle for this service window, unique within the answer and unchanged across asks for the same date with or without `duration_minutes`, so a narrowed ask’s minutes match the period a guest was looking at. Describe the period with `name`, `opens` and `closes`, and never parse this."},"name":{"type":"string","description":"What the venue calls this service — `Lunch`, `Dinner` — in the tenant’s own default language. Absent when the venue left the row unnamed, so fall back to the window’s times rather than to an empty label."},"opens":{"type":"integer","description":"When this service starts, as minutes from midnight on `date` in the venue’s zone, on the same scale as a slot’s `minutes_from_midnight`."},"closes":{"type":"integer","description":"When this service stops seating, as minutes from midnight on `date`. A service running past midnight closes past 1440 (`1560` is 02:00 the next day) rather than wrapping to a smaller number than `opens`."},"restaurant_wide":{"type":"boolean","description":"True when the window comes from the restaurant’s own opening hours, false when it is one area’s window (its own schedule, or the restaurant’s hours reshaped by that area’s breaks or special hours), which `area_id` names. A false is the signal to send that `area_id` as the booking’s `requested_area_id` on `POST /bookings`: a preference that seats nobody and that the opening-hours flag does not read, so a minute the area serves outside the restaurant’s own hours is booked with `accepted_outside_opening_hours: true`."},"area_id":{"type":["string","null"],"format":"uuid","description":"The area this window is served for, null when `restaurant_wide` is true: an area on its own weekly schedule, or one whose own breaks or special hours reshape the restaurant’s. Pass it back as `area_id` here to ask about that area alone, and as `requested_area_id` on `POST /bookings`."},"slots":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/AvailabilitySlot"}]},"description":"The bookable sittings inside this window, earliest first. Never empty: a period with nothing left to sell is omitted from `periods` entirely rather than published with an empty list."}},"required":["key","opens","closes","restaurant_wide","area_id","slots"],"description":"One service window on the asked date — lunch, dinner, an area’s own schedule — with the sittings it still has room for. The window is what decides a sitting’s length and whether the guest may choose it, which is why slots arrive grouped by it rather than as one flat list.","example":{"key":"0198a5b0-77aa-7c10-9e21-5b6c7d8e9f01:1080:1380","name":"Dinner","opens":1080,"closes":1380,"restaurant_wide":true,"area_id":null,"slots":[{"start_time":"2026-08-18T17:00:00.000000Z","local_time":"19:00","minutes_from_midnight":1140,"duration_minutes":120,"tables_available":3,"selectable_durations":[90,120]}]}},"AvailabilitySlot":{"type":"object","properties":{"start_time":{"type":"string","format":"date-time","description":"The instant this sitting starts, in UTC — pass it to `POST /bookings` as `start_time` and the booking lands on exactly this minute. It is derived from `date` and the venue’s own time zone with the daylight-saving change applied, which is the reason to use it rather than assembling an instant from `local_time` yourself."},"local_time":{"type":"string","description":"The same moment as the guest reads it on the door: a 24-hour `HH:mm` wall clock in the restaurant’s time zone. Display only — it carries no date, so a past-midnight sitting shows `01:00` while `start_time` and `minutes_from_midnight` both say it belongs to the previous day’s service."},"minutes_from_midnight":{"type":"integer","description":"Minutes from midnight at the start of `date` in the venue’s zone, the scale its opening hours and service windows use: `1140` is 19:00. A venue serving past midnight continues past 1440 rather than wrapping, so `1500` is 01:00 the following calendar day and still belongs to this date’s service."},"duration_minutes":{"type":"integer","description":"How long the table is held for this sitting, in minutes: the venue’s answer for this party at this minute, varying by service period and party size, so read it per slot. Send it as `duration_minutes` on `POST /bookings` to hold the same length."},"tables_available":{"type":"integer","description":"How many individual tables are still free for this sitting — combinations of several tables are not counted, so a party that only fits across two tables can be bookable at a minute reporting `0`. Treat it as a scarcity signal for display, never as the test of whether a booking will succeed; only `POST /bookings` decides that."},"capacity_remaining":{"type":"integer","description":"Covers still sellable at this minute, for venues that cap a service by total guests rather than by table. Absent where no such cap is configured, which is the common case — so test for presence, not for zero."},"selectable_durations":{"type":"array","items":{"type":"integer"},"description":"The sitting lengths, in minutes, this venue lets a guest CHOOSE between at this minute — pass one of them back as `duration_minutes` to re-ask. Absent when the length is not the guest’s to pick, which is the default; `duration_minutes` above is then the only length on offer."}},"required":["start_time","local_time","minutes_from_midnight","duration_minutes","tables_available"],"description":"One bookable sitting: when it starts, how long the table is held, and how much room is left. A slot is an offer at the moment it was read, not a hold — nothing is reserved until `POST /bookings` succeeds, and two partners reading the same slot can still race for the last table.","example":{"start_time":"2026-08-18T17:00:00.000000Z","local_time":"19:00","minutes_from_midnight":1140,"duration_minutes":120,"tables_available":3,"selectable_durations":[90,120]}},"AvailabilityClosedReason":{"type":"string","enum":["closed","party_size_above_online_limit","experience_party_size_out_of_range","experience_unavailable","online_booking_closed","no_availability"],"description":"Why a date came back with no sittings, null whenever `periods` carries one; only `closed` means the venue keeps no opening hours that date. See https://developer.ninetables.io/guides/bookings/#why-a-date-has-no-sittings."},"Restaurant":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The restaurant id — exactly the value `GET /bookings?restaurant_id=` takes, that a booking carries as `restaurant_id`, and that a segment booking filter names. It keeps resolving here after the restaurant is disabled, as long as you pass `include_inactive=true`."},"name":{"type":"string","description":"The restaurant’s display name. The `id` beside it is exactly what `GET /bookings?restaurant_id=` accepts."},"active":{"type":"boolean","description":"False for a restaurant that has been disabled, and for a demo one. Only `include_inactive=true` returns these, and only so an id can be NAMED — an inactive restaurant is not somewhere to send new traffic."},"timezone":{"type":"string","description":"The IANA time zone the venue runs on, such as `Europe/Oslo`: its opening hours, and the `date` `GET /availability` takes, are read in it. A bare `from`/`to` date on `GET /bookings` is a UTC day, so one venue-local day is the span from that day’s first instant to its last in this zone, sent with the offset."},"currency":{"type":["string","null"],"description":"The ISO 4217 code the venue trades in, such as `NOK`, and the currency the Nine Tables app shows an attribute with `display_hint: \"currency\"` in while this restaurant is the one open. Null when none is on file."},"address":{"type":["string","null"],"description":"The street address as the venue entered it, free text in no fixed format. Null when none is on file."},"city":{"type":["string","null"],"description":"The city as the venue entered it, free text. Null when none is on file."},"country":{"type":["string","null"],"description":"The country as an upper-case ISO 3166-1 alpha-2 code, such as `NO` or `SE`. Null when none is on file."},"contact_phone":{"type":["string","null"],"description":"The phone number the venue publishes for guests to call, in E.164 form (`+4722334455`) — the one its booking widget shows, not an owner’s or a staff member’s. Null when none is on file."},"contact_email":{"type":["string","null"],"description":"The email address the venue publishes for guests to write to — the one its booking widget shows beside the phone, not an owner’s or a staff member’s. Null when none is on file."}},"required":["id","name","active","timezone","currency","address","city","country","contact_phone","contact_email"],"description":"One of the tenant’s restaurants — the directory that turns the `restaurant_id` a booking carries into a name a human recognises, the source of the ids `GET /bookings?restaurant_id=` filters on, and the venue facts an integration needs beside them: the time zone its days are read in, the currency it trades in, where it is and how a guest reaches it. Every text member but `name` and `timezone` is null rather than empty when the venue left it blank.","example":{"id":"0198a5b0-1234-7abc-8def-0123456789ab","name":"Bella Vista Downtown","active":true,"timezone":"Europe/Oslo","currency":"NOK","address":"Karl Johans gate 12","city":"Oslo","country":"NO","contact_phone":"+4722334455","contact_email":"downtown@bellavista.example"}},"Area":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The area id — exactly the value a booking’s `requested_area_id` and `GET /availability?area_id=` take, and the `area_id` an availability period and a table carry."},"name":{"type":["string","null"],"description":"What the venue calls the area, in the tenant’s default language, or in another language it was named in when that one has no text. Null when it has no name in any language."},"description":{"type":["string","null"],"description":"The venue’s own description of the area, as its booking widget shows it, in the same language rule as `name`. Null when there is none."},"active":{"type":"boolean","description":"False for an area the venue has removed from its floor plan, which only `include_inactive=true` returns. A removed area cannot be newly sent as `requested_area_id`, while a booking that already names it keeps it."},"booking_priority":{"type":"integer","description":"The venue’s own ranking weight for the area, which Nine Tables reads when it suggests a table for a party; compare it only between areas of one restaurant."},"available_online":{"type":"boolean","description":"True when the venue offers the area to guests booking online: `GET /availability` without `area_id` answers across these areas only."},"uses_own_opening_hours":{"type":"boolean","description":"True when the area keeps a weekly schedule of its own instead of the restaurant’s, so `GET /availability?area_id=` can be open on a day the restaurant is closed and closed on one it is open. False when it follows the restaurant’s hours, its own breaks and special days aside."},"sells_by_table":{"type":"boolean","description":"True when the venue’s booking widget asks guests in this area how many tables they want rather than seating them by party size — the case `table_count` on `GET /availability` and `requested_table_count` on a booking exist for."},"min_table_count":{"type":["integer","null"],"description":"The fewest tables a guest may ask for in this area; null unless `sells_by_table` is true."},"max_table_count":{"type":["integer","null"],"description":"The most tables a guest may ask for in this area; null unless `sells_by_table` is true and the venue sets a maximum."}},"required":["id","name","description","active","booking_priority","available_online","uses_own_opening_hours","sells_by_table","min_table_count","max_table_count"],"description":"One seating area of a restaurant — a dining room, a terrace, a bar — the directory that names the `requested_area_id` a booking carries and the `area_id` `GET /availability` takes. Its name is the venue’s own text, in the tenant’s default language.","example":{"id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e12","name":"Terrace","description":"Heated and covered from October to April.","active":true,"booking_priority":2,"available_online":true,"uses_own_opening_hours":true,"sells_by_table":false,"min_table_count":null,"max_table_count":null}},"Experience":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The experience id — exactly the value `GET /availability?experience_id=` takes."},"name":{"type":["string","null"],"description":"What the venue calls the experience, in the tenant’s default language, or in another language it was named in when that one has no text. Null when it has no name in any language."},"active":{"type":"boolean","description":"False for an experience the venue has switched off, cancelled or removed, which only `include_inactive=true` returns. `GET /availability` refuses such an id on `experience_id`."},"listed_online":{"type":"boolean","description":"True when the venue’s booking widget lists the experience; false for a private one, which guests reach by a direct link only. `GET /availability` answers both alike."},"multi_area":{"type":"boolean","description":"True for an experience that moves the party through several areas in turn, such as drinks in the bar before dinner in the dining room, each stage with its own length."},"duration_minutes":{"type":["integer","null"],"description":"How long a sitting of this experience holds the table, in minutes; null for a `multi_area` one. The slots of `GET /availability?experience_id=` carry the length to book."},"min_party_size":{"type":["integer","null"],"description":"The smallest party the experience is sold to, null when it sets no minimum. A smaller party answers `closed_reason: \"experience_party_size_out_of_range\"` on `GET /availability`."},"max_party_size":{"type":["integer","null"],"description":"The largest party the experience is sold to, null when it sets no maximum. A larger party answers `closed_reason: \"experience_party_size_out_of_range\"` on `GET /availability`."}},"required":["id","name","active","listed_online","multi_area","duration_minutes","min_party_size","max_party_size"],"description":"One experience or package a restaurant sells — a tasting menu, a seasonal event — with what an integration needs to offer it and ask `GET /availability` for its sittings. The dates and times it runs are not listed here: `GET /availability` with its `experience_id` answers them per date.","example":{"id":"0198a5b0-5e6f-7a10-8b21-7c8d9e0f1a23","name":"Seven-course tasting menu","active":true,"listed_online":true,"multi_area":false,"duration_minutes":180,"min_party_size":2,"max_party_size":8}},"BatchResult":{"type":"object","properties":{"index":{"type":"integer","description":"The 0-based position in the request’s `items` array of the item this result belongs to. Results are returned in request order, so `results[i].index` is `i`."},"status":{"type":"integer","description":"The status the same write would have answered as a single `PATCH …/attributes`: `200` when the item applied, otherwise its `problem`’s status. The call itself answers `200` whatever this says, so branch on this member."},"entity":{"type":"string","enum":["customer","booking"],"description":"The item’s `entity`, echoed as you sent it and never inferred or corrected."},"ref":{"type":"string","description":"The item’s `ref`, echoed verbatim: never normalised, case-folded or replaced by the id it resolved to."},"values":{"allOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"},{"description":"Present only when `status` is `200`: the post-write echo, the whole record with `attributes:read` and otherwise only the keys this item wrote."}]},"problem":{"allOf":[{"$ref":"#/components/schemas/ProblemBody"},{"description":"Present only when `status` is not `200`: the item’s complete problem body, the same bytes the single write would have answered."}]}},"required":["index","status","entity","ref"],"description":"One item’s outcome, in the same position as the item that produced it. Exactly one of `values` (the post-write echo) and `problem` (the refusal) is present, decided by `status`; see https://developer.ninetables.io/guides/writing-attributes/#writing-many-records-with-post-batch.","example":{"index":0,"status":200,"entity":"customer","ref":"pos_x:cust-889","values":{"company_name":{"value":"Acme AS","updated_at":"2026-08-20T11:41:09.884000Z","source":"api"}}}},"BatchBody":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/BatchItem"},"minItems":1,"maxItems":100,"description":"The writes, applied in this order; `results[i]` is the outcome of `items[i]`. Each item costs one rate-limit token, so an array longer than your key’s `rate_limit_per_min` is refused `schema_invalid` on `items`."}},"required":["items"],"additionalProperties":false,"description":"The body of `POST /batch`: attribute writes across many customers and bookings in one round trip, which is not a transaction. Items commit individually and the call answers `200` regardless, so read each `results[].status`. See https://developer.ninetables.io/guides/writing-attributes/#writing-many-records-with-post-batch.","example":{"items":[{"entity":"customer","ref":"pos_x:cust-889","values":{"company_name":"Acme AS"}},{"entity":"booking","ref":"pos_x:order-777","values":{"spend":450}}]}},"BatchItem":{"type":"object","properties":{"entity":{"type":"string","enum":["customer","booking"],"description":"Which kind of record `ref` names, never inferred: it picks the table `ref` is looked up in and the definitions `values` resolve against. The wrong one answers `404` or `entity_mismatch`, never a write to the wrong record."},"ref":{"anyOf":[{"$ref":"#/components/schemas/EntityRef"}],"description":"The record to write, held to the same rules as an `EntityRef` path segment, so resolve other identifiers to a UUID with `POST /customers/resolve` first. It is echoed verbatim on the result."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesRecord"}],"description":"What to write on this record (`ValuesRecord`), atomic within the item only: each item is its own transaction."},"expect":{"anyOf":[{"$ref":"#/components/schemas/ExpectRecord"}],"description":"Optional guard on this item’s record (`ExpectRecord`): a stale token refuses this item with `409` while the rest still apply."}},"required":["entity","ref","values"],"additionalProperties":false,"description":"One write inside `POST /batch`: a `PATCH …/attributes` addressed by `entity` and `ref`. Items apply in array order, one transaction each, so listing a record twice applies both writes in order. See https://developer.ninetables.io/guides/writing-attributes/#writing-many-records-with-post-batch.","example":{"entity":"customer","ref":"pos_x:cust-889","values":{"company_name":"Acme AS"}}},"SegmentListItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The segment id — what `GET /segments/{id}`, `/count` and `/customers` take, and what a webhook subscription’s `segment_id` filter names."},"name":{"type":"string","description":"The segment’s display name, as it reads in the Nine Tables app. Nothing enforces uniqueness, so address a segment by `id`."},"kind":{"type":"string","enum":["dynamic","fixed"],"description":"`dynamic` serves its rules evaluated live, so membership moves as customer data does, and `fixed` a frozen list. Only a dynamic segment can back a webhook subscription. See https://developer.ninetables.io/guides/segments/#dynamic-and-fixed-segments."},"archived_at":{"type":["string","null"],"format":"date-time","description":"When the segment was archived, or null while it is live. An archived segment is still readable, but its `/count` and `/customers` answer 404 `segment-archived`."},"updated_at":{"type":"string","format":"date-time","description":"When the segment row last changed: an edit to its name, description, rules or archived state, or a webhook starting or stopping coverage of it. It does NOT move as membership changes, so the entered/exited webhooks, not this member, track membership."}},"required":["id","name","kind","archived_at","updated_at"],"description":"A segment as `GET /segments` lists it, enough to choose one and address it, without its rules. `GET /segments/{id}` returns the same members plus `description`, `rules` and `created_at`.","example":{"id":"0198a5b1-2a44-7e10-9c31-5b6e7f801234","name":"High spenders","kind":"dynamic","archived_at":null,"updated_at":"2026-08-19T17:02:27.273000Z"}},"Segment":{"allOf":[{"$ref":"#/components/schemas/SegmentListItem"},{"type":"object","properties":{"description":{"type":["string","null"],"description":"The note whoever built the segment wrote for their colleagues, or null. Free text for humans, which nothing in the API reads."},"rules":{"anyOf":[{"$ref":"#/components/schemas/SegmentRules"}],"description":"The rule tree a dynamic segment’s membership is evaluated from; a fixed segment serves its frozen member list whatever the tree says."},"created_at":{"type":"string","format":"date-time","description":"When the segment was created."}},"required":["description","rules","created_at"]}],"description":"One segment with its rules, which `GET /segments/{id}` alone publishes. Segments are created and edited in the Nine Tables app, and this API only reads them.","example":{"id":"0198a5b1-2a44-7e10-9c31-5b6e7f801234","name":"High spenders","kind":"dynamic","archived_at":null,"updated_at":"2026-08-19T17:02:27.273000Z","description":"Customers whose lifetime spend exceeds 5 000 NOK.","rules":{"version":1,"groups":[{"conditions":[{"kind":"attribute","definition_key":"lifetime_spend","operator":"gt","value":5000},{"kind":"booking","count_operator":"gte","count":2,"window":{"type":"last_days","days":365},"filters":[{"field":"status","operator":"in","value":["completed"]}]}]}]},"created_at":"2026-08-12T10:31:00.000000Z"}},"SegmentRules":{"type":"object","properties":{"version":{"type":"number","enum":[1],"description":"Rule-format version. Only `1` exists; a future format would ship a new value rather than reshape this one."},"groups":{"type":"array","items":{"$ref":"#/components/schemas/SegmentConditionGroup"},"minItems":1,"maxItems":10,"description":"The alternatives, ANY of which admits a customer: OR over groups and AND within one, with nothing deeper. See https://developer.ninetables.io/guides/segments/#reading-a-segments-rules."}},"required":["version","groups"],"description":"A segment’s membership rule: groups are OR-ed and the conditions inside a group AND-ed, with no deeper nesting and no NOT (an operator such as `neq`, `not_in` or `is_not_set` negates). A fixed segment’s rules are those its frozen list was taken from, and do not re-evaluate it. See https://developer.ninetables.io/guides/segments/#dynamic-and-fixed-segments."},"SegmentConditionGroup":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/SegmentCondition"},"minItems":1,"maxItems":20,"description":"The conditions ALL of which a customer must satisfy to match through this group, in no meaningful order. An empty group is refused rather than read as \"everyone\"."}},"required":["conditions"],"description":"Conditions within one group are AND-ed."},"SegmentCondition":{"oneOf":[{"$ref":"#/components/schemas/SegmentAttributeCondition"},{"$ref":"#/components/schemas/SegmentBookingCondition"},{"$ref":"#/components/schemas/SegmentTagCondition"}],"discriminator":{"propertyName":"kind","mapping":{"attribute":"#/components/schemas/SegmentAttributeCondition","booking":"#/components/schemas/SegmentBookingCondition","tag":"#/components/schemas/SegmentTagCondition"}},"description":"One condition. Dispatch on `kind`."},"SegmentAttributeCondition":{"type":"object","properties":{"kind":{"type":"string","enum":["attribute"],"description":"Marks this condition as the attribute variant of `SegmentCondition` — it is the discriminator, so read it before any other member. `attribute` means the condition is about one customer attribute’s stored value."},"definition_key":{"type":"string","description":"Key of a live CUSTOMER attribute — the same key `GET /definitions` lists."},"operator":{"anyOf":[{"$ref":"#/components/schemas/SegmentAttributeOperator"}],"description":"How `definition_key`’s value is tested, from the `SegmentAttributeOperator` vocabulary. How the operators treat unset values, case, time zones and day counts is at https://developer.ninetables.io/guides/segments/#reading-a-segments-rules."},"value":{"description":"The operand, shaped by the operator: a scalar for the comparisons, a `[from, to]` pair for `between`, a list for `in`/`not_in`/`contains_*`, a day count for the relative-date operators, and absent for `is_set`/`is_not_set`/`is_empty`."},"key":{"type":"string","maxLength":64,"description":"counter_list only: the single counter key the condition is about. Required by `key_count_gte`/`key_count_lte` and the two `key_last_at_*` operators."},"group_key":{"type":"string","maxLength":64,"description":"counter_list `key_in_group` only: the `key` of one of the definition’s `options.groups`, matching a customer who holds any key that group lists in `item_keys`. A `group_key` naming no declared group is refused."},"n":{"type":"number","description":"The threshold for `key_count_gte`/`key_count_lte`/`total_count_gte`."},"days":{"type":"integer","minimum":1,"maximum":36500,"description":"The window for `key_last_at_more_than_days_ago` / `key_last_at_in_last_days`."}},"required":["kind","definition_key","operator"],"description":"A condition on one customer attribute. The extra operand members are operator-specific: `value` for the general ones, and `key`/`group_key`/`n`/`days` for the counter_list family, which cannot express its operands through `value` alone.","example":{"kind":"attribute","definition_key":"lifetime_spend","operator":"gt","value":5000}},"SegmentAttributeOperator":{"type":"string","enum":["after","anniversary_in_month","anniversary_next_days","anniversary_today","before","between","contains","contains_all","contains_any","contains_none","ends_with","eq","gt","gte","in","in_last_days","in_next_days","is_empty","is_false","is_not_set","is_set","is_true","key_count_gte","key_count_lte","key_in_group","key_last_at_in_last_days","key_last_at_more_than_days_ago","lt","lte","more_than_days_ago","more_than_days_ahead","neq","not_contains","not_in","starts_with","total_count_gte"],"description":"Operators a customer-attribute condition may use. Which are legal on a given condition follows from the referenced definition’s `data_type`, and a rule saved with an illegal pairing is refused at write time: `text` → eq, neq, contains, not_contains, starts_with, ends_with, in, is_set, is_not_set; `number` → eq, neq, gt, gte, lt, lte, between, is_set, is_not_set; `boolean` → is_true, is_false, is_not_set; `date` → before, after, between, in_last_days, in_next_days, more_than_days_ago, more_than_days_ahead, anniversary_today, anniversary_next_days, anniversary_in_month, is_set, is_not_set; `datetime` → before, after, between, in_last_days, in_next_days, more_than_days_ago, more_than_days_ahead, anniversary_today, anniversary_next_days, anniversary_in_month, is_set, is_not_set; `select` → in, not_in, is_set, is_not_set; `multi_select` → contains_any, contains_all, contains_none, is_empty, is_set, is_not_set; `counter_list` → key_count_gte, key_count_lte, key_in_group, key_last_at_more_than_days_ago, key_last_at_in_last_days, total_count_gte, is_set, is_not_set."},"SegmentBookingCondition":{"type":"object","properties":{"kind":{"type":"string","enum":["booking"],"description":"Marks this condition as the booking variant of `SegmentCondition` — the discriminator to read first. `booking` means the condition counts bookings rather than inspecting a stored customer value."},"count_operator":{"type":"string","enum":["gte","lte","eq"],"description":"How the matched-booking count is compared with `count`: `gte` at least, `lte` at most and `eq` exactly, with no `gt` or `lt`. `lte` and `eq` are how a rule says \"has not booked\", since the format has no NOT."},"count":{"type":"integer","minimum":0,"description":"The threshold the matched-booking count is compared against. Zero is the useful edge: with `eq` or `lte` it means \"no matching booking at all\" and is the idiomatic negation, while `gte 0` is REFUSED at write time because every customer satisfies it and a segment that matches everyone is a mistake rather than a rule."},"window":{"$ref":"#/components/schemas/SegmentBookingWindow"},"filters":{"type":"array","items":{"$ref":"#/components/schemas/SegmentBookingFilter"},"maxItems":10,"description":"Narrowings on which bookings are counted, AND-ed with each other and with the `window`; omitted or empty counts every booking in it. Cancellations and no-shows count unless a `status` filter leaves them out, and deleted bookings never count."}},"required":["kind","count_operator","count","window"],"description":"A condition on how many of the customer’s bookings match. `gte 0` is refused as vacuously true — negation is `eq 0` / `lte 0`.","example":{"kind":"booking","count_operator":"eq","count":0,"window":{"type":"next_days","days":365}}},"SegmentBookingWindow":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["all_time"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["last_days"]},"days":{"type":"integer","minimum":1,"maximum":36500}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["next_days"]},"days":{"type":"integer","minimum":1,"maximum":36500}},"required":["type","days"]}],"description":"Which bookings count, by start time: all of them, or those in the last or next `days` days measured from when the segment is evaluated, so the window rolls and membership moves with time alone. It is the only way a booking condition speaks about time, `start_time` being no `SegmentBookingFilter` field."},"SegmentBookingFilter":{"type":"object","properties":{"field":{"type":"string","enum":["status","guest_count","restaurant_id"],"description":"A booking CORE field. `start_time` is NOT one of them here — a segment expresses time through the condition’s `window`, not through a filter."},"attribute_key":{"type":"string","description":"Key of a live BOOKING attribute to filter on instead."},"operator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","between","in","not_in","is_set","is_not_set"],"description":"`status` takes `in`/`not_in` over `BookingStatus`, `guest_count` the numeric comparisons and `between`, and `restaurant_id` `in`. An `attribute_key` filter takes what its `data_type` allows, and `is_set`/`is_not_set` on every type."},"value":{"description":"The operand, shaped by the operator rather than by the field: an ARRAY of `BookingStatus` for `status` `in`/`not_in`, an array of restaurant UUIDs for `restaurant_id` `in`, a number for the `guest_count` comparisons, a `[from, to]` pair for `between`, and absent for `is_set`/`is_not_set`. For an `attribute_key` filter it follows that booking attribute’s `data_type`, exactly as `SegmentAttributeCondition.value` does for a customer attribute."}},"required":["operator"],"description":"One AND-combined narrowing of which bookings the surrounding condition counts. EXACTLY one of `field` / `attribute_key` is present.","example":{"field":"status","operator":"in","value":["completed"]},"oneOf":[{"required":["field"]},{"required":["attribute_key"]}]},"SegmentTagCondition":{"type":"object","properties":{"kind":{"type":"string","enum":["tag"],"description":"Marks this condition as the tag variant of `SegmentCondition` — the discriminator to read first. `tag` means the condition is about guest tags, which this API neither reads nor writes anywhere else."},"operator":{"type":"string","enum":["has_any","has_all","has_none"],"description":"How `tag_ids` is quantified: `has_any` at least one, `has_all` every one, and `has_none` none, which is how a tag rule is negated. Order and duplicates in `tag_ids` carry no meaning."},"tag_ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":50,"description":"The guest tags the condition is about, by ids no route on this API resolves to a name. What a tag deleted since the rule was saved does is at https://developer.ninetables.io/guides/segments/#reading-a-segments-rules."}},"required":["kind","operator","tag_ids"],"description":"A condition on the guest tags a restaurant applies in the Nine Tables app. Tags are not exposed by this API, so the ids are opaque here.","example":{"kind":"tag","operator":"has_any","tag_ids":["0198a5b1-4d21-7c08-b933-2a71c8f0e441"]}},"SegmentMembersPage":{"allOf":[{"$ref":"#/components/schemas/PaginationEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SegmentMemberRow"}}}}],"description":"One page of a segment’s members, ordered by customer id ascending, or with `sort` by that attribute and then id.","example":{"data":[],"next_cursor":null,"has_more":false}},"SegmentMemberRow":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The customer id: a valid `{customerRef}` for every customer route, and the value this page is ordered and cursored on."},"source_system":{"type":["string","null"],"description":"The system you named in `?source_system=`, lower-cased, when this member holds a key from it; null when you named none or the member holds no key from yours."},"source_key":{"type":["string","null"],"description":"The key your named system holds on this member, verbatim — it is never case-folded. Null exactly when `source_system` is."},"created_at":{"type":"string","format":"date-time","description":"When Nine Tables first recorded the guest, which never changes. A guest an import brought in carries the time of the import, not of an earlier visit."},"has_email":{"type":"boolean","description":"Whether this member has an e-mail address on file, neither null nor empty. It sizes an e-mail campaign without disclosing the address."},"has_phone":{"type":"boolean","description":"Whether this member has a phone number on file, neither null nor empty. The same presence-without-disclosure signal as `has_email`."},"firstname":{"type":["string","null"],"description":"Present only with `include=contact`. The member’s first name, or null when none is on file."},"lastname":{"type":["string","null"],"description":"Present only with `include=contact`. The member’s surname, or null when none is on file."},"email":{"type":["string","null"],"description":"Present only with `include=contact`. Null when the member has no address on file, the case `has_email` already reports."},"phone":{"type":["string","null"],"description":"Present only with `include=contact`. Null when the member has no number on file, the case `has_phone` already reports."},"marketing_consent":{"anyOf":[{"$ref":"#/components/schemas/MarketingConsent"},{"type":"null"}],"description":"Present only with `include=contact`. The guest’s current marketing consent, or null when they have given none or withdrawn it."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"}],"description":"Present only with `include=attributes`. The member’s attribute values keyed by definition key, each with its own `updated_at` and `source`."}},"required":["id","source_system","source_key","created_at","has_email","has_phone"],"description":"One member customer of a segment: identity, `created_at` and contact-presence flags by default, with contact details, marketing consent and attribute values behind `include=`. A member you did not ask for is ABSENT rather than null, so test for presence.","example":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","has_email":true,"has_phone":true}},"WebhookSubscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The subscription id: the `{id}` of every `/webhooks/{id}` route, and where the `Location` of the 201 points."},"url":{"type":"string","description":"The endpoint deliveries are POSTed to, stored with surrounding whitespace trimmed and nothing else rewritten. `WebhookCreateBody.url` states the endpoint rules."},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"},"description":"The event types this endpoint receives, at least one; a type absent here is never delivered to it. Each family needs the read scopes `ApiScope` lists for it, because a delivery carries what that read serves."},"segment_id":{"type":["string","null"],"format":"uuid","description":"The one dynamic segment whose `segment.customer.*` events this subscription receives, or null for every dynamic segment the tenant has, ones created later included. It filters no other family."},"restaurant_id":{"type":["string","null"],"format":"uuid","description":"The one restaurant whose `booking.*` events this subscription receives, matched against the booking’s own `restaurant_id`, or null for every restaurant, ones opened later included. It filters no other family, and a key limited to some restaurants sees only the subscriptions filtered to one of them."},"source_system":{"type":["string","null"],"description":"The external system this subscriber is, lower-cased on write: a delivery discloses `source_system`/`source_key` only for the key this system holds on the record, and null declares nothing, so nothing is disclosed. See https://developer.ninetables.io/guides/webhooks/#declaring-your-system."},"emit_initial":{"type":"boolean","description":"Whether each covered segment’s first membership sample sends `segment.customer.entered` for every current member, paged over consecutive samples, rather than only for members who change from then on. It needs a `segment.customer.*` event in `events` and fires once per covered segment, which `initial_emitted_at` records."},"initial_emitted_at":{"type":["string","null"],"format":"date-time","description":"When the initial backfill first fired, written by the server, or null while it has not. Neither re-activating nor turning `emit_initial` on again replays a segment that had one; delete and re-create the subscription to replay."},"include_contact":{"type":"boolean","description":"Whether the customer of a segment or customer delivery, and the guest `include_customer` embeds, carries `email`, `phone` and `marketing_consent`, which are absent rather than null while it is false. `customer.deleted` never carries them."},"include_customer":{"type":"boolean","description":"Whether a `booking.created` or `booking.updated` delivery carries the guest as `data.customer`, null when the booking has none or `GET /customers/{customerRef}` answers 404 for the guest, rather than `booking.customer_id` alone. It needs one of those two events in `events`."},"active":{"type":"boolean","description":"Whether events are delivered: you set it, and the platform clears it when deliveries keep failing for 12 hours or the endpoint answers `410 Gone`, as `disabled_reason` says. While it is false events are held, each for 30 days, and re-activating delivers them; see https://developer.ninetables.io/guides/webhooks/#paused-and-disabled-subscriptions."},"consecutive_failures":{"type":"integer","description":"Failed delivery attempts since the last success, counted per attempt rather than per event and reset to 0 by any success. Watch it with `failing_since` to see an auto-disable coming."},"failing_since":{"type":["string","null"],"format":"date-time","description":"When the current stretch of failing deliveries began, or null while they succeed; a gap of more than 7 hours between failures starts a new stretch. At 12 hours the platform disables the subscription with `disabled_reason: \"failing\"`."},"disabled_at":{"type":["string","null"],"format":"date-time","description":"When the platform disabled this subscription, or null otherwise, including when you set `active: false` yourself. Cleared when you re-activate."},"disabled_reason":{"type":["string","null"],"enum":["failing","gone",null],"description":"`failing` when deliveries kept failing for 12 hours, `gone` when the endpoint answered `410 Gone`, and null exactly when `disabled_at` is. Cleared when you re-activate."},"created_at":{"type":"string","format":"date-time","description":"When the subscription was registered."},"updated_at":{"type":"string","format":"date-time","description":"When any member of this row last changed, an auto-disable included. An empty `PATCH` writes nothing and does not move it."},"last_capped_at":{"type":["string","null"],"format":"date-time","description":"When events for this endpoint were last dropped because one statement changed more records than `booking_events_per_subscription_per_write` or `customer_events_per_subscription_per_write` allows, or null. `updated_since` set to this time on `GET /bookings` or `GET /customers` returns what that statement changed."}},"required":["id","url","events","segment_id","restaurant_id","source_system","emit_initial","initial_emitted_at","include_contact","include_customer","active","consecutive_failures","failing_since","disabled_at","disabled_reason","created_at","updated_at","last_capped_at"],"description":"A registered webhook endpoint and its delivery state, never its signing secret. You own `url`, `events`, the two filters, `source_system`, `emit_initial`, `include_contact` and `include_customer`, and the server writes the rest, `active` too when it disables the subscription. See https://developer.ninetables.io/guides/webhooks/#the-subscription-object.","example":{"id":"0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f","url":"https://example.com/nine-tables-hook","events":["segment.customer.entered","segment.customer.exited"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"initial_emitted_at":null,"include_contact":false,"include_customer":false,"active":true,"consecutive_failures":0,"disabled_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z","last_capped_at":null,"failing_since":null,"disabled_reason":null}},"WebhookSubscriptionCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookSubscription"},{"type":"object","properties":{"secret":{"type":"string","description":"The HMAC-SHA256 signing secret, returned only here and by rotate-secret, so store it now."}},"required":["secret"]}],"description":"The 201 body of `POST /webhooks`: the new subscription, plus the only disclosure of its signing `secret` besides `POST /webhooks/{id}/rotate-secret`. Every later read of the subscription is secret-free.","example":{"id":"0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f","url":"https://example.com/nine-tables-hook","events":["segment.customer.entered","segment.customer.exited"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"initial_emitted_at":null,"include_contact":false,"include_customer":false,"active":true,"consecutive_failures":0,"disabled_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z","last_capped_at":null,"failing_since":null,"disabled_reason":null,"secret":"whsec_ZXhhbXBsZS1zZWNyZXQtZG8tbm90LXVzZS1wcm9kLTE="}},"WebhookCreateBody":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","pattern":"^\\s*https://\\S+\\s*$","example":"https://example.com/nine-tables-hook","description":"An HTTPS URL whose host resolves only to globally routable unicast addresses, checked here and again before every delivery, with no credentials and no whitespace inside it. The full rules are at https://developer.ninetables.io/guides/webhooks/#the-endpoint-url."},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"},"minItems":1,"description":"The event types to deliver, at least one from `WebhookEventType` in any mix; each family needs the read scopes `ApiScope` lists for it, or the request answers 403. A key limited to some restaurants cannot name a `segment.customer.*` event, which answers 400 on this member."},"segment_id":{"type":["string","null"],"format":"uuid","description":"Narrows the `segment.customer.*` events to one live dynamic segment, and null or omitted covers every dynamic segment. A fixed or archived segment answers 400 on this member, and so does one this tenant does not hold or the key’s restaurant limit hides."},"restaurant_id":{"type":["string","null"],"format":"uuid","description":"Narrows the `booking.*` events to one restaurant, and null or omitted covers every restaurant, ones opened later included. A restaurant this tenant does not hold answers 400, and a key limited to some restaurants must name one of them."},"source_system":{"type":["string","null"],"minLength":1,"maxLength":128,"pattern":"\\S","description":"The external system this subscriber is, lower-cased on write: a delivery discloses `source_system`/`source_key` only for the key this system holds on the record, and null declares nothing, so nothing is disclosed. See https://developer.ninetables.io/guides/webhooks/#declaring-your-system."},"emit_initial":{"type":"boolean","description":"Backfills `segment.customer.entered` for every current member of each covered segment on its first membership sample, and defaults to false. `true` without a `segment.customer.*` event in `events` answers 400."},"include_contact":{"type":"boolean","description":"Adds `email`, `phone` and `marketing_consent` to the customer of segment and customer deliveries and to the guest `include_customer` embeds, never to `customer.deleted`, and defaults to false. `true` needs the read scopes `ApiScope` lists for it."},"include_customer":{"type":"boolean","description":"Embeds the guest in `booking.created` and `booking.updated` deliveries as `data.customer`, and defaults to false. `true` answers 400 without one of those events in `events`, and needs the read scopes `ApiScope` lists for it."}},"required":["url","events"],"additionalProperties":false,"description":"The body of `POST /webhooks`: `url` and `events` are required and every other member has a default, while an unknown member is refused rather than ignored. A tenant holds at most 10 subscriptions.","example":{"url":"https://example.com/nine-tables-hook","events":["segment.customer.entered","booking.updated"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"include_contact":false,"include_customer":false}},"WebhookPatchBody":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","pattern":"^\\s*https://\\S+\\s*$","description":"Replaces the endpoint, validated here exactly as on create, before anything is stored. It neither resets `consecutive_failures` nor re-activates the subscription."},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"},"minItems":1,"description":"Replaces the event list wholesale, at least one member; removing an event drops its queued deliveries, and its old ones can no longer be redelivered. A list that adds an event needs the read scopes of the subscription the PATCH leaves."},"segment_id":{"type":["string","null"],"format":"uuid","description":"Re-points the segment filter to one dynamic segment, or null for every dynamic segment. A fixed or archived segment answers 400 on this member, and so does one this tenant does not hold or the key’s restaurant limit hides."},"restaurant_id":{"type":["string","null"],"format":"uuid","description":"Re-points the booking filter to one restaurant, or null for every restaurant, for the events enqueued after the patch. A restaurant this tenant does not hold answers 400, and a key limited to some restaurants may only name another of them."},"source_system":{"type":["string","null"],"minLength":1,"maxLength":128,"pattern":"\\S","description":"The external system this subscriber is, lower-cased on write: a delivery discloses `source_system`/`source_key` only for the key this system holds on the record, and null declares nothing, so nothing is disclosed. See https://developer.ninetables.io/guides/webhooks/#declaring-your-system."},"emit_initial":{"type":"boolean","description":"Arms or disarms the backfill for future samples, and never replays a segment `initial_emitted_at` says was sent. `true` answers 400 when the subscription would be left with no `segment.customer.*` event."},"include_contact":{"type":"boolean","description":"Turns the contact members on or off wherever a delivery carries a customer. Off also strips them from every delivery already queued, delivered ones included, while on applies to the events queued after the patch."},"include_customer":{"type":"boolean","description":"Turns the embedded guest on or off, and `true` answers 400 when the subscription would be left without `booking.created` or `booking.updated`. Off also removes `data.customer` from every booking delivery already queued, delivered ones included, while on applies to the events queued after the patch."},"active":{"type":"boolean","description":"`false` pauses deliveries while events keep being queued, each kept 30 days, and `true` delivers them and clears the failure state. `POST /webhooks/{id}/test` reaches the URL either way."}},"additionalProperties":false,"description":"The body of `PATCH /webhooks/{id}`: a merge of the members you send, so a body of none writes nothing and returns the subscription untouched. Unknown members and the server-written ones are refused rather than ignored, and `null` on a filter widens that family back to everything.","example":{"url":"https://example.com/hooks/nine-tables/v2","active":true}},"DeliveryFailureSymbol":{"type":"string","enum":["timeout","dns","tls","connect","unknown"],"description":"Why a delivery never reached the endpoint: `dns`, `connect`, `tls`, `timeout` (no answer within 10 seconds) or `unknown`. An answer outside 2xx is a status code, not a symbol; see https://developer.ninetables.io/guides/webhooks/#the-test-delivery."},"WebhookDeliveriesPage":{"allOf":[{"$ref":"#/components/schemas/PaginationEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryLogEntry"}}}}],"description":"One page of a subscription’s deliveries, newest first.","example":{"data":[],"next_cursor":null,"has_more":false}},"WebhookDeliveryLogEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery id: the `id` of the delivered body and its `webhook-id` header, and the `{deliveryId}` the delivery and redeliver routes take."},"event_type":{"$ref":"#/components/schemas/WebhookEventType"},"created_at":{"type":"string","format":"date-time","description":"When the event was recorded — the `created_at` of the delivered body."},"status":{"$ref":"#/components/schemas/WebhookDeliveryStatus"},"next_attempt_at":{"type":["string","null"],"format":"date-time","description":"When the next attempt of a `pending` delivery is due, which one held by an inactive subscription waits past until it is resumed. Null once it is delivered or failed."},"delivered_at":{"type":["string","null"],"format":"date-time","description":"When an attempt answered 2xx; null unless `status` is `delivered`."},"failed_at":{"type":["string","null"],"format":"date-time","description":"When the platform stopped retrying; null unless `status` is `failed`."},"last_error":{"anyOf":[{"type":"string","enum":["timeout","dns","tls","connect","unknown"]},{"type":"string","pattern":"^HTTP \\d{3}$"},{"type":"null"}],"description":"Why the latest attempt did not deliver: `HTTP <status>` or a `DeliveryFailureSymbol`. Null once delivered and before the first attempt."},"attempts":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryAttempt"},"description":"Every recorded attempt, in `attempt_no` order; empty before the first."}},"required":["id","event_type","created_at","status","next_attempt_at","delivered_at","failed_at","last_error","attempts"],"description":"One delivery of a subscription, with its attempts. It carries no body; `GET /webhooks/{id}/deliveries/{deliveryId}` adds it.","example":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","event_type":"booking.updated","created_at":"2026-08-19T17:02:27.273000Z","status":"delivered","next_attempt_at":null,"delivered_at":"2026-08-19T17:04:28.913000Z","failed_at":null,"last_error":null,"attempts":[{"attempt_no":1,"attempted_at":"2026-08-19T17:02:28.402000Z","status":503,"duration_ms":214,"response_excerpt":"Service Unavailable","transport_error":null},{"attempt_no":2,"attempted_at":"2026-08-19T17:04:28.913000Z","status":200,"duration_ms":96,"response_excerpt":null,"transport_error":null}]}},"WebhookDeliveryStatus":{"type":"string","enum":["pending","delivered","failed"],"description":"`pending` — not yet delivered and not given up: queued, retrying after a failed attempt, or held while the subscription is inactive. `delivered` — an attempt answered 2xx. `failed` — the retry schedule ran out, and a redelivery starts it again."},"WebhookDeliveryAttempt":{"type":"object","properties":{"attempt_no":{"type":"integer","description":"Which attempt of this delivery this was, counting from 1. A redelivery keeps counting rather than starting again, so the numbers stay unique per delivery."},"attempted_at":{"type":"string","format":"date-time","description":"When the attempt finished."},"status":{"type":["integer","null"],"description":"The HTTP status the endpoint answered, or null when no response arrived — then `transport_error` says why."},"duration_ms":{"type":["integer","null"],"description":"How long the request took, from leaving Nine Tables to the response or the transport failure."},"response_excerpt":{"type":["string","null"],"description":"The start of the endpoint’s response body, at most 512 characters — where the reason for a refusal is usually written. Null when the body was empty or no response arrived."},"transport_error":{"anyOf":[{"$ref":"#/components/schemas/DeliveryFailureSymbol"},{"type":"null"}],"description":"Why no response arrived, as a `DeliveryFailureSymbol`; null when the endpoint answered, whatever the status."}},"required":["attempt_no","attempted_at","status","duration_ms","response_excerpt","transport_error"],"description":"One POST of a delivery to the endpoint, as the dispatcher recorded it. Attempts are kept 30 days each, so a delivery retried for longer lists only its recent ones."},"WebhookDeliveryDetail":{"allOf":[{"$ref":"#/components/schemas/WebhookDeliveryLogEntry"},{"type":"object","properties":{"body":{"type":"object","additionalProperties":{},"description":"The JSON body this delivery carries, member for member and in the order the dispatcher renders it, with the subscription’s current `include_contact` and `include_customer` applied as the dispatcher applies them: what the next attempt or a redelivery sends. Turning either off strips its members from a body already sent, and an erased guest’s customer or segment delivery is shown as the erasure left it. The signed bytes are the compact serialization the dispatcher produced, so verify a signature over the bytes that arrived rather than over this member re-serialized; see https://developer.ninetables.io/guides/webhooks/#verifying-a-delivery.","anyOf":[{"$ref":"#/components/schemas/WebhookCustomerDelivery"},{"$ref":"#/components/schemas/WebhookDelivery"},{"$ref":"#/components/schemas/WebhookBookingDelivery"},{"$ref":"#/components/schemas/WebhookBookingDeletedDelivery"},{"$ref":"#/components/schemas/WebhookDefinitionComputedDelivery"},{"type":"object","description":"A customer or segment delivery sent before its guest was erased, as the erasure left it: the envelope without `api_version`, the segment of a segment event, and the guest’s `id` with `anonymized: true`. It is never sent again.","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"$ref":"#/components/schemas/WebhookEventType"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["customer"],"properties":{"segment":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"customer":{"type":"object","required":["id","anonymized"],"properties":{"id":{"type":"string","format":"uuid"},"anonymized":{"const":true}}}}}}}]}},"required":["body"]}],"description":"One delivery of a subscription: its log entry, with every recorded attempt, and the `body` it carries.","example":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","event_type":"booking.updated","created_at":"2026-08-19T17:02:27.273000Z","status":"delivered","next_attempt_at":null,"delivered_at":"2026-08-19T17:04:28.913000Z","failed_at":null,"last_error":null,"attempts":[{"attempt_no":1,"attempted_at":"2026-08-19T17:02:28.402000Z","status":503,"duration_ms":214,"response_excerpt":"Service Unavailable","transport_error":null},{"attempt_no":2,"attempted_at":"2026-08-19T17:04:28.913000Z","status":200,"duration_ms":96,"response_excerpt":null,"transport_error":null}],"body":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","type":"booking.updated","api_version":"1","created_at":"2026-08-19T17:02:27.273000Z","data":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"sample-order-1","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"booking_confirmed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":null,"allergens":["gluten"],"dietary_preferences":[],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"tables":[{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"12","capacity_from":2,"capacity_to":4,"active":true,"booking_priority":10,"shape":"rectangle"}],"changed":["status","guest_count"]}}}},"WebhookRedelivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery id."},"status":{"$ref":"#/components/schemas/WebhookDeliveryStatus"},"attempts":{"type":"integer","description":"The attempts made so far, the ones before this redelivery included."},"next_attempt_at":{"type":["string","null"],"format":"date-time","description":"When the dispatcher picks it up: now, for a delivery this call queued."}},"required":["id","status","attempts","next_attempt_at"],"description":"The delivery as the redelivery left it: `pending` and due now, with a fresh retry schedule ahead of it.","example":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","status":"pending","attempts":2,"next_attempt_at":"2026-08-20T08:15:42.118000Z"}}},"parameters":{}},"paths":{"/me":{"get":{"operationId":"getSelf","tags":["keys"],"security":[{"cdpApiKey":[]}],"summary":"Describe the calling API key","description":"Returns the key on the request: its id (the `Idempotency-Key` dedupe scope), name, prefix, tenant, scopes, restaurant limit and rate limit, and `limits`, every limit this deployment enforces. This API cannot create, rotate or revoke keys. See https://developer.ninetables.io/guides/authentication/#key-lifecycle-issuance-is-deliberately-outside-this-api. Requires no scope.","responses":{"200":{"description":"The calling key.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"key_id":"0198a5b0-4d21-7a10-9c33-6f2b81a5c777","key_name":"pos-x-production","key_prefix":"nt_live_VSTO","tenant_id":"0198a5b0-1234-7abc-8def-0123456789ab","scopes":["attributes:read","attributes:write","definitions:read"],"restaurant_ids":null,"rate_limit_per_min":120,"created_at":"2026-08-19T17:02:27.273000Z","last_used_at":"2026-08-21T00:14:02.763000Z","limits":{"definitions_per_tenant":200,"values_keys_per_request":200,"categories_per_tenant":50,"segments_per_tenant":200,"webhook_subscriptions_per_tenant":10,"options_per_select":200,"option_value_chars":64,"counter_groups_per_definition":50,"counter_item_keys_per_group":200,"counter_key_chars":64,"multi_select_values_per_row":100,"counter_keys_per_row":500,"counter_ops_per_attribute_per_request":100,"groups_per_segment":10,"conditions_per_segment_group":20,"filters_per_condition":10,"list_filters":5,"batch_items_per_request":100,"request_body_bytes":1048576,"idempotent_stored_response_bytes":65536,"idempotency_key_chars":128,"text_value_chars":4096,"source_identity_half_chars":128,"guest_name_chars":255,"member_page_size":100,"segment_count_cap":10000,"segment_count_staleness_seconds":60,"webhook_events_per_segment_per_run":10000,"booking_events_per_subscription_per_write":2000,"customer_events_per_subscription_per_write":2000,"default_rate_limit_per_min":120}},"schema":{"$ref":"#/components/schemas/KeyIntrospection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/categories":{"get":{"operationId":"listCategories","tags":["categories"],"security":[{"cdpApiKey":["definitions:read"]}],"summary":"List attribute categories","description":"Lists the tenant’s attribute categories in display order, unpaginated. Archived categories are left out unless `include_archived=true`. See https://developer.ninetables.io/guides/writing-attributes/#categories. Requires `definitions:read`.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"}],"responses":{"200":{"description":"Every matching category, unpaginated: a tenant holds at most 50 of its own.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"key":"pos_data","label":"POS data","display_order":10,"is_system":false,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"},{"key":"system","label":"Nine Tables attributes","display_order":1000,"is_system":true,"archived_at":null,"created_at":"2026-08-01T08:00:00.000000Z","updated_at":"2026-08-01T08:00:00.000000Z"}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}},"required":["data"]}}}},"400":{"description":"The `include_archived` query parameter was neither `true` nor `false` (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"include_archived-not-a-boolean":{"summary":"GET /categories?include_archived=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_archived","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /categories with a key that lacks `definitions:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createCategory","tags":["categories"],"security":[{"cdpApiKey":["definitions:write"]}],"summary":"Create a category","description":"Creates an attribute category to file definitions under. A tenant holds at most 50 of its own, archived ones included. See https://developer.ninetables.io/guides/writing-attributes/#categories. Requires `definitions:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"key":"pos_data","label":"POS data"},"schema":{"$ref":"#/components/schemas/CategoryCreateBody"}}}},"responses":{"201":{"description":"Created. `Location` points at the new resource.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/categories/pos_data"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"key":"pos_data","label":"POS data","display_order":10,"is_system":false,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"},"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"The body failed schema validation: an unknown member, a bad key charset, or a label over 200 characters (`validation-failed`). Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"label-too-long":{"summary":"POST /categories with a `label` of 250 characters","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"label","code":"schema_invalid","detail":"Too big: expected string to have <=200 characters"}]}},"unknown-member":{"summary":"POST /categories {\"key\": \"pos_data\", \"label\": \"POS data\", \"colour\": \"red\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Unrecognized key: \"colour\""}]}},"body-missing":{"summary":"POST /categories with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /categories with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /categories with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /categories with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /categories with a key that lacks `definitions:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The key is already taken (`conflict-key-exists`), by a live category or by an archived one, which still holds its key. The `detail` says which, since an archived category is restored rather than recreated. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"key-taken-by-a-live-category":{"summary":"POST /categories {\"key\": \"pos_data\", \"label\": \"POS data\"} where pos_data already exists","value":{"type":"https://ninetables.io/problems/conflict-key-exists","title":"Conflict","status":409,"detail":"Category 'pos_data' already exists","code":"CONFLICT_KEY_EXISTS"}},"key-taken-by-an-archived-category":{"summary":"POST /categories {\"key\": \"pos_data\", \"label\": \"POS data\"} where pos_data exists and is archived","value":{"type":"https://ninetables.io/problems/conflict-key-exists","title":"Conflict","status":409,"detail":"Category 'pos_data' exists but is archived — restore it with PATCH /categories/pos_data {\"archived\": false} instead of recreating","code":"CONFLICT_KEY_EXISTS"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/categories/{key}":{"get":{"operationId":"getCategory","tags":["categories"],"security":[{"cdpApiKey":["definitions:read"]}],"summary":"Get one category","description":"Fetches one attribute category by its key, archived or not, which is how to read an archived category the list leaves out. See https://developer.ninetables.io/guides/writing-attributes/#categories. Requires `definitions:read`.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","description":"Category key: lowercase snake_case, max 64 chars.","example":"pos_data"},"required":true,"description":"Category key: lowercase snake_case, max 64 chars.","name":"key","in":"path"}],"responses":{"200":{"description":"The category.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"key":"pos_data","label":"POS data","display_order":10,"is_system":false,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"},"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"The `{key}` path segment is not lowercase snake_case of ≤64 characters (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-key":{"summary":"GET /categories/BAD--KEY","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'BAD--KEY' is not a valid {key} path segment: Invalid string: must match pattern /^[a-z0-9_]{1,64}$/","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /categories/{key} with a key that lacks `definitions:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such category (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such category","code":"NOT_FOUND","resource":"category"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateCategory","tags":["categories"],"security":[{"cdpApiKey":["definitions:write"]}],"summary":"Update, archive, or restore a category","description":"Changes a category’s label or display order, or archives or restores it through `archived`. The built-in `system` category can be neither archived nor relabelled. See https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete. Requires `definitions:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","description":"Category key: lowercase snake_case, max 64 chars.","example":"pos_data"},"required":true,"description":"Category key: lowercase snake_case, max 64 chars.","name":"key","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"archived":true},"schema":{"$ref":"#/components/schemas/CategoryPatchBody"}}}},"responses":{"200":{"description":"The updated category.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"key":"pos_data","label":"Point-of-sale data","display_order":20,"is_system":false,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"},"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"The body failed schema validation (`validation-failed`), or the `{key}` path segment is not lowercase snake_case (`invalid-ref`). Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"label-wrong-type":{"summary":"PATCH /categories/pos_data {\"label\": 12}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"label","code":"schema_invalid","detail":"Invalid input: expected string, received number"}]}},"malformed-key":{"summary":"PATCH /categories/BAD--KEY {\"label\": \"POS data\"}","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'BAD--KEY' is not a valid {key} path segment: Invalid string: must match pattern /^[a-z0-9_]{1,64}$/","code":"INVALID_REF"}},"body-missing":{"summary":"PATCH /categories/{key} with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PATCH /categories/{key} with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PATCH /categories/{key} with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PATCH /categories/{key} with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PATCH /categories/{key} with a key that lacks `definitions:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such category (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such category","code":"NOT_FOUND","resource":"category"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"An archive while the category still holds a non-archived definition (`conflict-archive-blocked`). `blockers[]` names every one, so archive or re-categorise them first. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"archive-blocked-by-definitions":{"summary":"PATCH /categories/pos_data {\"archived\": true} while two of its definitions are live","value":{"type":"https://ninetables.io/problems/conflict-archive-blocked","title":"Conflict","status":409,"detail":"Cannot archive: still referenced by 2 resources — loyalty_tier (definition), visit_count (definition). Every one is listed in `blockers`; archive or re-point them first.","code":"CONFLICT_ARCHIVE_BLOCKED","blockers":[{"kind":"definition","name":"loyalty_tier"},{"kind":"definition","name":"visit_count"}],"hidden_blockers":0}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteCategory","tags":["categories"],"security":[{"cdpApiKey":[]}],"summary":"Not supported — categories are archived, never deleted","description":"Always answers 405. Categories carry attribute history, so a category is archived and restored through `PATCH /categories/{key}` with `{\"archived\": true|false}` instead. See https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete. Requires no scope.","parameters":[{"schema":{"type":"string","pattern":"^[a-z0-9_]{1,64}$","description":"Category key: lowercase snake_case, max 64 chars.","example":"pos_data"},"required":true,"description":"Category key: lowercase snake_case, max 64 chars.","name":"key","in":"path"}],"responses":{"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"405":{"description":"Always. Use PATCH with {\"archived\": true} to archive — this resource cannot be deleted (Allow: GET, HEAD, PATCH) The response carries `Allow: GET, HEAD, PATCH`.","headers":{"Allow":{"description":"Methods this path accepts.","schema":{"type":"string","const":"GET, HEAD, PATCH"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/method-not-allowed","title":"Method Not Allowed","status":405,"detail":"Use PATCH with {\"archived\": true} to archive — this resource cannot be deleted (Allow: GET, HEAD, PATCH)","code":"METHOD_NOT_ALLOWED"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/definitions":{"get":{"operationId":"listDefinitions","tags":["definitions"],"security":[{"cdpApiKey":["definitions:read"]}],"summary":"List attribute definitions","description":"Lists the tenant’s attribute definitions of both entities, unless `entity` narrows it, in display order and unpaginated. Archived definitions are left out unless `include_archived=true`, and switched-off built-ins unless `include_disabled=true`. See https://developer.ninetables.io/guides/computed-attributes/#catalogue. Requires `definitions:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/AttributeEntity"},"required":false,"description":"Which kind of record an attribute is attached to, a guest (`customer`) or a single visit (`booking`), each a separate namespace of keys fixed at creation. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","name":"entity","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` also lists the Nine Tables attributes that are switched off, with `enabled: false`, so the whole catalogue is readable. Left out by default."},"required":false,"description":"`true` also lists the Nine Tables attributes that are switched off, with `enabled: false`, so the whole catalogue is readable. Left out by default.","name":"include_disabled","in":"query"}],"responses":{"200":{"description":"Every matching definition, unpaginated: a tenant holds at most 200 of its own.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"entity":"booking","key":"spend","label":"Spend","description":null,"category":"pos_data","data_type":"number","options":null,"display_hint":"currency","display_order":0,"show_on_customer_card":false,"show_on_booking_panel":true,"ui_writable":true,"api_writable":true,"source":"tenant","enabled":true,"computed":null,"compute_state":null,"archived_at":null,"created_at":"2026-08-18T09:12:44.002000Z","updated_at":"2026-08-18T09:12:44.002000Z"},{"entity":"customer","key":"total_visits","label":"Total visits","description":null,"category":"system","data_type":"number","options":null,"display_hint":null,"display_order":1,"show_on_customer_card":false,"show_on_booking_panel":false,"ui_writable":false,"api_writable":false,"source":"system","enabled":true,"computed":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"all_time"},"filters":[]},"state":"ready","progress":null,"computed_at":"2026-08-20T11:44:52.301000Z","error":null},"compute_state":"ready","archived_at":null,"created_at":"2026-08-18T09:12:44.002000Z","updated_at":"2026-08-20T11:41:09.884000Z"},{"entity":"customer","key":"lifetime_spend","label":"Lifetime spend","description":"Total spend across all completed bookings.","category":"pos_data","data_type":"number","options":null,"display_hint":"currency","display_order":10,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":true,"source":"tenant","enabled":true,"computed":null,"compute_state":null,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"},{"entity":"customer","key":"visits_12m_oslo","label":"Visits in Oslo, last 12 months","description":"Completed visits to the Oslo restaurant in the last 365 days.","category":"visits","data_type":"number","options":null,"display_hint":null,"display_order":30,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":false,"source":"tenant","enabled":true,"computed":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]},"state":"computing","progress":{"processed":1200,"total":4800},"computed_at":null,"error":null},"compute_state":"computing","archived_at":null,"created_at":"2026-08-21T08:02:17.550000Z","updated_at":"2026-08-21T08:02:17.550000Z"}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AttributeDefinition"}}},"required":["data"]}}}},"400":{"description":"The `entity` query parameter is neither `customer` nor `booking`, or `include_archived` or `include_disabled` is neither `true` nor `false` (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"entity-not-an-entity":{"summary":"GET /definitions?entity=bogus","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"entity","code":"schema_invalid","detail":"Invalid option: expected one of \"customer\"|\"booking\""}]}},"include_archived-not-a-boolean":{"summary":"GET /definitions?include_archived=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_archived","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}},"include_disabled-not-a-boolean":{"summary":"GET /definitions?include_disabled=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_disabled","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /definitions with a key that lacks `definitions:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createDefinition","tags":["definitions"],"security":[{"cdpApiKey":["definitions:write"]}],"summary":"Create a definition","description":"Creates an attribute definition, which must exist before any value for it can be written; `entity` rides in the body because `(entity, key)` is its identity. With `computed` it is a computed attribute, answered 202 while the platform fills in its values, and a tenant holds at most 200 definitions of its own, archived ones included. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute. Requires `definitions:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"entity":"customer","key":"lifetime_spend","label":"Lifetime spend","category":"pos_data","data_type":"number"},"schema":{"$ref":"#/components/schemas/DefinitionCreateBody"}}}},"responses":{"201":{"description":"Created. `Location` points at the new resource.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/definitions/booking/spend"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"entity":"booking","key":"spend","label":"Spend","description":null,"category":"pos_data","data_type":"number","options":null,"display_hint":"currency","display_order":0,"show_on_customer_card":false,"show_on_booking_panel":true,"ui_writable":true,"api_writable":true,"source":"tenant","enabled":true,"computed":null,"compute_state":null,"archived_at":null,"created_at":"2026-08-18T09:12:44.002000Z","updated_at":"2026-08-18T09:12:44.002000Z"},"schema":{"$ref":"#/components/schemas/AttributeDefinition"}}}},"202":{"description":"Created with a rule: `Location` points at the new resource, and `computed.state` reads `computing` until every guest holds a value.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/definitions/customer/visits_12m_oslo"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"entity":"customer","key":"visits_12m_oslo","label":"Visits in Oslo, last 12 months","description":"Completed visits to the Oslo restaurant in the last 365 days.","category":"visits","data_type":"number","options":null,"display_hint":null,"display_order":30,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":false,"source":"tenant","enabled":true,"computed":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]},"state":"computing","progress":{"processed":0,"total":4800},"computed_at":null,"error":null},"compute_state":"computing","archived_at":null,"created_at":"2026-08-21T08:02:17.550000Z","updated_at":"2026-08-21T08:02:17.550000Z"},"schema":{"$ref":"#/components/schemas/AttributeDefinition"}}}},"400":{"description":"The body failed schema validation, names an unknown or archived `category`, omits `options` on a `select`/`multi_select`, or sets `ui_writable` `true` on a `counter_list` (`validation-failed`). With `computed`, also a member the rule decides, a `booking` entity, a rule the platform refuses or one past the 50 computed attributes a tenant holds, each keyed on the member it is about. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"computed-with-data_type":{"summary":"POST /definitions {…, \"data_type\": \"number\", \"computed\": {…}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"data_type","code":"invalid_value","detail":"data_type follows from the rule of a computed attribute — leave it out and let the rule decide it"}]}},"computed-on-booking":{"summary":"POST /definitions {\"entity\": \"booking\", …, \"computed\": {…}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"entity","code":"invalid_value","detail":"a computed attribute describes a guest, so its entity is customer — a booking has no computed attributes"}]}},"without-data_type":{"summary":"POST /definitions {…} with neither `data_type` nor `computed`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"data_type","code":"invalid_value","detail":"data_type is required unless the body carries computed, whose rule decides it"}]}},"rule-refused":{"summary":"POST /definitions {…, \"computed\": {\"operation\": \"count\", \"bookings\": {\"status_class\": \"upcoming\", \"window\": {\"type\": \"last_days\", \"days\": 30}}}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"computed","code":"invalid_value","detail":"computed rule: upcoming bookings have no last-days window"}]}},"computed-cap":{"summary":"POST /definitions {…, \"computed\": {…}} while the tenant holds 50 live computed attributes","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"computed","code":"computed_cap","detail":"at most 50 computed attributes per tenant"}]}},"unknown-category":{"summary":"POST /definitions {\"entity\": \"customer\", \"key\": \"member_tier\", \"label\": \"Member tier\", \"category\": \"loyalty\", \"data_type\": \"text\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"category","code":"invalid_value","detail":"Unknown category 'loyalty'"}]}},"select-without-options":{"summary":"POST /definitions {…, \"data_type\": \"select\"} with no `options`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"options","code":"invalid_value","detail":"a select attribute needs at least one option at creation — without one no write to it can ever succeed. Options are append-only, so send the values you are sure of and add the rest later"}]}},"body-missing":{"summary":"POST /definitions with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /definitions with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /definitions with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /definitions with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /definitions with a key that lacks `definitions:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The `{entity}/{key}` pair is already taken (`conflict-key-exists`), by a live definition or by an archived one, which the `detail` names since it is restored rather than recreated, or the key is a Nine Tables built-in’s (`conflict-reserved-key`), switched on with `PATCH {\"enabled\": true}` instead. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"key-taken-by-a-live-definition":{"summary":"POST /definitions {\"entity\": \"booking\", \"key\": \"spend\", …} where booking/spend already exists","value":{"type":"https://ninetables.io/problems/conflict-key-exists","title":"Conflict","status":409,"detail":"Definition 'booking/spend' already exists","code":"CONFLICT_KEY_EXISTS"}},"key-taken-by-an-archived-definition":{"summary":"POST /definitions {\"entity\": \"booking\", \"key\": \"spend\", …} where booking/spend exists and is archived","value":{"type":"https://ninetables.io/problems/conflict-key-exists","title":"Conflict","status":409,"detail":"Definition 'booking/spend' exists but is archived — restore it with PATCH /definitions/booking/spend {\"archived\": false} instead of recreating","code":"CONFLICT_KEY_EXISTS"}},"key-reserved-by-the-catalogue":{"summary":"POST /definitions {\"entity\": \"customer\", \"key\": \"visits_12m\", …}","value":{"type":"https://ninetables.io/problems/conflict-reserved-key","title":"Conflict","status":409,"detail":"'visits_12m' is a Nine Tables attribute in the catalogue — turn it on with PATCH /definitions/customer/visits_12m {\"enabled\": true} instead of creating it","code":"CONFLICT_RESERVED_KEY"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/definitions/{entity}/{key}":{"get":{"operationId":"getDefinition","tags":["definitions"],"security":[{"cdpApiKey":["definitions:read"]}],"summary":"Get one definition","description":"Fetches one attribute definition by its `(entity, key)` identity, archived or not, and a switched-off built-in with `enabled: false`. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute. Requires `definitions:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/AttributeEntity"},"required":true,"description":"Which kind of record an attribute is attached to, a guest (`customer`) or a single visit (`booking`), each a separate namespace of keys fixed at creation. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","name":"entity","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","example":"lifetime_spend"},"required":true,"description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","name":"key","in":"path"}],"responses":{"200":{"description":"The definition.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"entity":"customer","key":"lifetime_spend","label":"Lifetime spend","description":"Total spend across all completed bookings.","category":"pos_data","data_type":"number","options":null,"display_hint":"currency","display_order":10,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":true,"source":"tenant","enabled":true,"computed":null,"compute_state":null,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z"},"schema":{"$ref":"#/components/schemas/AttributeDefinition"}}}},"400":{"description":"The `{entity}` segment is neither `customer` nor `booking`, or `{key}` is not lowercase snake_case starting with a letter, of ≤64 characters (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-entity":{"summary":"GET /definitions/bogus/lifetime_spend","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'bogus' is not a valid {entity} path segment: Invalid option: expected one of \"customer\"|\"booking\"","code":"INVALID_REF"}},"malformed-key":{"summary":"GET /definitions/customer/BAD--KEY","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'BAD--KEY' is not a valid {key} path segment: Invalid string: must match pattern /^[a-z][a-z0-9_]{0,63}$/","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /definitions/{entity}/{key} with a key that lacks `definitions:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such definition (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such definition","code":"NOT_FOUND","resource":"definition"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateDefinition","tags":["definitions"],"security":[{"cdpApiKey":["definitions:write"]}],"summary":"Update, archive, or restore a definition","description":"Changes a definition’s label, description, category, display settings, writability flags, options or computed rule, archives or restores it through `archived`, or switches a built-in on or off through `enabled`. A `source: \"system\"` built-in refuses every change to its meaning, archiving and its rule included. See https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete. Requires `definitions:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"$ref":"#/components/schemas/AttributeEntity"},"required":true,"description":"Which kind of record an attribute is attached to, a guest (`customer`) or a single visit (`booking`), each a separate namespace of keys fixed at creation. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","name":"entity","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","example":"lifetime_spend"},"required":true,"description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","name":"key","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"archived":true},"schema":{"$ref":"#/components/schemas/DefinitionPatchBody"}}}},"responses":{"200":{"description":"The updated definition, when the change starts no computation: every body but those answered 202, including a rule meaning the same as the stored one, a rule given to an archived attribute, `enabled: true` on a built-in already on and `enabled: false`, which also files the built-in back in the `system` category.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"entity":"customer","key":"lifetime_spend","label":"Lifetime spend (NOK)","description":"Total spend across all completed bookings.","category":"pos_data","data_type":"number","options":null,"display_hint":"currency","display_order":20,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":true,"source":"tenant","enabled":true,"computed":null,"compute_state":null,"archived_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-20T11:41:09.884000Z"},"schema":{"$ref":"#/components/schemas/AttributeDefinition"}}}},"202":{"description":"The definition, after a change that starts a computation: a built-in that was off switched on, a live computed attribute given a new rule, or an archived one restored. It reads `compute_state: \"computing\"` while the platform computes its values, and `ready` once every guest holds one.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"examples":{"switched-on":{"summary":"PATCH /definitions/customer/total_visits {\"enabled\": true}","value":{"entity":"customer","key":"total_visits","label":"Total visits","description":null,"category":"system","data_type":"number","options":null,"display_hint":null,"display_order":1,"show_on_customer_card":false,"show_on_booking_panel":false,"ui_writable":false,"api_writable":false,"source":"system","enabled":true,"computed":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"all_time"},"filters":[]},"state":"computing","progress":{"processed":0,"total":4800},"computed_at":null,"error":null},"compute_state":"computing","archived_at":null,"created_at":"2026-08-18T09:12:44.002000Z","updated_at":"2026-08-20T11:41:09.884000Z"}},"rule-changed":{"summary":"PATCH /definitions/customer/visits_12m_oslo {\"computed\": {…}}","value":{"entity":"customer","key":"visits_12m_oslo","label":"Visits in Oslo, last 12 months","description":"Completed visits to the Oslo restaurant in the last 365 days.","category":"visits","data_type":"number","options":null,"display_hint":null,"display_order":30,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":false,"source":"tenant","enabled":true,"computed":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]},"state":"computing","progress":{"processed":0,"total":4800},"computed_at":null,"error":null},"compute_state":"computing","archived_at":null,"created_at":"2026-08-21T08:02:17.550000Z","updated_at":"2026-08-22T07:30:41.006000Z"}}},"schema":{"$ref":"#/components/schemas/AttributeDefinition"}}}},"400":{"description":"The body failed schema validation, names an unknown `category`, drops an `options` entry, changes what a built-in locks, files a switched-off built-in in another category, or carries a rule the definition cannot take (`validation-failed`). A malformed `{entity}`/`{key}` path segment answers `invalid-ref` instead. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"rule-changes-the-type":{"summary":"PATCH /definitions/customer/visits_12m_oslo {\"computed\": {\"operation\": \"latest\", …}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"computed","code":"computed_type_mismatch","detail":"the rule's result type must stay number"}]}},"rule-on-a-built-in":{"summary":"PATCH /definitions/customer/total_visits {\"computed\": {…}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"computed","code":"system_locked","detail":"computed is not editable on the built-in attribute total_visits — a built-in's meaning belongs to the platform; only category, display_order and the show_on_* flags are yours"}]}},"rule-on-an-entered-definition":{"summary":"PATCH /definitions/booking/spend {\"computed\": {…}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"computed","code":"invalid_value","detail":"computed applies only to a computed attribute — spend holds entered values, and a definition cannot switch between entered and computed values"}]}},"unknown-category":{"summary":"PATCH /definitions/customer/member_tier {\"category\": \"loyalty\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"category","code":"invalid_value","detail":"Unknown category 'loyalty'"}]}},"options-append-only":{"summary":"PATCH /definitions/customer/member_tier {\"options\": […]} dropping the stored `silver` option","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"invalid_value","detail":"option values are append-only (missing: silver)"}]}},"enabled-on-own-definition":{"summary":"PATCH /definitions/customer/member_tier {\"enabled\": false}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"enabled","code":"not_catalogue","detail":"enabled applies only to a built-in attribute — member_tier is your own, and always in use"}]}},"malformed-key":{"summary":"PATCH /definitions/customer/BAD--KEY {\"label\": \"Tier\"}","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'BAD--KEY' is not a valid {key} path segment: Invalid string: must match pattern /^[a-z][a-z0-9_]{0,63}$/","code":"INVALID_REF"}},"body-missing":{"summary":"PATCH /definitions/{entity}/{key} with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PATCH /definitions/{entity}/{key} with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PATCH /definitions/{entity}/{key} with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PATCH /definitions/{entity}/{key} with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PATCH /definitions/{entity}/{key} with a key that lacks `definitions:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such definition (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such definition","code":"NOT_FOUND","resource":"definition"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"An archive while a dynamic segment still references the definition (`conflict-archive-blocked`, naming in `blockers[]` each one the key may read and counting the rest in `hidden_blockers`), switching off a built-in a dynamic segment reads (`conflict-definition-in-use`, with the same two members), a restore into an archived category (`conflict-category-archived`), or switching on a `loyalty_*` built-in on a tenant without the loyalty club app (`loyalty-not-installed`). A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"switch-on-without-the-loyalty-club":{"summary":"PATCH /definitions/customer/loyalty_tier {\"enabled\": true} on a tenant without the loyalty club app","value":{"type":"https://ninetables.io/problems/loyalty-not-installed","title":"Loyalty Club Not Installed","status":409,"detail":"The loyalty club app is not installed for this restaurant. The same request succeeds once an Owner installs the app in Nine Tables.","code":"LOYALTY_NOT_INSTALLED"}},"switch-off-blocked-by-references":{"summary":"PATCH /definitions/customer/total_visits {\"enabled\": false} while a segment still reads it","value":{"type":"https://ninetables.io/problems/conflict-definition-in-use","title":"Conflict","status":409,"detail":"Cannot switch off: still referenced by 1 resource — Regulars (segment). Every one is listed in `blockers`; archive or re-point them first.","code":"CONFLICT_DEFINITION_IN_USE","blockers":[{"kind":"segment","name":"Regulars"}],"hidden_blockers":0}},"archive-blocked-by-references":{"summary":"PATCH /definitions/booking/spend {\"archived\": true} while a segment still references it","value":{"type":"https://ninetables.io/problems/conflict-archive-blocked","title":"Conflict","status":409,"detail":"Cannot archive: still referenced by 1 resource — Big spenders (segment). Every one is listed in `blockers`; archive or re-point them first.","code":"CONFLICT_ARCHIVE_BLOCKED","blockers":[{"kind":"segment","name":"Big spenders"}],"hidden_blockers":0}},"archive-blocked-by-hidden-references":{"summary":"PATCH /definitions/booking/spend {\"archived\": true} with a key limited to some restaurants, while two segments reference it and one names a restaurant outside the limit","value":{"type":"https://ninetables.io/problems/conflict-archive-blocked","title":"Conflict","status":409,"detail":"Cannot archive: still referenced by 2 resources — Big spenders (segment), and 1 this key cannot read. `blockers` lists the ones this key can read; each must be archived or re-pointed first.","code":"CONFLICT_ARCHIVE_BLOCKED","blockers":[{"kind":"segment","name":"Big spenders"}],"hidden_blockers":1}},"restore-into-archived-category":{"summary":"PATCH /definitions/booking/spend {\"archived\": false} while booking/spend and its category pos_data are both archived","value":{"type":"https://ninetables.io/problems/conflict-category-archived","title":"Conflict","status":409,"detail":"Category 'pos_data' is archived — restore it first","code":"CONFLICT_CATEGORY_ARCHIVED"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteDefinition","tags":["definitions"],"security":[{"cdpApiKey":[]}],"summary":"Not supported — definitions are archived, never deleted","description":"Always answers 405. A definition owns stored attribute values, so a definition is archived and restored through `PATCH /definitions/{entity}/{key}` with `{\"archived\": true|false}` instead. See https://developer.ninetables.io/guides/writing-attributes/#archive-never-delete. Requires no scope.","parameters":[{"schema":{"$ref":"#/components/schemas/AttributeEntity"},"required":true,"description":"Which kind of record an attribute is attached to, a guest (`customer`) or a single visit (`booking`), each a separate namespace of keys fixed at creation. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","name":"entity","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","example":"lifetime_spend"},"required":true,"description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","name":"key","in":"path"}],"responses":{"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"405":{"description":"Always. Use PATCH with {\"archived\": true} to archive — this resource cannot be deleted (Allow: GET, HEAD, PATCH) The response carries `Allow: GET, HEAD, PATCH`.","headers":{"Allow":{"description":"Methods this path accepts.","schema":{"type":"string","const":"GET, HEAD, PATCH"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/method-not-allowed","title":"Method Not Allowed","status":405,"detail":"Use PATCH with {\"archived\": true} to archive — this resource cannot be deleted (Allow: GET, HEAD, PATCH)","code":"METHOD_NOT_ALLOWED"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/definitions/proposals":{"post":{"operationId":"proposeDefinition","tags":["definitions"],"security":[{"cdpApiKey":["definitions:write"]}],"summary":"Propose a definition from a description","description":"Turns a plain description of something to know about guests into a proposal — a validated rule with its coverage and three example guests, a built-in to switch on, or the type of an attribute your team fills in — and creates nothing. Each call asks Nine AI afresh, is billed to the tenant’s AI credits only when it answers 200, and costs 10 rate-limit tokens. See https://developer.ninetables.io/guides/computed-attributes/#proposals. Requires `definitions:write`.","requestBody":{"required":true,"content":{"application/json":{"example":{"description":"How often each guest has eaten at Oslo this past year"},"schema":{"$ref":"#/components/schemas/DefinitionProposalBody"}}}},"responses":{"200":{"description":"The proposal, carried by the member `kind` names. Nothing was created: send it on to `POST /definitions`, or switch the built-in on, to act on it.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"kind":"computed","sentence":"I’ll track how many times each guest has dined at Oslo in the last 12 months.","computed":{"rule":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]}},"data_type":"number","display_hint":null,"coverage":{"matching":1830,"total":4800},"examples":[{"customer":{"id":"0198a5b0-7c00-7a10-8b20-000000000003","source_system":null,"source_key":null,"created_at":"2026-05-27T19:41:37.811000Z"},"value":1},{"customer":{"id":"0198a5b0-7c00-7a10-8b20-000000000002","source_system":null,"source_key":null,"created_at":"2026-03-02T12:05:10.004000Z"},"value":2},{"customer":{"id":"0198a5b0-7c00-7a10-8b20-000000000001","source_system":null,"source_key":null,"created_at":"2026-02-11T18:20:44.120000Z"},"value":6}]}},"schema":{"$ref":"#/components/schemas/DefinitionProposal"}}}},"400":{"description":"The body failed schema validation: `description` is required, and 3 to 500 characters once trimmed (`validation-failed`). Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"description-too-short":{"summary":"POST /definitions/proposals {\"description\": \"vi\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"description","code":"schema_invalid","detail":"Too small: expected string to have >=3 characters"}]}},"body-missing":{"summary":"POST /definitions/proposals with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /definitions/proposals with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /definitions/proposals with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /definitions/proposals with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The tenant’s AI credits do not cover a proposal (`insufficient-ai-credits`). It is refused before Nine AI is asked, and nothing is charged.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/insufficient-ai-credits","title":"Insufficient AI Credits","status":402,"detail":"The tenant’s AI credits do not cover this request, so the model was not asked and nothing was charged. An owner tops them up in the Nine Tables app.","code":"INSUFFICIENT_AI_CREDITS"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /definitions/proposals with a key that lacks `definitions:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"502":{"description":"Nine AI was unavailable, or answered twice with nothing the platform could use (`upstream-unavailable`). Nothing was charged, and the request may be retried as it is.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/upstream-unavailable","title":"Upstream Unavailable","status":502,"detail":"Nine AI answered twice with nothing the platform could use, so no proposal was made and nothing was charged. Retry, or reword the description.","code":"UPSTREAM_UNAVAILABLE"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}}}}},"/definitions/{entity}/{key}/recompute":{"post":{"operationId":"recomputeDefinition","tags":["definitions"],"security":[{"cdpApiKey":["definitions:write"]}],"summary":"Recompute a computed attribute","description":"Computes a computed attribute again for every guest, answering 202 with `computed.state: \"computing\"`, and a request while it is computing joins that run and restarts nothing. A key carries no role, so only one that reaches every restaurant may ask. See https://developer.ninetables.io/guides/computed-attributes/#recompute. Requires `definitions:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"$ref":"#/components/schemas/AttributeEntity"},"required":true,"description":"Which kind of record an attribute is attached to, a guest (`customer`) or a single visit (`booking`), each a separate namespace of keys fixed at creation. See https://developer.ninetables.io/guides/writing-attributes/#defining-an-attribute.","name":"entity","in":"path"},{"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$","description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","example":"lifetime_spend"},"required":true,"description":"Definition key: lowercase snake_case starting with a letter, max 64 chars. The identity is the `(entity, key)` PAIR, so the same key may exist on both entities.","name":"key","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"responses":{"202":{"description":"The definition, computing: `computed.progress` counts the guests done, and `computed.state` reads `ready` once every guest holds a fresh value.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"entity":"customer","key":"visits_12m_oslo","label":"Visits in Oslo, last 12 months","description":"Completed visits to the Oslo restaurant in the last 365 days.","category":"visits","data_type":"number","options":null,"display_hint":null,"display_order":30,"show_on_customer_card":true,"show_on_booking_panel":false,"ui_writable":false,"api_writable":false,"source":"tenant","enabled":true,"computed":{"operation":"count","measure":null,"bookings":{"status_class":"completed","window":{"type":"last_days","days":365},"filters":[{"field":"restaurant_id","operator":"in","value":["0198a5b0-5e00-7a10-8b20-00000000000a"]}]},"state":"computing","progress":{"processed":0,"total":4800},"computed_at":null,"error":null},"compute_state":"computing","archived_at":null,"created_at":"2026-08-21T08:02:17.550000Z","updated_at":"2026-08-21T08:02:17.550000Z"},"schema":{"$ref":"#/components/schemas/AttributeDefinition"}}}},"400":{"description":"The definition has no rule to compute, is archived, or is a built-in that is off (`validation-failed` on `(root)`). A malformed `{entity}`/`{key}` path segment answers `invalid-ref` instead.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"not-recomputable":{"summary":"POST /definitions/booking/spend/recompute on an entered attribute","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"invalid_value","detail":"only a computed attribute that is on can be recomputed"}]}},"malformed-entity":{"summary":"POST /definitions/bogus/lifetime_spend/recompute","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'bogus' is not a valid {entity} path segment: Invalid option: expected one of \"customer\"|\"booking\"","code":"INVALID_REF"}},"malformed-key":{"summary":"POST /definitions/customer/BAD--KEY/recompute","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'BAD--KEY' is not a valid {key} path segment: Invalid string: must match pattern /^[a-z][a-z0-9_]{0,63}$/","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `definitions:write` (`insufficient-scope`), or is limited to some of the tenant’s restaurants (`tenant-wide-key-required`). Only the first is refused before the rate-limit charge, so the second carries `X-RateLimit-*`. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /definitions/{entity}/{key}/recompute with a key that lacks `definitions:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:write"}},"restaurant-limited-key":{"summary":"POST /definitions/customer/visits_12m_oslo/recompute with a key limited to some restaurants","value":{"type":"https://ninetables.io/problems/tenant-wide-key-required","title":"Tenant-Wide Key Required","status":403,"detail":"Recomputing an attribute acts on every guest of the tenant, so it needs a key that reaches every restaurant; this key is limited to some","code":"TENANT_WIDE_KEY_REQUIRED"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such definition (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such definition","code":"NOT_FOUND","resource":"definition"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers":{"get":{"operationId":"listCustomers","tags":["customers"],"security":[{"cdpApiKey":["customers:read"]}],"summary":"List all customers","description":"One page of customers in customer id order, with `filter` and `sort` narrowed and ordered by attribute values, or with `updated_since` in change order with a deleted customer as a `RecordTombstone`, identity and `created_at` only unless `include` adds their contact details, marketing consent or attribute values. Each row carries the key it holds for the system you name in `?source_system=`, never another integration’s. See https://developer.ninetables.io/guides/addressing/#listing-customers. Requires `customers:read`.","parameters":[{"schema":{"type":"string","maxLength":32856,"description":"Opaque cursor from a previous response — pass back verbatim, with the same `filter` and `sort`."},"required":false,"description":"Opaque cursor from a previous response — pass back verbatim, with the same `filter` and `sort`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Rows per page, 1 to 100, and as many as allowed when omitted. With `include=attributes` the page holds at most 25 rows: a larger `limit` is clamped to that, not refused."},"required":false,"description":"Rows per page, 1 to 100, and as many as allowed when omitted. With `include=attributes` the page holds at most 25 rows: a larger `limit` is clamped to that, not refused.","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":50,"description":"Comma-separated extras: `contact` adds firstname/lastname/email/phone and `marketing_consent` and needs `contacts:read`, and `attributes` adds the attribute value set, needs `attributes:read` and caps the page at 25. Omit it for identity only.","examples":["contact","contact,attributes"]},"required":false,"description":"Comma-separated extras: `contact` adds firstname/lastname/email/phone and `marketing_consent` and needs `contacts:read`, and `attributes` adds the attribute value set, needs `attributes:read` and caps the page at 25. Omit it for identity only.","name":"include","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own system: each row holding a key from it carries that key, and every other row carries both halves null. Omit it and no key is disclosed at all, so address those customers by `id`."},"required":false,"description":"Your own system: each row holding a key from it carries that key, and every other row carries both halves null. Omit it and no key is disclosed at all, so address those customers by `id`.","name":"source_system","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$","examples":["2026-08-18T19:00:00Z","2026-08-18T19:00:00+02:00"],"description":"Return only the records that changed at or after this instant, ordered by `changed_at` and then `id`, with an erased or deleted record as a `RecordTombstone`. It reaches back at most 90 days, and because `changed_at` is a statement time rather than a commit time, start each poll at the previous highest `changed_at` minus 10 minutes and dedupe by `id`. See https://developer.ninetables.io/guides/webhooks/#catching-up-with-updated_since."},"required":false,"description":"Return only the records that changed at or after this instant, ordered by `changed_at` and then `id`, with an erased or deleted record as a `RecordTombstone`. It reaches back at most 90 days, and because `changed_at` is a statement time rather than a commit time, start each poll at the previous highest `changed_at` minus 10 minutes and dedupe by `id`. See https://developer.ninetables.io/guides/webhooks/#catching-up-with-updated_since.","name":"updated_since","in":"query"},{"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2048,"pattern":"^[a-z][a-z0-9_]{0,63}:(after|anniversary_in_month|anniversary_next_days|anniversary_today|before|between|contains|contains_all|contains_any|contains_none|ends_with|eq|gt|gte|in|in_last_days|in_next_days|is_empty|is_false|is_not_set|is_set|is_true|key_count_gte|key_count_lte|key_in_group|key_last_at_in_last_days|key_last_at_more_than_days_ago|lt|lte|more_than_days_ago|more_than_days_ahead|neq|not_contains|not_in|starts_with|total_count_gte)(:.*)?$"},"maxItems":5,"description":"Repeatable, up to 5 ANDed: `<definition_key>:<operator>:<value>`, one segment attribute condition, with a list operator’s value as a comma list and each value percent-encoded within the parameter. An operator the key’s `data_type` does not take is refused, as in segment rules. See https://developer.ninetables.io/guides/computed-attributes/#lists.","examples":[["loyalty_tier:eq:gold"],["visits_12m:gte:3","loyalty_tier:in:gold,silver"]]},"required":false,"description":"Repeatable, up to 5 ANDed: `<definition_key>:<operator>:<value>`, one segment attribute condition, with a list operator’s value as a comma list and each value percent-encoded within the parameter. An operator the key’s `data_type` does not take is refused, as in segment rules. See https://developer.ninetables.io/guides/computed-attributes/#lists.","name":"filter","in":"query"},{"schema":{"type":"string","pattern":"^-?[a-z][a-z0-9_]{0,63}$","description":"Orders the page by one attribute: `<definition_key>` ascending, `-<definition_key>` descending, ties and guests without the value (who come last in either direction) by customer id. A `multi_select` or `counter_list` key has no order and is refused. See https://developer.ninetables.io/guides/computed-attributes/#lists.","examples":["-visits_12m","loyalty_tier"]},"required":false,"description":"Orders the page by one attribute: `<definition_key>` ascending, `-<definition_key>` descending, ties and guests without the value (who come last in either direction) by customer id. A `multi_select` or `counter_list` key has no order and is refused. See https://developer.ninetables.io/guides/computed-attributes/#lists.","name":"sort","in":"query"}],"responses":{"200":{"description":"One page of customers: by customer id ascending, with `sort` by that attribute and then id, or with `updated_since` by `changed_at` and then id, tombstones included.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"examples":{"id_order":{"summary":"A page in customer id order","value":{"data":[{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z"},{"id":"0198a5b0-8d40-7f55-a1c2-6e9f0a1b2c3d","source_system":null,"source_key":null,"created_at":"2026-05-02T11:40:17.502911Z"}],"next_cursor":"MDE5OGE1YjAtOGQ0MC03ZjU1LWExYzItNmU5ZjBhMWIyYzNk","has_more":true}},"updated_since":{"summary":"A page with `updated_since`: a live customer, a trashed one, and a tombstone","value":{"data":[{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","deleted_at":null,"changed_at":"2026-10-16T08:12:43.907214Z"},{"id":"0198a5b0-8d40-7f55-a1c2-6e9f0a1b2c3d","source_system":null,"source_key":null,"created_at":"2026-05-02T11:40:17.502911Z","deleted_at":"2026-10-16T08:12:44.003118Z","changed_at":"2026-10-16T08:12:44.003118Z"},{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e0e5","removed":true,"reason":"erased","changed_at":"2026-10-16T08:12:44.120511Z"}],"next_cursor":"MjAyNi0xMC0xNlQwODoxMjo0NC4xMjA1MTErMDA6MDB8MDE5OGE1YjAtN2MyZS03ZDMxLWI3YzQtMWY0ZGNhYTFlMGU1","has_more":true}},"sorted":{"summary":"A page with `filter=loyalty_tier:eq:gold&sort=-visits_12m`","value":{"data":[{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z"},{"id":"0198a5b0-8d40-7f55-a1c2-6e9f0a1b2c3d","source_system":null,"source_key":null,"created_at":"2026-05-02T11:40:17.502911Z"}],"next_cursor":"WzksIjAxOThhNWIwLThkNDAtN2Y1NS1hMWMyLTZlOWYwYTFiMmMzZCJd","has_more":true}}},"schema":{"$ref":"#/components/schemas/CustomersPage"}}}},"400":{"description":"A malformed `cursor` or one from the other order, a `limit` outside 1–100, an `include` naming something other than `contact` / `attributes`, an `updated_since` that is not an instant with an offset or reaches back more than 90 days, or a `filter` or `sort` that is malformed, names a key or operator it cannot take, or comes with `updated_since` (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-include":{"summary":"GET /customers?include=bogus","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include","code":"invalid_value","detail":"Unknown include 'bogus' (expected contact and/or attributes)"}]}},"updated_since-too-old":{"summary":"GET /customers?updated_since=2026-01-01T00:00:00Z","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"updated_since","code":"invalid_value","detail":"`updated_since` reaches back at most 90 days, which is how long a deleted or erased record’s tombstone is kept. Resync in id mode: page through the list without `updated_since`, then poll from the time that resync began."}]}},"limit-out-of-range":{"summary":"GET /customers?limit=0","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"limit","code":"schema_invalid","detail":"Too small: expected number to be >=1"}]}},"cursor-not-from-a-previous-page":{"summary":"GET /customers?cursor=not-a-cursor","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"cursor","code":"schema_invalid","detail":"Invalid cursor — pass back a `next_cursor` from a previous page unchanged, or omit it for the first page"}]}},"sort-malformed":{"summary":"GET /customers?sort=Visits_12m","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"sort","code":"schema_invalid","detail":"Expected `<definition_key>` for ascending order or `-<definition_key>` for descending"}]}},"too-many-filters":{"summary":"GET /customers with 6 `filter` parameters","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"filter","code":"schema_invalid","detail":"Too big: expected array to have <=5 items"}]}},"sort-with-updated_since":{"summary":"GET /customers?sort=visits_12m&updated_since=2026-10-16T08:00:00Z","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"sort","code":"invalid_value","detail":"`filter` and `sort` list live customers by attribute values, and `updated_since` lists changes in change order, so send one or the other."}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `customers:read`, or `include=contact` was sent without `contacts:read`, or `include=attributes`, a `filter` or a `sort` without `attributes:read` (`insufficient-scope`). Only the first is refused before the rate-limit charge, so the others carry `X-RateLimit-*`. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-customers-read":{"summary":"GET /customers with a key that lacks `customers:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"contact-without-contacts-read":{"summary":"GET /customers?include=contact with a key that holds `customers:read` but not `contacts:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"attributes-without-attributes-read":{"summary":"GET /customers?include=attributes with a key that holds `customers:read` but not `attributes:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:read"}},"sort-without-attributes-read":{"summary":"GET /customers?sort=-visits_12m with a key that holds `customers:read` but not `attributes:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A `filter` or `sort` reading a computed attribute that is still `computing` or has `failed` (`segment-pending`, naming each in `pending_attributes[]`). Nothing is evaluated until every one is `ready`, so no partial answer is served.","headers":{"Retry-After":{"description":"Present only on `segment-pending` (always `15`): how often the platform advances the computation. A `failed` attribute does not settle on its own.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"segment-pending":{"summary":"GET /customers?sort=-total_visits while the platform is still computing `total_visits`","value":{"type":"https://ninetables.io/problems/segment-pending","title":"Segment Pending","status":409,"detail":"This request reads computed attributes whose values are not settled yet (total_visits), so it is not answered until they are. Each one’s `compute_state` on GET /definitions says where it stands.","code":"SEGMENT_PENDING","pending_attributes":["total_visits"]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createCustomer","tags":["customers"],"security":[{"cdpApiKey":["customers:write"]}],"summary":"Create a customer, or reuse the matching one","description":"Creates a guest from the contact details you hold, or reuses the one they match: `201` with `created: true` for a new guest, `200` with `created: false` for a reused one, and `match_reason` naming the evidence. Your `source_system`/`source_key` pair and a `values` map are written in the same transaction, so a refusal leaves no half-made guest. See https://developer.ninetables.io/guides/addressing/#creating-a-customer. Requires `customers:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"email":"kari@example.com","restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","source_system":"pos_x","source_key":"cust-889"},"schema":{"$ref":"#/components/schemas/CustomerCreateBody"}}}},"responses":{"200":{"description":"An existing guest matched these details and was reused; nothing was created.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/customers/0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"customer":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}},"created":false,"match_reason":"phone_email_name"},"schema":{"type":"object","properties":{"customer":{"anyOf":[{"$ref":"#/components/schemas/CustomerSummary"}],"description":"The guest this request resolved to, carrying with `contacts:read` the contact details and marketing consent Nine Tables holds rather than an echo of yours. Without that scope `firstname`, `lastname`, `email`, `phone` and `marketing_consent` are absent."},"created":{"type":"boolean","description":"True when this request made the guest, false when it reused one that already existed. The `201`/`200` status says the same thing, so branch on whichever your client reads more naturally."},"match_reason":{"anyOf":[{"$ref":"#/components/schemas/GuestMatchReason"}],"description":"On what evidence the guest was recognised, as listed on `GuestMatchReason`."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"}],"description":"Present only when the request carried `values`: the guest’s attribute values after the write, each with its own `updated_at` and `source`. It is the full value set with `attributes:read`, otherwise only the keys this request wrote."}},"required":["customer","created","match_reason"]}}}},"201":{"description":"No guest matched, so one was created. `Location` points at it.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/customers/0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"customer":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":null},"created":true,"match_reason":"new"},"schema":{"type":"object","properties":{"customer":{"anyOf":[{"$ref":"#/components/schemas/CustomerSummary"}],"description":"The guest just created, with the `id` to address them by from now on. With `contacts:read` it carries the details stored on it (what you sent, trimmed, with `phone` canonical, but `phone` null on `conflict`, where another live guest holds the number, and `marketing_consent` null), and without that scope `firstname`, `lastname`, `email`, `phone` and `marketing_consent` are absent."},"created":{"type":"boolean","description":"Always true on a `201`. It is the same flag the `200` carries as false, so one branch in your code covers both answers."},"match_reason":{"anyOf":[{"$ref":"#/components/schemas/GuestMatchReason"}],"description":"Why no existing guest was used — `new` or `conflict`. See `GuestMatchReason`; `conflict` is the one to act on, since it means an existing guest holds this email or phone under another name."},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"}],"description":"Present only when the request carried `values`: the new guest’s attribute values after the write — the full value set with `attributes:read`, otherwise only the keys this request wrote."}},"required":["customer","created","match_reason"]}}}},"400":{"description":"The body failed schema validation — an unknown member, neither an `email` nor a `phone`, half a `source_system`/`source_key` pair, a phone that is not an international number, or an attribute key this tenant has no definition for (`validation-failed`). The same code also covers a `restaurant_id` that names no live restaurant on your tenant, its absence on a tenant with several, a tenant with no live restaurant at all, and details the venue’s matching cannot resolve to ONE guest — in every one of those, nothing was created. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"names-but-no-email-or-phone":{"summary":"POST /customers {\"firstname\": \"Kari\", \"lastname\": \"Nordmann\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"email","code":"schema_invalid","detail":"Provide an `email` or a `phone`: a name alone is not evidence of identity, so a guest with neither could never be matched or deduplicated again. Send the name alongside, where it is stored and is what tells two guests on one channel apart."},{"key":"phone","code":"schema_invalid","detail":"Provide an `email` or a `phone`: a name alone is not evidence of identity, so a guest with neither could never be matched or deduplicated again. Send the name alongside, where it is stored and is what tells two guests on one channel apart."}]}},"source_key-without-source_system":{"summary":"POST /customers {\"email\": \"kari@example.com\", \"source_key\": \"cust-889\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"source_key requires source_system"}]}},"phone-without-an-international-prefix":{"summary":"POST /customers {\"firstname\": \"Kari\", \"phone\": \"90000001\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"phone","code":"schema_invalid","detail":"Phone must be an international number, written with an explicit `+` or `00` prefix followed by country code and subscriber number, 7–15 digits total: `+4790000001`, `+47 90 00 00 01` and `004790000001` are all accepted and are all the same number. Spaces, dashes, dots and parentheses are ignored. A number WITHOUT the prefix is refused rather than guessed at: `4790000001` and the national number `90000001` are the same shape, and reading the leading digits as a country code would answer one of them with an empty match set you could not tell apart from a guest who is genuinely absent."}]}},"restaurant_id-omitted-on-a-multi-restaurant-tenant":{"summary":"POST /customers {\"email\": \"kari@example.com\"} on a tenant with two active restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_id","code":"invalid_value","detail":"This tenant has more than one active restaurant, so which one the guest came through cannot be inferred. Send restaurant_id with an id from GET /restaurants — it decides which restaurant-scoped staff can see the guest."}]}},"details-match-more-than-one-guest":{"summary":"POST /customers {\"email\": \"shared@example.com\"} where two guests hold that address under different names","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"invalid_value","detail":"The guest could not be resolved: these details match more than one existing guest, so no guest was created or reused — picking one would be a guess. Send the same details to POST /customers/resolve to see the candidates, then name the one you mean by its id."}]}},"body-missing":{"summary":"POST /customers with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /customers with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /customers with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /customers with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `customers:write`, or the body carries `values` without `attributes:write` (`insufficient-scope`). Only the first is refused before the rate-limit charge, so the second carries `X-RateLimit-*`. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-customers-write":{"summary":"POST /customers with a key that lacks `customers:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:write"}},"values-without-attributes-write":{"summary":"POST /customers {\"email\": \"kari@example.com\", \"values\": {…}} with a key that holds `customers:write` but not `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The pair cannot be attached, so nothing is created: the guest the details reached already holds another key of your system (`conflict-source-identity`, quoting it), or the pair is held by a record this API does not acknowledge (`conflict-key-exists`, naming none). See https://developer.ninetables.io/guides/addressing/#creating-a-customer. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"matched-guest-holds-another-key-of-your-system":{"summary":"POST /customers {\"email\": \"kari@example.com\", \"source_system\": \"pos_x\", \"source_key\": \"cust-889\"} where that email’s guest already holds pos_x:cust-401","value":{"type":"https://ninetables.io/problems/conflict-source-identity","title":"Conflict","status":409,"detail":"This customer already has the source identity 'pos_x:cust-401'","code":"CONFLICT_SOURCE_IDENTITY"}},"pair-held-by-a-record-this-api-does-not-acknowledge":{"summary":"POST /customers {\"email\": \"ola@example.com\", \"source_system\": \"pos_x\", \"source_key\": \"cust-889\"} where cust-889 is held by a record this API does not acknowledge","value":{"type":"https://ninetables.io/problems/conflict-key-exists","title":"Conflict","status":409,"detail":"The source identity 'pos_x:cust-889' is already in use","code":"CONFLICT_KEY_EXISTS"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/count":{"get":{"operationId":"countCustomers","tags":["customers"],"security":[{"cdpApiKey":["customers:read"]}],"summary":"Count all customers","description":"The exact number of customers `GET /customers` pages through, with the same exclusions. Unlike `GET /segments/{id}/count` it is never capped. See https://developer.ninetables.io/guides/addressing/#listing-customers. Requires `customers:read`.","responses":{"200":{"description":"The exact customer count.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"count":12840},"schema":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /customers/count with a key that lacks `customers:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerRef}":{"get":{"operationId":"getCustomer","tags":["customers"],"security":[{"cdpApiKey":["customers:read"]}],"summary":"Get a customer","description":"The customer’s summary and, when the key also holds `attributes:read`, its attribute value set keyed by definition key, a member that is absent rather than empty without that scope. Values of archived definitions are left out unless `include_archived=true`. See https://developer.ninetables.io/guides/writing-attributes/#reading-values. Requires `customers:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"}],"responses":{"200":{"description":"The customer.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"customer":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}},"values":{"company_name":{"value":"Acme AS","updated_at":"2026-08-19T17:02:27.273000Z","source":"api"},"total_visits":{"value":12,"updated_at":"2026-08-19T17:02:02.854000Z","source":"system"}}},"schema":{"type":"object","properties":{"customer":{"$ref":"#/components/schemas/CustomerSummary"},"values":{"anyOf":[{"$ref":"#/components/schemas/ValuesEchoRecord"}],"description":"Present only when the key also holds `attributes:read`: the customer’s attribute values keyed by definition key, each with its own `updated_at` and `source`."}},"required":["customer"]}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"GET /customers/cust-889","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"GET /customers/pos x:cust 889","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"include_archived-not-a-boolean":{"summary":"GET /customers/{customerRef}?include_archived=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_archived","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /customers/{customerRef} with a key that lacks `customers:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerRef}/attributes":{"get":{"operationId":"getCustomerAttributes","tags":["customers"],"security":[{"cdpApiKey":["attributes:read"]}],"summary":"Get a customer’s attribute values","description":"The customer’s attribute value set alone, keyed by definition key, each value with its own `updated_at` and `source`. Values of archived definitions are left out unless `include_archived=true`. See https://developer.ninetables.io/guides/writing-attributes/#reading-values. Requires `attributes:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"}],"responses":{"200":{"description":"The values.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"values":{"company_name":{"value":"Acme AS","updated_at":"2026-08-19T17:02:27.273000Z","source":"api"},"total_visits":{"value":12,"updated_at":"2026-08-19T17:02:02.854000Z","source":"system"}}},"schema":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/ValuesEchoRecord"}},"required":["values"]}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"GET /customers/cust-889/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"GET /customers/pos x:cust 889/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"include_archived-not-a-boolean":{"summary":"GET /customers/{customerRef}/attributes?include_archived=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_archived","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /customers/{customerRef}/attributes with a key that lacks `attributes:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateCustomerAttributes","tags":["customers"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Write customer attribute values","description":"Writes the keys present in `values`, `null` clearing one, all or nothing, and answers the post-write values. The optional `expect` map refuses the whole write with 409 `conflict-stale-write` when a value changed since you read it. See https://developer.ninetables.io/guides/writing-attributes/. Requires `attributes:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"values":{"lifetime_spend":1250}},"schema":{"$ref":"#/components/schemas/AttributesPatchBody"}}}},"responses":{"200":{"description":"The post-write value set: the customer’s full value set when the key holds `attributes:read`, otherwise only the keys this request wrote.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"values":{"company_name":{"value":"Acme AS","updated_at":"2026-08-19T17:02:27.273000Z","source":"api"},"total_visits":{"value":12,"updated_at":"2026-08-19T17:02:02.854000Z","source":"system"},"member_tier":{"value":"gold","updated_at":"2026-08-20T11:41:09.884000Z","source":"api"}}},"schema":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/ValuesEchoRecord"}},"required":["values"]}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). Per-attribute failures (unknown key, wrong entity, type mismatch, unknown option, writing a computed attribute) come back as `validation-failed` with one `errors[]` entry per offending key. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-attribute":{"summary":"PATCH /customers/{customerRef}/attributes {\"values\": {\"favourite_wine\": \"riesling\"}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"favourite_wine","code":"unknown_attribute","detail":"unknown customer attribute: favourite_wine"}]}},"ref-neither-uuid-nor-pair":{"summary":"PATCH /customers/cust-889/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"PATCH /customers/pos x:cust 889/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"body-missing":{"summary":"PATCH /customers/{customerRef}/attributes with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PATCH /customers/{customerRef}/attributes with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PATCH /customers/{customerRef}/attributes with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PATCH /customers/{customerRef}/attributes with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PATCH /customers/{customerRef}/attributes with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"An `expect` token that no longer matches its value’s current `updated_at` answers `conflict-stale-write`: the whole patch was refused, and `drifted` names the keys to re-read. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"conflict-stale-write":{"summary":"PATCH with `expect` naming a key whose `updated_at` has changed since you read it","value":{"type":"https://ninetables.io/problems/conflict-stale-write","title":"Conflict","status":409,"detail":"The write was rejected: 1 attribute(s) changed since you read them — member_tier. Nothing was written; re-read the drifted keys and retry.","code":"CONFLICT_STALE_WRITE","drifted":["member_tier"]}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/resolve":{"post":{"operationId":"resolveCustomers","tags":["customers"],"security":[{"cdpApiKey":["contacts:read"]}],"summary":"Find customers by email, phone, or source identity","description":"Finds up to 10 customers matching every criterion you send, the most recent booking activity first, and echoes in `criteria` the canonical form it searched on. It only reads: an empty `matches` means no guest holds these details yet. See https://developer.ninetables.io/guides/addressing/#resolve-finds-a-guest-and-never-creates-one. Requires `contacts:read`.","requestBody":{"required":true,"content":{"application/json":{"example":{"email":"kari@example.com"},"schema":{"$ref":"#/components/schemas/CustomerResolveBody"}}}},"responses":{"200":{"description":"Matches (possibly empty) and the criteria as searched.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"matches":[{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":null,"source_key":null,"created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}}],"criteria":{"email":"kari@example.com","phone":"+4790000001","source_system":null,"source_key":null}},"schema":{"type":"object","properties":{"matches":{"type":"array","items":{"$ref":"#/components/schemas/CustomerSummary"}},"criteria":{"$ref":"#/components/schemas/ResolveCriteria"}},"required":["matches","criteria"]}}}},"400":{"description":"The body named no criterion, sent `source_key` without `source_system` or `source_system` on its own, carried a phone without a `+` or `00` prefix, or failed schema validation (`validation-failed`). A criterion that matches nothing is not an error: it answers 200 with an empty `matches`. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"no-criterion":{"summary":"POST /customers/resolve {}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Provide at least one of email, phone, or the source_system/source_key pair"}]}},"source_key-without-source_system":{"summary":"POST /customers/resolve {\"source_key\": \"cust-889\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"source_key requires source_system"}]}},"source_system-alone":{"summary":"POST /customers/resolve {\"source_system\": \"pos_x\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Provide at least one of email, phone, or the source_system/source_key pair"},{"key":"(root)","code":"schema_invalid","detail":"source_system alone is not a criterion — pair it with source_key, email or phone"}]}},"phone-without-an-international-prefix":{"summary":"POST /customers/resolve {\"phone\": \"90000001\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"phone","code":"schema_invalid","detail":"Phone must be an international number, written with an explicit `+` or `00` prefix followed by country code and subscriber number, 7–15 digits total: `+4790000001`, `+47 90 00 00 01` and `004790000001` are all accepted and are all the same number. Spaces, dashes, dots and parentheses are ignored. A number WITHOUT the prefix is refused rather than guessed at: `4790000001` and the national number `90000001` are the same shape, and reading the leading digits as a country code would answer one of them with an empty match set you could not tell apart from a guest who is genuinely absent."}]}},"body-missing":{"summary":"POST /customers/resolve with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /customers/resolve with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /customers/resolve with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /customers/resolve with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /customers/resolve with a key that lacks `contacts:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerRef}/source-identity":{"put":{"operationId":"attachCustomerSourceIdentity","tags":["customers"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Attach a source identity to a customer","description":"Attaches your own key to the customer beside the keys other systems hold, and re-sending a pair it already holds answers 200. A different key of your system on this customer, or the pair on another customer, answers 409. See https://developer.ninetables.io/guides/addressing/#one-key-per-system-per-record. Requires `attributes:write`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"source_system":"pos_x","source_key":"cust-889"},"schema":{"$ref":"#/components/schemas/SourceIdentity"}}}},"responses":{"200":{"description":"The customer, carrying the key it now holds for your system.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}},"schema":{"$ref":"#/components/schemas/CustomerSummary"}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"source_key-missing":{"summary":"PUT /customers/{customerRef}/source-identity {\"source_system\": \"pos_x\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"source_key","code":"schema_invalid","detail":"Invalid input: expected string, received undefined"}]}},"ref-neither-uuid-nor-pair":{"summary":"PUT /customers/cust-889/source-identity","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"PUT /customers/pos x:cust 889/source-identity","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"body-missing":{"summary":"PUT /customers/{customerRef}/source-identity with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PUT /customers/{customerRef}/source-identity with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PUT /customers/{customerRef}/source-identity with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PUT /customers/{customerRef}/source-identity with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PUT /customers/{customerRef}/source-identity with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"THIS customer already holds a different key for your system (`conflict-source-identity`, quoting it), or ANOTHER customer holds the pair (`identity-already-assigned`, exposing only `conflicting_id`). A holder this API does not acknowledge answers `conflict-key-exists` with no id.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"customer-holds-another-key-of-your-system":{"summary":"PUT /customers/{ref}/source-identity {\"source_system\": \"pos_x\", \"source_key\": \"cust-889\"} on a customer already holding pos_x:cust-401","value":{"type":"https://ninetables.io/problems/conflict-source-identity","title":"Conflict","status":409,"detail":"This customer already has the source identity 'pos_x:cust-401'","code":"CONFLICT_SOURCE_IDENTITY"}},"pair-held-by-another-customer":{"summary":"PUT /customers/{ref}/source-identity {\"source_system\": \"pos_x\", \"source_key\": \"cust-401\"} where cust-401 is another customer’s pair","value":{"type":"https://ninetables.io/problems/identity-already-assigned","title":"Conflict","status":409,"detail":"This source identity is already assigned to another record","code":"IDENTITY_ALREADY_ASSIGNED","conflicting_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerRef}/source-identity/{sourceSystem}":{"delete":{"operationId":"detachCustomerSourceIdentity","tags":["customers"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Remove a source identity from a customer","description":"Removes the key `{sourceSystem}` holds on this customer, including one a guest merged into it holds, and answers the customer with your pair null. Removing a key the customer does not hold answers the same 200, so a retry is safe. See https://developer.ninetables.io/guides/addressing/#one-key-per-system-per-record. Requires `attributes:write`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9._~-]{1,128}$","description":"The system whose key to remove — the `source_system` you attached it under, compared case-insensitively. It rides in the path, so it is held to the path charset `[A-Za-z0-9._~-]` and at most 128 characters; anything else is `400 invalid-ref`.","example":"pos_x"},"required":true,"description":"The system whose key to remove — the `source_system` you attached it under, compared case-insensitively. It rides in the path, so it is held to the path charset `[A-Za-z0-9._~-]` and at most 128 characters; anything else is `400 invalid-ref`.","name":"sourceSystem","in":"path"}],"responses":{"200":{"description":"The customer, holding no key for that system.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":null,"source_key":null,"created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}},"schema":{"$ref":"#/components/schemas/CustomerSummary"}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). The `{sourceSystem}` segment is held to the same charset and length as one half of a ref, and answers the same `invalid-ref`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"DELETE /customers/cust-889/source-identity/pos_x","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"DELETE /customers/pos x:cust 889/source-identity/pos_x","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"source-system-outside-the-path-charset":{"summary":"DELETE /customers/{customerRef}/source-identity/pos%20x","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x' is not a source_system a path can carry — 1 to 128 characters of [A-Za-z0-9._~-]","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"DELETE /customers/{customerRef}/source-identity/{sourceSystem} with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerRef}/bookings":{"get":{"operationId":"listCustomerBookings","tags":["customers"],"security":[{"cdpApiKey":["bookings:read"]}],"summary":"List a customer’s bookings","description":"One page of the customer’s bookings, filtered by a `start_time` window (`from`/`to`) and `status`, in booking id order, which never skips or repeats a row but is NOT chronological. A key limited to some restaurants lists the guest’s bookings at those only. See https://developer.ninetables.io/guides/addressing/#listing-customers. Requires `bookings:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"},{"schema":{"type":"string","maxLength":2000,"description":"Opaque cursor from a previous response — pass back verbatim."},"required":false,"description":"Opaque cursor from a previous response — pass back verbatim.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Lower bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its first instant in UTC, or an instant with an offset (`2026-08-18T19:00:00Z`).","examples":["2026-08-18","2026-08-18T00:00:00Z"]},"required":false,"description":"Lower bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its first instant in UTC, or an instant with an offset (`2026-08-18T19:00:00Z`).","name":"from","in":"query"},{"schema":{"type":"string","description":"Upper bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its LAST microsecond (`23:59:59.999999Z`) so the whole day is included, or an instant with an offset. A `from` after `to` is not an error; it matches nothing.","examples":["2026-08-19","2026-08-19T00:00:00Z"]},"required":false,"description":"Upper bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its LAST microsecond (`23:59:59.999999Z`) so the whole day is included, or an instant with an offset. A `from` after `to` is not an error; it matches nothing.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":409,"description":"Comma-separated `BookingStatus` values such as `completed,guest_no_show`: a booking in any of them is included, and omitting it includes every status. An unknown element answers 400 listing the accepted values.","examples":["completed","completed,guest_no_show"]},"required":false,"description":"Comma-separated `BookingStatus` values such as `completed,guest_no_show`: a booking in any of them is included, and omitting it includes every status. An unknown element answers 400 listing the accepted values.","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own system, which a `{source_system}:{source_key}` path ref names implicitly: each booking holding a key from it carries that key, and every other row carries both halves null. Omit it and address these bookings by `id`."},"required":false,"description":"Your own system, which a `{source_system}:{source_key}` path ref names implicitly: each booking holding a key from it carries that key, and every other row carries both halves null. Omit it and address these bookings by `id`.","name":"source_system","in":"query"}],"responses":{"200":{"description":"One page of bookings.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":null,"source_key":null,"start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}],"next_cursor":"MDE5OGE1YjAtOWYxMS03YzAyLThlNWQtMmE3YjNjOWQ0ZTU1","has_more":true},"schema":{"$ref":"#/components/schemas/CustomerBookingsPage"}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). A malformed `cursor`, a `limit` outside 1–100, a non-ISO-8601 `from`/`to`, or an unknown booking `status` also answer `validation-failed`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-status":{"summary":"GET /customers/{customerRef}/bookings?status=bogus","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"status","code":"invalid_value","detail":"Unknown booking status 'bogus'. Accepted: booking_confirmed, booking_requested, waitlist_requested, guest_arrived, guest_seated, completed, guest_no_show, system_closed_confirmed_booking, system_closed_booking_request, system_closed_waitlist_request, guest_cancelled_confirmed_booking, restaurant_cancelled_confirmed_booking, guest_cancelled_booking_request, restaurant_declined_booking_request, guest_cancelled_waitlist_request, restaurant_declined_waitlist_request."}]}},"from-not-a-date":{"summary":"GET /customers/{customerRef}/bookings?from=not-a-date","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"from","code":"invalid_value","detail":"`from` must be an ISO 8601 date (YYYY-MM-DD) or an instant with an explicit offset"}]}},"limit-out-of-range":{"summary":"GET /customers/{customerRef}/bookings?limit=0","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"limit","code":"schema_invalid","detail":"Too small: expected number to be >=1"}]}},"cursor-not-from-a-previous-page":{"summary":"GET /customers/{customerRef}/bookings?cursor=not-a-cursor","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"cursor","code":"schema_invalid","detail":"Invalid cursor — pass back a `next_cursor` from a previous page unchanged, or omit it for the first page"}]}},"ref-neither-uuid-nor-pair":{"summary":"GET /customers/cust-889/bookings","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"GET /customers/pos x:cust 889/bookings","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /customers/{customerRef}/bookings with a key that lacks `bookings:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings/{bookingRef}":{"get":{"operationId":"getBooking","tags":["bookings"],"security":[{"cdpApiKey":["bookings:read"]}],"summary":"Get a booking","description":"The booking’s own fields, in the shape `GET /bookings/{bookingRef}/attributes` embeds as `booking`, and with `include=customer` its guest; its attribute values come from that route. A booking this API does not acknowledge, or one at a restaurant outside a limited key’s, answers 404. See https://developer.ninetables.io/guides/addressing/#records-this-api-does-not-acknowledge. Requires `bookings:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"bookingRef","in":"path"},{"schema":{"type":"string","maxLength":50,"description":"`customer` adds the booking’s guest as `customer`, and needs `customers:read`; omit it for the booking alone. Anything else answers 400.","examples":["customer"]},"required":false,"description":"`customer` adds the booking’s guest as `customer`, and needs `customers:read`; omit it for the booking alone. Anything else answers 400.","name":"include","in":"query"}],"responses":{"200":{"description":"The booking.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"examples":{"booking":{"summary":"The booking","value":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}},"with_customer":{"summary":"With `include=customer`","value":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"],"customer":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}}}}},"schema":{"$ref":"#/components/schemas/BookingDetail"}}}},"400":{"description":"The `{bookingRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"GET /bookings/order-777","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'order-777' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"GET /bookings/pos x:order 777","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:order 777' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"unknown-include":{"summary":"GET /bookings/{bookingRef}?include=contact","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include","code":"invalid_value","detail":"Unknown include 'contact' (expected customer)"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `bookings:read`, refused before the rate-limit charge, or `include=customer` was sent without `customers:read` (`insufficient-scope`, after the charge). `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /bookings/{bookingRef} with a key that lacks `bookings:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"customer-without-customers-read":{"summary":"GET /bookings/{bookingRef}?include=customer with a key that holds `bookings:read` but not `customers:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such booking (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A `{source_system}:{source_key}` ref names bookings at more than one of your restaurants, since a booking key is unique per restaurant rather than per tenant (`ambiguous-ref`): address the booking by its id instead.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-names-bookings-at-several-restaurants":{"summary":"GET /bookings/pos_x:order-777","value":{"type":"https://ninetables.io/problems/ambiguous-ref","title":"Conflict","status":409,"detail":"'pos_x:order-777' names bookings at 2 restaurants. Address the booking by its id.","code":"AMBIGUOUS_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateBooking","tags":["bookings"],"security":[{"cdpApiKey":["bookings:write"]}],"summary":"Update a booking","description":"Changes the members you send of one reservation and leaves the rest, writing its own fields in one statement so a refusal writes none of them, and names the members that actually moved. A `status` change does real work — holding or freeing tables, loyalty, card guarantees and guest messages — which the guide lists value by value. See https://developer.ninetables.io/guides/bookings/#what-a-status-change-does. Requires `bookings:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"bookingRef","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"guest_count":5},"schema":{"$ref":"#/components/schemas/BookingPatchBody"}}}},"responses":{"200":{"description":"The reservation after the write.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T20:00:00.000000Z","end_time":"2026-08-18T22:00:00.000000Z","status":"guest_seated","guest_count":5,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"changed":["start_time","end_time","guest_count","status"],"accepted_outside_opening_hours":false,"accepted_above_online_party_limit":false},"schema":{"$ref":"#/components/schemas/BookingUpdated"}}}},"400":{"description":"The `{bookingRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). So is an empty body or one of only unknown members, `restaurant_id` among them because a booking never changes restaurant, judged before the ref is looked up so it answers 400 even on a ref that does not exist; and so is a body naming what this tenant cannot be booked against (an impossible date, an `end_time` not after the start, a guest, table or area it does not hold or has removed), judged against the booking the ref names, so on a ref matching nothing the 404 answers first. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"nothing-to-change":{"summary":"PATCH /bookings/{bookingRef} {}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Send at least one of start_time, end_time, guest_count, status, customer_id, table_ids, customer_notes, staff_notes, allergens, dietary_preferences, requested_area_id, requested_table_count"}]}},"only-unknown-members":{"summary":"PATCH /bookings/{bookingRef} {\"partySize\": 4}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Unrecognized key: \"partySize\""},{"key":"(root)","code":"schema_invalid","detail":"Send at least one of start_time, end_time, guest_count, status, customer_id, table_ids, customer_notes, staff_notes, allergens, dietary_preferences, requested_area_id, requested_table_count"}]}},"ref-neither-uuid-nor-pair":{"summary":"PATCH /bookings/order-777","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'order-777' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"PATCH /bookings/pos x:order 777","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:order 777' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"body-missing":{"summary":"PATCH /bookings/{bookingRef} with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PATCH /bookings/{bookingRef} with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PATCH /bookings/{bookingRef} with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PATCH /bookings/{bookingRef} with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PATCH /bookings/{bookingRef} with a key that lacks `bookings:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such booking (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A table the patch moves onto is already held across the resulting window (`conflict-booking-overlap`, naming `conflicting_tables`: pick another table or window), writing nothing. A `{source_system}:{source_key}` ref names bookings at more than one of your restaurants, since a booking key is unique per restaurant rather than per tenant (`ambiguous-ref`): address the booking by its id instead. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"table-already-held":{"summary":"PATCH /bookings/{bookingRef} moving `table_ids` onto a table another booking holds across the window","value":{"type":"https://ninetables.io/problems/conflict-booking-overlap","title":"Conflict","status":409,"detail":"Table '7' is already held by another booking across this window. Nothing was written. Pick another table, move the window, or send no table at all and let the venue seat the party on the night.","code":"CONFLICT_BOOKING_OVERLAP","conflicting_tables":[{"table_id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","table_name":"7"}]}},"ref-names-bookings-at-several-restaurants":{"summary":"PATCH /bookings/pos_x:order-777","value":{"type":"https://ninetables.io/problems/ambiguous-ref","title":"Conflict","status":409,"detail":"'pos_x:order-777' names bookings at 2 restaurants. Address the booking by its id.","code":"AMBIGUOUS_REF"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings":{"get":{"operationId":"listBookings","tags":["bookings"],"security":[{"cdpApiKey":["bookings:read"]}],"summary":"List bookings","description":"One page of the tenant’s bookings, in the shape `GET /bookings/{bookingRef}` returns, filtered by `restaurant_id`, a `start_time` window (`from`/`to`) and `status`, all AND-ed. Pages run in booking id order, which never skips or repeats a row but is NOT chronological, or with `updated_since` in change order, a deleted booking included as a `RecordTombstone`. See https://developer.ninetables.io/guides/bookings/#reading-the-diary. Requires `bookings:read`.","parameters":[{"schema":{"type":"string","maxLength":2000,"description":"Opaque cursor from a previous response — pass back verbatim."},"required":false,"description":"Opaque cursor from a previous response — pass back verbatim.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Restrict to one restaurant, by its id from `GET /restaurants` — with `include_inactive=true` for the disabled ones older bookings still carry. A well-formed id of another tenant, or outside a limited key’s restaurants, matches nothing."},"required":false,"description":"Restrict to one restaurant, by its id from `GET /restaurants` — with `include_inactive=true` for the disabled ones older bookings still carry. A well-formed id of another tenant, or outside a limited key’s restaurants, matches nothing.","name":"restaurant_id","in":"query"},{"schema":{"type":"string","description":"Lower bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its first instant in UTC, or an instant with an offset (`2026-08-18T19:00:00Z`).","examples":["2026-08-18","2026-08-18T00:00:00Z"]},"required":false,"description":"Lower bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its first instant in UTC, or an instant with an offset (`2026-08-18T19:00:00Z`).","name":"from","in":"query"},{"schema":{"type":"string","description":"Upper bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its LAST microsecond (`23:59:59.999999Z`) so the whole day is included, or an instant with an offset. A `from` after `to` is not an error; it matches nothing.","examples":["2026-08-19","2026-08-19T00:00:00Z"]},"required":false,"description":"Upper bound on `start_time`, inclusive: a bare `YYYY-MM-DD`, read as its LAST microsecond (`23:59:59.999999Z`) so the whole day is included, or an instant with an offset. A `from` after `to` is not an error; it matches nothing.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":409,"description":"Comma-separated `BookingStatus` values such as `completed,guest_no_show`: a booking in any of them is included, and omitting it includes every status. An unknown element answers 400 listing the accepted values.","examples":["completed","booking_confirmed,guest_arrived,guest_seated"]},"required":false,"description":"Comma-separated `BookingStatus` values such as `completed,guest_no_show`: a booking in any of them is included, and omitting it includes every status. An unknown element answers 400 listing the accepted values.","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own system: each booking holding a key from it carries that key, and every other row carries both halves null. Omit it and address these bookings by `id`."},"required":false,"description":"Your own system: each booking holding a key from it carries that key, and every other row carries both halves null. Omit it and address these bookings by `id`.","name":"source_system","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$","examples":["2026-08-18T19:00:00Z","2026-08-18T19:00:00+02:00"],"description":"Return only the records that changed at or after this instant, ordered by `changed_at` and then `id`, with an erased or deleted record as a `RecordTombstone`. It reaches back at most 90 days, and because `changed_at` is a statement time rather than a commit time, start each poll at the previous highest `changed_at` minus 10 minutes and dedupe by `id`. See https://developer.ninetables.io/guides/webhooks/#catching-up-with-updated_since."},"required":false,"description":"Return only the records that changed at or after this instant, ordered by `changed_at` and then `id`, with an erased or deleted record as a `RecordTombstone`. It reaches back at most 90 days, and because `changed_at` is a statement time rather than a commit time, start each poll at the previous highest `changed_at` minus 10 minutes and dedupe by `id`. See https://developer.ninetables.io/guides/webhooks/#catching-up-with-updated_since.","name":"updated_since","in":"query"},{"schema":{"type":"string","maxLength":50,"description":"`customer` adds the booking’s guest as `customer`, and needs `customers:read`; omit it for the booking alone. Anything else answers 400.","examples":["customer"]},"required":false,"description":"`customer` adds the booking’s guest as `customer`, and needs `customers:read`; omit it for the booking alone. Anything else answers 400.","name":"include","in":"query"}],"responses":{"200":{"description":"One page of bookings: by booking id ascending, or with `updated_since` by `changed_at` and then id, tombstones included.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"examples":{"id_order":{"summary":"A page in booking id order","value":{"data":[{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":null,"source_key":null,"start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]}],"next_cursor":"MDE5OGE1YjAtOWYxMS03YzAyLThlNWQtMmE3YjNjOWQ0ZTU1","has_more":true}},"updated_since":{"summary":"A page with `updated_since`: a live booking, a trashed one, and a tombstone","value":{"data":[{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"],"deleted_at":null,"changed_at":"2026-10-16T09:12:07.510377Z"},{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":null,"source_key":null,"start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"],"deleted_at":"2026-10-16T09:31:55.208840Z","changed_at":"2026-10-16T09:31:55.208840Z"},{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4ed1","removed":true,"reason":"deleted","changed_at":"2026-10-16T09:40:03.004217Z"}],"next_cursor":"MjAyNi0xMC0xNlQwOTo0MDowMy4wMDQyMTcrMDA6MDB8MDE5OGE1YjAtOWYxMS03YzAyLThlNWQtMmE3YjNjOWQ0ZWQx","has_more":true}},"include_customer":{"summary":"A page with `include=customer`","value":{"data":[{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"],"customer":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","firstname":"Kari","lastname":"Nordmann","email":"kari@example.com","phone":"+4790000001","marketing_consent":{"granted_at":"2026-03-14T00:00:00.000000Z","source":"widget"}}}],"next_cursor":null,"has_more":false}}},"schema":{"$ref":"#/components/schemas/BookingsPage"}}}},"400":{"description":"A malformed `cursor` or one from the other order, a `limit` outside 1–100, a `restaurant_id` that is not a UUID, a non-ISO `from`/`to`, an unknown booking `status`, an `updated_since` that is not an instant with an offset or reaches back more than 90 days, `updated_since` beside `from`, `to` or `status`, or an `include` other than `customer` answer `validation-failed`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-status":{"summary":"GET /bookings?status=bogus","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"status","code":"invalid_value","detail":"Unknown booking status 'bogus'. Accepted: booking_confirmed, booking_requested, waitlist_requested, guest_arrived, guest_seated, completed, guest_no_show, system_closed_confirmed_booking, system_closed_booking_request, system_closed_waitlist_request, guest_cancelled_confirmed_booking, restaurant_cancelled_confirmed_booking, guest_cancelled_booking_request, restaurant_declined_booking_request, guest_cancelled_waitlist_request, restaurant_declined_waitlist_request."}]}},"restaurant_id-not-a-uuid":{"summary":"GET /bookings?restaurant_id=not-a-uuid","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_id","code":"schema_invalid","detail":"Invalid UUID"}]}},"from-not-a-date":{"summary":"GET /bookings?from=not-a-date","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"from","code":"invalid_value","detail":"`from` must be an ISO 8601 date (YYYY-MM-DD) or an instant with an explicit offset"}]}},"updated_since-with-status":{"summary":"GET /bookings?updated_since=2026-10-16T00:00:00Z&status=completed","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"updated_since","code":"invalid_value","detail":"`updated_since` cannot be combined with `from`, `to` or `status`: a booking that changed out of the filter could not be reported. Filter the page yourself; `restaurant_id` may be combined."}]}},"limit-out-of-range":{"summary":"GET /bookings?limit=0","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"limit","code":"schema_invalid","detail":"Too small: expected number to be >=1"}]}},"cursor-not-from-a-previous-page":{"summary":"GET /bookings?cursor=not-a-cursor","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"cursor","code":"schema_invalid","detail":"Invalid cursor — pass back a `next_cursor` from a previous page unchanged, or omit it for the first page"}]}},"unknown-include":{"summary":"GET /bookings?include=contact","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include","code":"invalid_value","detail":"Unknown include 'contact' (expected customer)"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `bookings:read`, refused before the rate-limit charge, or `include=customer` was sent without `customers:read` (`insufficient-scope`, after the charge). `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /bookings with a key that lacks `bookings:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"customer-without-customers-read":{"summary":"GET /bookings?include=customer with a key that holds `bookings:read` but not `customers:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createBooking","tags":["bookings"],"security":[{"cdpApiKey":["bookings:write"]}],"summary":"Create a booking","description":"Writes a reservation into the venue’s diary for a guest you name with `customer_id` or describe with `customer`, whose details are resolved against the tenant’s guests so a returning guest is reused. The reservation, its tables, that guest and any `values` (which need `attributes:write` as well) are written in one transaction, so a refused request leaves nothing behind. See https://developer.ninetables.io/guides/bookings/. Requires `bookings:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer":{"firstname":"Kari","lastname":"Nordmann","phone":"+4790000001"},"start_time":"2026-08-18T19:00:00Z","duration_minutes":120,"guest_count":4},"schema":{"$ref":"#/components/schemas/BookingCreateBody"}}}},"responses":{"201":{"description":"Created. `Location` addresses the new reservation.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/bookings/0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"booking_confirmed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"guest":{"customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","created":true,"match_reason":"new"},"values":{"spend":{"value":1240,"updated_at":"2026-08-19T17:02:02.854000Z","source":"api"}},"accepted_outside_opening_hours":false,"accepted_above_online_party_limit":false},"schema":{"$ref":"#/components/schemas/BookingCreated"}}}},"400":{"description":"The body failed schema validation, or named what this tenant cannot be booked against — an impossible date, an `end_time` not after `start_time`, a restaurant, guest, table or area it does not hold or has removed, a disabled or demo venue, a `customer` with neither email nor phone or matching more than one guest, or a refused `values` key (`validation-failed`). Each offending member is its own `errors[]` entry, and no reservation was written. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"neither-guest-form":{"summary":"POST /bookings with no `customer_id` and no `customer`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Send exactly one of `customer_id` and `customer`"}]}},"customer-with-no-email-or-phone":{"summary":"POST /bookings {\"customer\": {\"firstname\": \"Kari\", \"lastname\": \"Nordmann\"}, …}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"customer.email","code":"schema_invalid","detail":"Provide an `email` or a `phone`: a name alone is not evidence of identity, so a guest with neither could never be matched or deduplicated again. Send the name alongside, where it is stored and is what tells two guests on one channel apart."},{"key":"customer.phone","code":"schema_invalid","detail":"Provide an `email` or a `phone`: a name alone is not evidence of identity, so a guest with neither could never be matched or deduplicated again. Send the name alongside, where it is stored and is what tells two guests on one channel apart."}]}},"customer-details-match-more-than-one-guest":{"summary":"POST /bookings with a `customer` whose email two guests hold under different names","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"customer","code":"invalid_value","detail":"The guest could not be resolved: these details match more than one existing guest, so no guest was created or reused — picking one would be a guess. Send the same details to POST /customers/resolve to see the candidates, then name the one you mean by its id, and no reservation was created."}]}},"start_time-without-an-offset":{"summary":"POST /bookings {\"start_time\": \"2026-08-18T19:00\", …}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"start_time","code":"schema_invalid","detail":"An RFC 3339 instant carrying an explicit offset — `Z` or `+02:00`. A wall-clock time with no offset is refused rather than guessed at: `19:00` is two different instants in a venue on `Europe/Oslo` depending on the season, and reading it as UTC would seat the party at 21:00 on the venue’s own clock."}]}},"table-outside-the-restaurant":{"summary":"POST /bookings with a `table_ids` member belonging to another venue","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"table_ids","code":"invalid_value","detail":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88 is not a table of this booking’s restaurant. A booking holds only tables of its own restaurant, and never changes restaurant; read the ids from GET /restaurants/{restaurantId}/tables."}]}},"table-removed-from-the-floor-plan":{"summary":"POST /bookings with a `table_ids` member the venue has since removed","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"table_ids","code":"invalid_value","detail":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88 has been removed from the restaurant’s floor plan — the table itself, or the area it stood in — so no booking can take it on. A booking that already holds a removed table keeps it, so sending it back unchanged is accepted; the active tables are the ones GET /restaurants/{restaurantId}/tables lists."}]}},"unknown-attribute":{"summary":"POST /bookings {\"values\": {\"favourite_wine\": \"riesling\"}, …} — and no reservation is written, so the whole request is yours to re-send once the key is right","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"favourite_wine","code":"unknown_attribute","detail":"unknown booking attribute: favourite_wine"}]}},"body-missing":{"summary":"POST /bookings with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /bookings with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /bookings with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /bookings with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `bookings:write`, or the body carries `values` without `attributes:write` (`insufficient-scope`). Only the first is refused before the rate-limit charge, so the second carries `X-RateLimit-*`. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-bookings-write":{"summary":"POST /bookings with a key that lacks `bookings:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:write"}},"values-without-attributes-write":{"summary":"POST /bookings {\"values\": {…}, …} with a key that holds `bookings:write` but not `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A table the body named is already held across that window (`conflict-booking-overlap`, naming the tables in `conflicting_tables`), or the `source_system`/`source_key` pair belongs to another booking of that restaurant (`identity-already-assigned`) or to a record this API does not acknowledge (`conflict-key-exists`, naming none). None writes anything, and the overlap needs a different retry from the pair — pick another table or window for the first, reconcile your own key for the others — so dispatch on `type` rather than on the status. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"table-already-held":{"summary":"POST /bookings with a `table_ids` member a confirmed booking already holds across the same window","value":{"type":"https://ninetables.io/problems/conflict-booking-overlap","title":"Conflict","status":409,"detail":"Table '7' is already held by another booking across this window. Nothing was written. Pick another table, move the window, or send no table at all and let the venue seat the party on the night.","code":"CONFLICT_BOOKING_OVERLAP","conflicting_tables":[{"table_id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","table_name":"7"}]}},"source-identity-pair-held-by-another-booking":{"summary":"POST /bookings with a `source_system`/`source_key` pair another live booking of that restaurant already holds","value":{"type":"https://ninetables.io/problems/identity-already-assigned","title":"Conflict","status":409,"detail":"This source identity is already assigned to another record","code":"IDENTITY_ALREADY_ASSIGNED","conflicting_id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55"}},"pair-held-by-a-record-this-api-does-not-acknowledge":{"summary":"POST /bookings with a `source_system`/`source_key` pair a booking this API does not acknowledge holds at that restaurant","value":{"type":"https://ninetables.io/problems/conflict-key-exists","title":"Conflict","status":409,"detail":"The source identity 'pos_x:order-777' is already in use","code":"CONFLICT_KEY_EXISTS"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings/{bookingRef}/attributes":{"get":{"operationId":"getBookingAttributes","tags":["bookings"],"security":[{"cdpApiKey":["attributes:read"]}],"summary":"Get a booking with its attribute values","description":"The booking’s attribute value set keyed by definition key, plus the booking as `booking` when the key also holds `bookings:read`. Values of archived definitions are left out unless `include_archived=true`. See https://developer.ninetables.io/guides/writing-attributes/#reading-values. Requires `attributes:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"bookingRef","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"}],"responses":{"200":{"description":"The values, and the booking for a key holding `bookings:read`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"values":{"spend":{"value":1240,"updated_at":"2026-08-19T17:02:02.854000Z","source":"api"},"items_purchased":{"value":[{"key":"margherita","count":2,"last_at":"2026-08-18T19:22:00.000000Z"}],"updated_at":"2026-08-19T17:02:02.854000Z","source":"api"}}},"schema":{"type":"object","properties":{"booking":{"anyOf":[{"$ref":"#/components/schemas/BookingSummary"}],"description":"Present only when the key holds `bookings:read`. The booking’s own fields, as `GET /bookings/{bookingRef}` returns them."},"values":{"$ref":"#/components/schemas/ValuesEchoRecord"}},"required":["values"]}}}},"400":{"description":"The `{bookingRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"GET /bookings/order-777/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'order-777' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"GET /bookings/pos x:order 777/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:order 777' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"include_archived-not-a-boolean":{"summary":"GET /bookings/{bookingRef}/attributes?include_archived=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_archived","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /bookings/{bookingRef}/attributes with a key that lacks `attributes:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such booking (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A `{source_system}:{source_key}` ref names bookings at more than one of your restaurants, since a booking key is unique per restaurant rather than per tenant (`ambiguous-ref`): address the booking by its id instead.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-names-bookings-at-several-restaurants":{"summary":"GET /bookings/pos_x:order-777/attributes","value":{"type":"https://ninetables.io/problems/ambiguous-ref","title":"Conflict","status":409,"detail":"'pos_x:order-777' names bookings at 2 restaurants. Address the booking by its id.","code":"AMBIGUOUS_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateBookingAttributes","tags":["bookings"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Write booking attribute values","description":"The same write as `PATCH /customers/{customerRef}/attributes`: the keys present in `values` are written, `null` clearing one, all or nothing. The optional `expect` map refuses the whole write with 409 `conflict-stale-write` when a value changed since you read it. See https://developer.ninetables.io/guides/writing-attributes/. Requires `attributes:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"bookingRef","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"values":{"spend":1240}},"schema":{"$ref":"#/components/schemas/AttributesPatchBody"}}}},"responses":{"200":{"description":"The post-write value set: the booking’s full value set when the key holds `attributes:read`, otherwise only the keys this request wrote.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"values":{"spend":{"value":1240,"updated_at":"2026-08-19T17:02:02.854000Z","source":"api"},"items_purchased":{"value":[{"key":"margherita","count":2,"last_at":"2026-08-18T19:22:00.000000Z"}],"updated_at":"2026-08-19T17:02:02.854000Z","source":"api"}}},"schema":{"type":"object","properties":{"values":{"$ref":"#/components/schemas/ValuesEchoRecord"}},"required":["values"]}}}},"400":{"description":"The `{bookingRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). Per-attribute failures (unknown key, wrong entity, type mismatch, unknown option, writing a computed attribute) come back as `validation-failed` with one `errors[]` entry per offending key. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-attribute":{"summary":"PATCH /bookings/{bookingRef}/attributes {\"values\": {\"favourite_wine\": \"riesling\"}}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"favourite_wine","code":"unknown_attribute","detail":"unknown booking attribute: favourite_wine"}]}},"ref-neither-uuid-nor-pair":{"summary":"PATCH /bookings/order-777/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'order-777' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"PATCH /bookings/pos x:order 777/attributes","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:order 777' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"body-missing":{"summary":"PATCH /bookings/{bookingRef}/attributes with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PATCH /bookings/{bookingRef}/attributes with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PATCH /bookings/{bookingRef}/attributes with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PATCH /bookings/{bookingRef}/attributes with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PATCH /bookings/{bookingRef}/attributes with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such booking (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"An `expect` token that no longer matches its value’s current `updated_at` answers `conflict-stale-write`: the whole patch was refused, and `drifted` names the keys to re-read. A `{source_system}:{source_key}` ref names bookings at more than one of your restaurants, since a booking key is unique per restaurant rather than per tenant (`ambiguous-ref`): address the booking by its id instead. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"conflict-stale-write":{"summary":"PATCH with `expect` naming a key whose `updated_at` has changed since you read it","value":{"type":"https://ninetables.io/problems/conflict-stale-write","title":"Conflict","status":409,"detail":"The write was rejected: 1 attribute(s) changed since you read them — member_tier. Nothing was written; re-read the drifted keys and retry.","code":"CONFLICT_STALE_WRITE","drifted":["member_tier"]}},"ref-names-bookings-at-several-restaurants":{"summary":"PATCH /bookings/pos_x:order-777/attributes","value":{"type":"https://ninetables.io/problems/ambiguous-ref","title":"Conflict","status":409,"detail":"'pos_x:order-777' names bookings at 2 restaurants. Address the booking by its id.","code":"AMBIGUOUS_REF"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings/{bookingRef}/source-identity":{"put":{"operationId":"attachBookingSourceIdentity","tags":["bookings"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Attach a source identity to a booking","description":"Attaches your own key to the booking as the customer route does, and answers the booking id and your pair. Booking keys are unique per restaurant, so a ref naming bookings at several restaurants answers 409 `ambiguous-ref`. See https://developer.ninetables.io/guides/addressing/#one-key-per-system-per-record. Requires `attributes:write`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"bookingRef","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"source_system":"pos_x","source_key":"order-777"},"schema":{"$ref":"#/components/schemas/SourceIdentity"}}}},"responses":{"200":{"description":"The booking, carrying the key it now holds for your system.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"schema":{"$ref":"#/components/schemas/BookingSourceIdentityEcho"}}}},"400":{"description":"The `{bookingRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"source_key-missing":{"summary":"PUT /bookings/{bookingRef}/source-identity {\"source_system\": \"pos_x\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"source_key","code":"schema_invalid","detail":"Invalid input: expected string, received undefined"}]}},"ref-neither-uuid-nor-pair":{"summary":"PUT /bookings/order-777/source-identity","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'order-777' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"PUT /bookings/pos x:order 777/source-identity","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:order 777' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"body-missing":{"summary":"PUT /bookings/{bookingRef}/source-identity with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PUT /bookings/{bookingRef}/source-identity with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PUT /bookings/{bookingRef}/source-identity with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PUT /bookings/{bookingRef}/source-identity with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PUT /bookings/{bookingRef}/source-identity with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such booking (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"THIS booking already holds a different key for your system (`conflict-source-identity`, quoting it), ANOTHER booking at the same restaurant holds the pair (`identity-already-assigned`, exposing only `conflicting_id`), or a record this API does not acknowledge holds it (`conflict-key-exists`, with no id). A `{source_system}:{source_key}` ref names bookings at more than one of your restaurants, since a booking key is unique per restaurant rather than per tenant (`ambiguous-ref`): address the booking by its id instead.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"booking-holds-another-key-of-your-system":{"summary":"PUT /bookings/{ref}/source-identity {\"source_system\": \"pos_x\", \"source_key\": \"order-777\"} on a booking already holding pos_x:order-401","value":{"type":"https://ninetables.io/problems/conflict-source-identity","title":"Conflict","status":409,"detail":"This booking already has the source identity 'pos_x:order-401'","code":"CONFLICT_SOURCE_IDENTITY"}},"pair-held-by-another-booking":{"summary":"PUT /bookings/{ref}/source-identity {\"source_system\": \"pos_x\", \"source_key\": \"order-401\"} where order-401 is another booking’s pair at the same restaurant","value":{"type":"https://ninetables.io/problems/identity-already-assigned","title":"Conflict","status":409,"detail":"This source identity is already assigned to another record","code":"IDENTITY_ALREADY_ASSIGNED","conflicting_id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55"}},"ref-names-bookings-at-several-restaurants":{"summary":"PUT /bookings/pos_x:order-777/source-identity","value":{"type":"https://ninetables.io/problems/ambiguous-ref","title":"Conflict","status":409,"detail":"'pos_x:order-777' names bookings at 2 restaurants. Address the booking by its id.","code":"AMBIGUOUS_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/bookings/{bookingRef}/source-identity/{sourceSystem}":{"delete":{"operationId":"detachBookingSourceIdentity","tags":["bookings"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Remove a source identity from a booking","description":"Removes the key `{sourceSystem}` holds on this booking and answers the booking id with your pair null, plus its diary members when the key also holds `bookings:read`. Removing a key the booking does not hold answers the same 200, so a retry is safe. See https://developer.ninetables.io/guides/addressing/#one-key-per-system-per-record. Requires `attributes:write`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"bookingRef","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9._~-]{1,128}$","description":"The system whose key to remove — the `source_system` you attached it under, compared case-insensitively. It rides in the path, so it is held to the path charset `[A-Za-z0-9._~-]` and at most 128 characters; anything else is `400 invalid-ref`.","example":"pos_x"},"required":true,"description":"The system whose key to remove — the `source_system` you attached it under, compared case-insensitively. It rides in the path, so it is held to the path charset `[A-Za-z0-9._~-]` and at most 128 characters; anything else is `400 invalid-ref`.","name":"sourceSystem","in":"path"}],"responses":{"200":{"description":"The booking, holding no key for that system.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":null,"source_key":null,"start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"schema":{"$ref":"#/components/schemas/BookingSourceIdentityEcho"}}}},"400":{"description":"The `{bookingRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`), or the query/body failed schema validation (`validation-failed`). The `{sourceSystem}` segment is held to the same charset and length as one half of a ref, and answers the same `invalid-ref`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"DELETE /bookings/order-777/source-identity/pos_x","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'order-777' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"DELETE /bookings/pos x:order 777/source-identity/pos_x","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:order 777' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}},"source-system-outside-the-path-charset":{"summary":"DELETE /bookings/{bookingRef}/source-identity/pos%20x","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x' is not a source_system a path can carry — 1 to 128 characters of [A-Za-z0-9._~-]","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"DELETE /bookings/{bookingRef}/source-identity/{sourceSystem} with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such booking (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A `{source_system}:{source_key}` ref names bookings at more than one of your restaurants, since a booking key is unique per restaurant rather than per tenant (`ambiguous-ref`): address the booking by its id instead.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-names-bookings-at-several-restaurants":{"summary":"DELETE /bookings/pos_x:order-777/source-identity/pos_x","value":{"type":"https://ninetables.io/problems/ambiguous-ref","title":"Conflict","status":409,"detail":"'pos_x:order-777' names bookings at 2 restaurants. Address the booking by its id.","code":"AMBIGUOUS_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/customers/{customerRef}/loyalty":{"get":{"operationId":"getCustomerLoyaltyMembership","tags":["loyalty"],"security":[{"cdpApiKey":["loyalty:read"]}],"summary":"Get a customer’s loyalty membership","description":"Whether the guest is a member of the restaurant’s loyalty club and, when they are, their status, tier, visits, period and where they joined. A guest who is not a member answers 200 with `member: false`. See https://developer.ninetables.io/guides/loyalty-members/#reading-a-membership. Requires `loyalty:read`.","parameters":[{"schema":{"$ref":"#/components/schemas/EntityRef"},"required":true,"description":"A customer or booking reference: a UUID, or `{source_system}:{source_key}` split on the first colon, each half in `[A-Za-z0-9._~-]` and at most 128 characters. Any RFC 9562 UUID is looked up (404 when it matches no record), while a segment of neither form, or a half over the limit, is `400 invalid-ref`. See https://developer.ninetables.io/guides/addressing/.","name":"customerRef","in":"path"}],"responses":{"200":{"description":"The guest’s membership, or `member: false` with `membership: null`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"member":true,"membership":{"id":"0198a5b0-5e1f-7c21-9a44-2b6d7e8f9a01","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","status":"active","tier":{"id":"0198a5b0-3c4d-7e5f-8a6b-7c8d9e0f1a2b","name":"Silver"},"visits":{"period":4,"total":11},"period_start":"2026-03-01T00:00:00.000000Z","renews_at":"2027-03-01T00:00:00.000000Z","joined_at":"2025-03-01T00:00:00.000000Z","joined_via_restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","join_source":"student","imported_from":"diller"}},"schema":{"type":"object","properties":{"member":{"type":"boolean"},"membership":{"anyOf":[{"$ref":"#/components/schemas/LoyaltyMembership"},{"type":"null"}],"description":"Null exactly when `member` is false."}},"required":["member","membership"]}}}},"400":{"description":"The `{customerRef}` path segment is neither a UUID nor a `{source_system}:{source_key}` pair in the `[A-Za-z0-9._~-]` charset (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"ref-neither-uuid-nor-pair":{"summary":"GET /customers/cust-889/loyalty","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'cust-889' is neither a UUID nor a {source_system}:{source_key} pair","code":"INVALID_REF"}},"ref-outside-the-path-charset":{"summary":"GET /customers/pos x:cust 889/loyalty","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'pos x:cust 889' has a half outside the path charset [A-Za-z0-9._~-] — use POST /customers/resolve for identifiers with other characters","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /customers/{customerRef}/loyalty with a key that lacks `loyalty:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'loyalty:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"loyalty:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such customer (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such customer","code":"NOT_FOUND","resource":"customer"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The tenant has not installed the loyalty club app (`loyalty-not-installed`). A club that is installed and switched off is not this: it reads, enrols and imports as usual.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"loyalty-not-installed":{"summary":"Any loyalty request on a tenant without the loyalty club app","value":{"type":"https://ninetables.io/problems/loyalty-not-installed","title":"Loyalty Club Not Installed","status":409,"detail":"The loyalty club app is not installed for this restaurant. The same request succeeds once an Owner installs the app in Nine Tables.","code":"LOYALTY_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/loyalty/members":{"post":{"operationId":"enrollLoyaltyMember","tags":["loyalty"],"security":[{"cdpApiKey":["loyalty:write"]}],"summary":"Enrol a guest in the loyalty club","description":"Enrols the guest holding `phone`, creating the guest when nobody does: `201` with `created: true` for a new membership, `200` with `created: false` for a guest already in the club. It sends nothing and issues nothing, not even the welcome reward the first visit brings, and works while the club is switched off. See https://developer.ninetables.io/guides/loyalty-members/#enrolling-a-guest. Requires `loyalty:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"phone":"+4790000001","first_name":"Kari","marketing_consent":true,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","source":"student"},"schema":{"$ref":"#/components/schemas/LoyaltyEnrollBody"}}}},"responses":{"200":{"description":"The guest was already a member; the membership is unchanged, while blank names and email are filled and consent is recorded as for a new member.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/customers/0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001/loyalty"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"membership":{"id":"0198a5b0-5e1f-7c21-9a44-2b6d7e8f9a01","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","status":"active","tier":{"id":"0198a5b0-3c4d-7e5f-8a6b-7c8d9e0f1a2b","name":"Silver"},"visits":{"period":4,"total":11},"period_start":"2026-03-01T00:00:00.000000Z","renews_at":"2027-03-01T00:00:00.000000Z","joined_at":"2025-03-01T00:00:00.000000Z","joined_via_restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","join_source":"student","imported_from":"diller"},"created":false},"schema":{"type":"object","properties":{"membership":{"anyOf":[{"$ref":"#/components/schemas/LoyaltyMembership"}],"description":"The membership after this request."},"created":{"type":"boolean","description":"True when this request made the membership. The `201`/`200` status says the same."}},"required":["membership","created"]}}}},"201":{"description":"The guest was enrolled. `Location` reads the membership back.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/customers/0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001/loyalty"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"membership":{"id":"0198a5b0-5e1f-7c21-9a44-2b6d7e8f9a01","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","status":"active","tier":null,"visits":{"period":0,"total":0},"period_start":"2026-03-01T00:00:00.000000Z","renews_at":"2027-03-01T00:00:00.000000Z","joined_at":"2025-03-01T00:00:00.000000Z","joined_via_restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","join_source":"student","imported_from":"diller"},"created":true},"schema":{"type":"object","properties":{"membership":{"anyOf":[{"$ref":"#/components/schemas/LoyaltyMembership"}],"description":"The membership after this request."},"created":{"type":"boolean","description":"True when this request made the membership. The `201`/`200` status says the same."}},"required":["membership","created"]}}}},"400":{"description":"The body failed validation (`validation-failed`): a phone `normalizePhoneE164` cannot read, no marketing consent where the club asks for it, a `restaurant_id` outside the tenant or the key or of an inactive (disabled or demo) restaurant, none from a key limited to several restaurants, or a new guest on a tenant with no live restaurant to record them at. Nothing was written. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"phone-without-country-code":{"summary":"POST /loyalty/members {\"phone\": \"4612345678\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"phone","code":"schema_invalid","detail":"Phone must be an international number behind a `+` or `00` prefix (`+4790000001`, `004790000001`), or a Norwegian mobile number without its country code (`90000001`). Spaces, dashes, dots and parentheses are ignored. A Swedish or Danish number needs its country code."}]}},"source-not-a-code":{"summary":"POST /loyalty/members {\"phone\": \"+4790000001\", \"source\": \"Student\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"source","code":"schema_invalid","detail":"Invalid string: must match pattern /^[a-z][a-z0-9-]{0,39}$/"}]}},"marketing-consent-required":{"summary":"POST /loyalty/members {\"phone\": \"+4790000001\"} where the club asks for marketing consent to join","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"marketing_consent","code":"invalid_value","detail":"This club asks for marketing consent to join, so send `marketing_consent: true` once the guest has given it."}]}},"restaurant-outside-the-key":{"summary":"POST /loyalty/members {\"phone\": \"+4790000001\", \"restaurant_id\": \"…\"} naming a restaurant of another tenant, or one the key is not limited to","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_id","code":"invalid_value","detail":"No restaurant with this id that your key reaches on this tenant. Read the ids from GET /restaurants."}]}},"body-missing":{"summary":"POST /loyalty/members with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /loyalty/members with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /loyalty/members with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /loyalty/members with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /loyalty/members with a key that lacks `loyalty:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'loyalty:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"loyalty:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The tenant has not installed the loyalty club app (`loyalty-not-installed`). A club that is installed and switched off is not this: it reads, enrols and imports as usual. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"loyalty-not-installed":{"summary":"Any loyalty request on a tenant without the loyalty club app","value":{"type":"https://ninetables.io/problems/loyalty-not-installed","title":"Loyalty Club Not Installed","status":409,"detail":"The loyalty club app is not installed for this restaurant. The same request succeeds once an Owner installs the app in Nine Tables.","code":"LOYALTY_NOT_INSTALLED"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/loyalty/members/import":{"post":{"operationId":"importLoyaltyMembers","tags":["loyalty"],"security":[{"cdpApiKey":["loyalty:import"]}],"summary":"Transfer members from another loyalty system","description":"Imports 1–100 members with their visit counts, join dates and the rewards your system already gave, under the file import’s rules: the guest holding each phone is found or created, a member the import cannot use is rejected on its own line, and nothing is sent to anyone. `dry_run: true` writes nothing and answers what would happen; each member costs one rate-limit token, and the key must reach every restaurant. See https://developer.ninetables.io/guides/loyalty-members/#transferring-members. Requires `loyalty:import`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"source_system":"diller","extracted_at":"2026-10-28T06:00:00Z","restaurant_map":{"Katla":"0198a5b0-1234-7abc-8def-0123456789ab"},"members":[{"member_id":"M-1001","phone":"+4791234567","first_name":"Kari","consent":true,"consent_at":"2025-10-22 16:35:20","joined_at":"2025-10-22","period_start":"2026-03-01","period_visits":7,"total_visits":12,"department":"Katla","rewarded_thresholds":[5]}]},"schema":{"$ref":"#/components/schemas/LoyaltyImportBody"}}}},"responses":{"200":{"description":"One line per member. A rejected member does not fail the call, so read every line.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"examples":{"import":{"summary":"The import","value":{"dry_run":false,"import_job_id":"0198a5b0-9d8e-7f6a-8b5c-4d3e2f1a0b9c","summary":{"members":2,"created":1,"updated":0,"skipped":0,"rejected":1},"members":[{"row":1,"member_id":"M-1001","status":"created"},{"row":2,"member_id":"M-1002","status":"rejected","reason":"invalid_phone"}]}},"dry_run":{"summary":"With `dry_run: true`","value":{"dry_run":true,"summary":{"rows":2,"decisions":{"create_customer":1,"create_membership":0,"update":0,"skip_existing_member":0,"rejected":1},"rejected_by_reason":{"invalid_phone":1},"conflicts":0,"key_phone_conflicts":0,"consent":{"new_guests":1,"at_from_file":1,"at_from_joined":0,"yes_in_source_not_in_nine_tables":0,"no_in_source_yes_in_nine_tables":0},"tiers":[{"tier_id":"0198a5b0-3c4d-7e5f-8a6b-7c8d9e0f1a2b","name":"Silver","threshold":5,"members":1}],"members_without_tier":0,"external":[{"tier_id":"0198a5b0-3c4d-7e5f-8a6b-7c8d9e0f1a2b","name":"Silver","threshold":5,"rewards":1}],"first_visit_rewards":[],"first_visit_gift_cards":0,"first_visit_gift_card_amount":0,"currency":"NOK","nt_visits_after_extract":{"visits":0,"members":0},"periods_expired":0,"extract_age_days":1,"extract_stale":false,"messages_to_send":0,"gift_cards_to_create":0},"members":[{"row":1,"member_id":"M-1001","decision":"create_customer"},{"row":2,"member_id":"M-1002","decision":"rejected","reason":"invalid_phone"}]}}},"schema":{"$ref":"#/components/schemas/LoyaltyImportResult"}}}},"400":{"description":"The body failed validation (`validation-failed`): more than 100 members, or more than the key’s `rate_limit_per_min`, a `member_id` over 128 characters, an `extracted_at` in the future, a `restaurant_map` naming a restaurant outside the tenant, or a `rewarded_thresholds` entry no tier of the club is at. Each refuses the whole call before anything is written. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"too-many-members":{"summary":"POST /loyalty/members/import with 101 members","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"members","code":"schema_invalid","detail":"Too big: expected array to have <=100 items"}]}},"unknown-tier-threshold":{"summary":"POST /loyalty/members/import with a member whose `rewarded_thresholds` is `[7]`, in a club whose tiers are at 3, 5 and 10 visits","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"members.0.rewarded_thresholds","code":"invalid_value","detail":"No tier of this club is at 7 visits; its tiers are at 3, 5 and 10 visits."}]}},"restaurant-outside-the-tenant":{"summary":"POST /loyalty/members/import {\"restaurant_map\": {\"Katla\": \"…\"}, …} naming a restaurant of another tenant","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_map","code":"invalid_value","detail":"'Katla' maps to no restaurant of this tenant. Read the ids from GET /restaurants, or map the department to null when it is no venue."}]}},"members-over-key-rate-limit":{"summary":"POST /loyalty/members/import with 60 members, under a key whose `rate_limit_per_min` is 50","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"members","code":"schema_invalid","detail":"An import costs one token per member and this key's rate limit is 50 per minute, so an import can carry at most 50 members"}]}},"body-missing":{"summary":"POST /loyalty/members/import with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /loyalty/members/import with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /loyalty/members/import with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /loyalty/members/import with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `loyalty:import` (`insufficient-scope`), or is limited to some of the tenant’s restaurants (`tenant-wide-key-required`). Only the first is refused before the rate-limit charge, so the second carries `X-RateLimit-*`. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /loyalty/members/import with a key that lacks `loyalty:import`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'loyalty:import' scope","code":"INSUFFICIENT_SCOPE","required_scope":"loyalty:import"}},"restaurant-limited-key":{"summary":"POST /loyalty/members/import with a key limited to some restaurants","value":{"type":"https://ninetables.io/problems/tenant-wide-key-required","title":"Tenant-Wide Key Required","status":403,"detail":"A loyalty import acts on every guest of the tenant, so it needs a key that reaches every restaurant; this key is limited to some","code":"TENANT_WIDE_KEY_REQUIRED"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The tenant has not installed the loyalty club app (`loyalty-not-installed`). A club that is installed and switched off is not this: it reads, enrols and imports as usual. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"loyalty-not-installed":{"summary":"Any loyalty request on a tenant without the loyalty club app","value":{"type":"https://ninetables.io/problems/loyalty-not-installed","title":"Loyalty Club Not Installed","status":409,"detail":"The loyalty club app is not installed for this restaurant. The same request succeeds once an Owner installs the app in Nine Tables.","code":"LOYALTY_NOT_INSTALLED"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/availability":{"get":{"operationId":"getAvailability","tags":["bookings"],"security":[{"cdpApiKey":[]}],"summary":"List bookable sittings for one date","description":"The minutes a party of `party_size` may book at one restaurant on one date, grouped by service period: the same minutes the venue’s booking widget offers, so a slot’s `start_time` passes straight to `POST /bookings`. A date with nothing on offer is a 200 with an empty `periods` and a `closed_reason`, never an error. See https://developer.ninetables.io/guides/bookings/#reading-free-times. Requires no scope.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Which restaurant to ask about, by its `id` from `GET /restaurants`; opening hours, tables and service lengths are per restaurant, so there is no tenant-wide answer. An id this key cannot ask about — unknown, another tenant’s, disabled, demo or outside a limited key’s restaurants — is one identical refusal on `restaurant_id`, never an empty day.","example":"0198a5b0-1234-7abc-8def-0123456789ab"},"required":true,"description":"Which restaurant to ask about, by its `id` from `GET /restaurants`; opening hours, tables and service lengths are per restaurant, so there is no tenant-wide answer. An id this key cannot ask about — unknown, another tenant’s, disabled, demo or outside a limited key’s restaurants — is one identical refusal on `restaurant_id`, never an empty day.","name":"restaurant_id","in":"query"},{"schema":{"type":"string","format":"date","description":"The calendar date to ask about, `YYYY-MM-DD`, read in the restaurant’s OWN time zone (echoed back as `timezone`) — never in UTC and never in yours. A past date is accepted and answers no sittings.","example":"2026-08-18"},"required":true,"description":"The calendar date to ask about, `YYYY-MM-DD`, read in the restaurant’s OWN time zone (echoed back as `timezone`) — never in UTC and never in yours. A past date is accepted and answers no sittings.","name":"date","in":"query"},{"schema":{"type":"integer","minimum":1,"description":"How many guests will sit, which decides the tables that can hold them and the service length that applies. The venue sets its own ceiling, so a party above `max_party_size_online` answers no slots and `closed_reason: \"party_size_above_online_limit\"`, as the widget does, rather than an error.","example":4},"required":true,"description":"How many guests will sit, which decides the tables that can hold them and the service length that applies. The venue sets its own ceiling, so a party above `max_party_size_online` answers no slots and `closed_reason: \"party_size_above_online_limit\"`, as the widget does, rather than an error.","name":"party_size","in":"query"},{"schema":{"type":"integer","minimum":15,"maximum":480,"description":"A sitting length to ask for instead of the venue’s default, which NARROWS the answer to the minutes whose service period sells that length. Omit it for each minute at the length the venue would hold for that party, as the slot’s `duration_minutes` reports.","example":120},"required":false,"description":"A sitting length to ask for instead of the venue’s default, which NARROWS the answer to the minutes whose service period sells that length. Omit it for each minute at the length the venue would hold for that party, as the slot’s `duration_minutes` reports.","name":"duration_minutes","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Restrict the answer to one seating area, by its `id` from `GET /restaurants/{restaurantId}/areas`; an area on its own weekly schedule, or with breaks or special hours of its own, then answers by them, so a date can be open for the restaurant and closed for the area. Omit it to ask across every area the venue offers online."},"required":false,"description":"Restrict the answer to one seating area, by its `id` from `GET /restaurants/{restaurantId}/areas`; an area on its own weekly schedule, or with breaks or special hours of its own, then answers by them, so a date can be open for the restaurant and closed for the area. Omit it to ask across every area the venue offers online.","name":"area_id","in":"query"},{"schema":{"type":"integer","minimum":1,"description":"For an area that sells by the table rather than by the cover (`sells_by_table` on `GET /restaurants/{restaurantId}/areas`): how many tables the party needs, which switches to table-quantity mode and makes `max_seatable_guests` null. Send it only with that area’s `area_id`, or with an `experience_id` seated in such an area: a count with no area, for an area that does not sell by the table, for a multi-area experience, or outside the area’s minimum and maximum is one refusal on `table_count`.","example":1},"required":false,"description":"For an area that sells by the table rather than by the cover (`sells_by_table` on `GET /restaurants/{restaurantId}/areas`): how many tables the party needs, which switches to table-quantity mode and makes `max_seatable_guests` null. Send it only with that area’s `area_id`, or with an `experience_id` seated in such an area: a count with no area, for an area that does not sell by the table, for a multi-area experience, or outside the area’s minimum and maximum is one refusal on `table_count`.","name":"table_count","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Ask for the minutes of one active experience or package, by its `id` from `GET /restaurants/{restaurantId}/experiences`, governed by its own schedule, areas, party range and sitting length rather than by the venue’s opening hours. Any other id is one refusal on `experience_id`, and a party outside the range answers no slots with `closed_reason: \"experience_party_size_out_of_range\"`."},"required":false,"description":"Ask for the minutes of one active experience or package, by its `id` from `GET /restaurants/{restaurantId}/experiences`, governed by its own schedule, areas, party range and sitting length rather than by the venue’s opening hours. Any other id is one refusal on `experience_id`, and a party outside the range answers no slots with `closed_reason: \"experience_party_size_out_of_range\"`.","name":"experience_id","in":"query"}],"responses":{"200":{"description":"The sittings on offer, or an empty `periods` with the reason there are none.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"examples":{"sittings-on-offer":{"summary":"A served date with room left","value":{"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","date":"2026-08-18","timezone":"Europe/Oslo","party_size":4,"periods":[{"key":"0198a5b0-77aa-7c10-9e21-5b6c7d8e9f01:1080:1380","name":"Dinner","opens":1080,"closes":1380,"restaurant_wide":true,"area_id":null,"slots":[{"start_time":"2026-08-18T17:00:00.000000Z","local_time":"19:00","minutes_from_midnight":1140,"duration_minutes":120,"tables_available":3,"selectable_durations":[90,120]},{"start_time":"2026-08-18T17:30:00.000000Z","local_time":"19:30","minutes_from_midnight":1170,"duration_minutes":120,"tables_available":1,"selectable_durations":[90,120]}]},{"key":"0198a5b0-77aa-7c10-9e21-5b6c7d8e9f03:1200:1440","name":"Late terrace","opens":1200,"closes":1440,"restaurant_wide":false,"area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e12","slots":[{"start_time":"2026-08-18T20:30:00.000000Z","local_time":"22:30","minutes_from_midnight":1350,"duration_minutes":90,"tables_available":2}]}],"closed_reason":null,"max_seatable_guests":8,"max_party_size_online":12}},"closed-that-date":{"summary":"A date the venue keeps no opening hours on","value":{"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","date":"2026-12-25","timezone":"Europe/Oslo","party_size":4,"periods":[],"closed_reason":"closed","max_seatable_guests":null,"max_party_size_online":12}}},"schema":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid","description":"The restaurant the answer is about, echoed from your query so a batch of concurrent asks can be matched up without tracking request order."},"date":{"type":"string","description":"The date the answer is about, echoed from your query. Every minute below is relative to midnight of this date in `timezone`."},"timezone":{"type":"string","description":"The restaurant’s own IANA time zone — the zone `date`, `local_time` and every minute count are expressed in. Use it to render a slot in venue time; `start_time` is already an absolute instant and needs nothing from it.","example":"Europe/Oslo"},"party_size":{"type":"integer","description":"The party size the answer was computed for, echoed from your query. It is what decided both which tables could hold the party and which service length each slot reports, so a cached answer must never be reused for a different party."},"periods":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/AvailabilityPeriod"}]},"description":"The service windows that still have room, in the order the day runs, each carrying its own sittings. Empty means nothing is on offer and `closed_reason` says why — which is a 200, not an error."},"closed_reason":{"anyOf":[{"$ref":"#/components/schemas/AvailabilityClosedReason"},{"type":"null"}],"description":"Null when at least one sitting came back; otherwise the reason there are none, which is what distinguishes a closed date from a full one and a party this venue will not take online from one it would. The values are listed on `AvailabilityClosedReason`."},"max_seatable_guests":{"type":["integer","null"],"description":"The largest party any table or combination at this venue could seat on this date, ignoring what is already booked — the N in \"we can seat up to N\". Null when the venue quotes no ceiling: a closed date, a venue that sells by the table, or an ask carrying `table_count` or a multi-area experience."},"max_party_size_online":{"type":"integer","description":"The largest party this venue accepts through online booking at all. A `party_size` above it is answered with no slots on every date, so read this once and clamp your own party picker to it rather than discovering the limit one date at a time."}},"required":["restaurant_id","date","timezone","party_size","periods","closed_reason","max_seatable_guests","max_party_size_online"]}}}},"400":{"description":"A parameter failed schema validation, `restaurant_id` names no active restaurant on your tenant, `experience_id` no active experience of it, or `table_count` a count the area does not sell (`validation-failed`). A query that is merely answered with nothing — a closed date, an impossible party size — is NOT a 400; it is a 200 with an empty `periods` and a `closed_reason`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"restaurant_id-names-no-restaurant":{"summary":"GET /availability?restaurant_id=0198a5b0-1234-7abc-8def-0123456789ab&date=2026-08-18&party_size=4 where that id is unknown, disabled, demo, another tenant’s, or outside the key’s restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_id","code":"invalid_value","detail":"No active restaurant with this id on your tenant. Read the ids from GET /restaurants; a disabled or demo restaurant is not one to send new bookings to."}]}},"experience_id-names-no-experience":{"summary":"GET /availability?restaurant_id=0198a5b0-1234-7abc-8def-0123456789ab&date=2026-08-18&party_size=4&experience_id=0198a5b0-5e6f-7a10-8b21-7c8d9e0f1a23 where that experience is unknown, another restaurant’s, or switched off, cancelled or removed","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"experience_id","code":"invalid_value","detail":"No active experience with this id at this restaurant. Read the ids from GET /restaurants/{restaurantId}/experiences."}]}},"table_count-not-sold-by-the-area":{"summary":"GET /availability?restaurant_id=0198a5b0-1234-7abc-8def-0123456789ab&date=2026-08-18&party_size=4&table_count=2 with no area_id, or for an area that does not sell by the table, or outside that area’s minimum and maximum","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"table_count","code":"invalid_value","detail":"This area does not sell this many tables. Send table_count only with the area_id of an area whose sells_by_table is true, within its minimum and maximum (GET /restaurants/{restaurantId}/areas)."}]}},"party_size-not-a-number":{"summary":"GET /availability?restaurant_id=0198a5b0-1234-7abc-8def-0123456789ab&date=2026-08-18&party_size=two","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"party_size","code":"schema_invalid","detail":"Invalid input: expected number, received NaN"}]}},"date-is-not-a-real-date":{"summary":"GET /availability?restaurant_id=0198a5b0-1234-7abc-8def-0123456789ab&date=2026-02-30&party_size=4","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"date","code":"schema_invalid","detail":"Invalid ISO date"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/restaurants":{"get":{"operationId":"listRestaurants","tags":["restaurants"],"security":[{"cdpApiKey":[]}],"summary":"List the tenant’s restaurants","description":"Every active restaurant on the tenant in one unpaginated `data` array, ordered by name, each `id` the one `GET /bookings?restaurant_id=` and a segment booking filter take, with the venue’s time zone, currency, address and public contact details beside it. Disabled and demo restaurants appear only with `include_inactive=true`, which you need to name every `restaurant_id` a booking can carry. See https://developer.ninetables.io/guides/bookings/#restaurants-and-their-ids. Requires no scope.","parameters":[{"schema":{"type":"string","enum":["true","false"],"description":"Include disabled and demo restaurants (default false)."},"required":false,"description":"Include disabled and demo restaurants (default false).","name":"include_inactive","in":"query"}],"responses":{"200":{"description":"The tenant’s restaurants, ordered by name.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b0-1234-7abc-8def-0123456789ab","name":"Bella Vista Downtown","active":true,"timezone":"Europe/Oslo","currency":"NOK","address":"Karl Johans gate 12","city":"Oslo","country":"NO","contact_phone":"+4722334455","contact_email":"downtown@bellavista.example"},{"id":"0198a5b0-5678-7abc-8def-0123456789cd","name":"Bella Vista Harbour","active":true,"timezone":"Europe/Oslo","currency":"NOK","address":"Aker Brygge 3","city":"Oslo","country":"NO","contact_phone":"+4722334466","contact_email":null}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Restaurant"}}},"required":["data"]}}}},"400":{"description":"The `include_inactive` query parameter was neither `true` nor `false` (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"include_inactive-not-a-boolean":{"summary":"GET /restaurants?include_inactive=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_inactive","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/restaurants/{restaurantId}/areas":{"get":{"operationId":"listRestaurantAreas","tags":["restaurants"],"security":[{"cdpApiKey":[]}],"summary":"List a restaurant’s areas","description":"Every area of one restaurant in one unpaginated `data` array, ordered by name, each `id` the one a booking’s `requested_area_id` and `GET /availability?area_id=` take. Removed areas appear only with `include_inactive=true`, which names every `requested_area_id` a booking can carry. See https://developer.ninetables.io/guides/bookings/#areas-tables-and-experiences. Requires no scope.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The restaurant, by its `id` from `GET /restaurants`, disabled ones included. An id this key cannot read — unknown, another tenant’s or outside a limited key’s restaurants — is one identical refusal on `restaurantId`.","example":"0198a5b0-1234-7abc-8def-0123456789ab"},"required":true,"description":"The restaurant, by its `id` from `GET /restaurants`, disabled ones included. An id this key cannot read — unknown, another tenant’s or outside a limited key’s restaurants — is one identical refusal on `restaurantId`.","name":"restaurantId","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"Include areas the venue has removed from its floor plan (default false), so an id an older booking still carries can be named."},"required":false,"description":"Include areas the venue has removed from its floor plan (default false), so an id an older booking still carries can be named.","name":"include_inactive","in":"query"}],"responses":{"200":{"description":"The restaurant’s areas, ordered by name.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"Dining room","description":null,"active":true,"booking_priority":1,"available_online":true,"uses_own_opening_hours":false,"sells_by_table":false,"min_table_count":null,"max_table_count":null},{"id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e12","name":"Terrace","description":"Heated and covered from October to April.","active":true,"booking_priority":2,"available_online":true,"uses_own_opening_hours":true,"sells_by_table":false,"min_table_count":null,"max_table_count":null}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Area"}}},"required":["data"]}}}},"400":{"description":"The `{restaurantId}` path segment is not a UUID (`invalid-ref`), `include_inactive` was neither `true` nor `false`, or the id names no restaurant this key may read (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"restaurantId-names-no-restaurant":{"summary":"GET /restaurants/0198a5b0-1234-7abc-8def-0123456789ab/areas where that id is unknown, another tenant’s, or outside the key’s restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurantId","code":"invalid_value","detail":"No restaurant with this id on your tenant. Read the ids from GET /restaurants, with include_inactive=true for a disabled or demo one."}]}},"malformed-restaurantId":{"summary":"GET /restaurants/not-a-uuid/areas","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {restaurantId} path segment: Invalid UUID","code":"INVALID_REF"}},"include_inactive-not-a-boolean":{"summary":"GET /restaurants/0198a5b0-1234-7abc-8def-0123456789ab/areas?include_inactive=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_inactive","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/restaurants/{restaurantId}/tables":{"get":{"operationId":"listRestaurantTables","tags":["restaurants"],"security":[{"cdpApiKey":[]}],"summary":"List a restaurant’s tables","description":"Every table of one restaurant in one unpaginated `data` array, ordered by name, each `id` the one `table_ids` takes on `POST /bookings` and `PATCH /bookings/{bookingRef}`. Removed tables, and those of a removed area, appear only with `include_inactive=true`, which names every id a booking’s `table_ids` can carry. See https://developer.ninetables.io/guides/bookings/#areas-tables-and-experiences. Requires no scope.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The restaurant, by its `id` from `GET /restaurants`, disabled ones included. An id this key cannot read — unknown, another tenant’s or outside a limited key’s restaurants — is one identical refusal on `restaurantId`.","example":"0198a5b0-1234-7abc-8def-0123456789ab"},"required":true,"description":"The restaurant, by its `id` from `GET /restaurants`, disabled ones included. An id this key cannot read — unknown, another tenant’s or outside a limited key’s restaurants — is one identical refusal on `restaurantId`.","name":"restaurantId","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"Include tables the venue has removed, and those of a removed area (default false), so an id an older booking still carries can be named."},"required":false,"description":"Include tables the venue has removed, and those of a removed area (default false), so an id an older booking still carries can be named.","name":"include_inactive","in":"query"}],"responses":{"200":{"description":"The restaurant’s tables, ordered by name.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"12","capacity_from":2,"capacity_to":4,"active":true,"booking_priority":10,"shape":"rectangle"},{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b89","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e12","name":"T1","capacity_from":1,"capacity_to":2,"active":true,"booking_priority":5,"shape":"round"}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Table"}}},"required":["data"]}}}},"400":{"description":"The `{restaurantId}` path segment is not a UUID (`invalid-ref`), `include_inactive` was neither `true` nor `false`, or the id names no restaurant this key may read (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"restaurantId-names-no-restaurant":{"summary":"GET /restaurants/0198a5b0-1234-7abc-8def-0123456789ab/tables where that id is unknown, another tenant’s, or outside the key’s restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurantId","code":"invalid_value","detail":"No restaurant with this id on your tenant. Read the ids from GET /restaurants, with include_inactive=true for a disabled or demo one."}]}},"malformed-restaurantId":{"summary":"GET /restaurants/not-a-uuid/tables","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {restaurantId} path segment: Invalid UUID","code":"INVALID_REF"}},"include_inactive-not-a-boolean":{"summary":"GET /restaurants/0198a5b0-1234-7abc-8def-0123456789ab/tables?include_inactive=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_inactive","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/restaurants/{restaurantId}/experiences":{"get":{"operationId":"listRestaurantExperiences","tags":["restaurants"],"security":[{"cdpApiKey":[]}],"summary":"List a restaurant’s experiences","description":"Every experience or package one restaurant sells, in one unpaginated `data` array in the venue’s own order, each `id` the one `GET /availability?experience_id=` takes. Experiences the venue has switched off, cancelled or removed appear only with `include_inactive=true`. See https://developer.ninetables.io/guides/bookings/#areas-tables-and-experiences. Requires no scope.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The restaurant, by its `id` from `GET /restaurants`, disabled ones included. An id this key cannot read — unknown, another tenant’s or outside a limited key’s restaurants — is one identical refusal on `restaurantId`.","example":"0198a5b0-1234-7abc-8def-0123456789ab"},"required":true,"description":"The restaurant, by its `id` from `GET /restaurants`, disabled ones included. An id this key cannot read — unknown, another tenant’s or outside a limited key’s restaurants — is one identical refusal on `restaurantId`.","name":"restaurantId","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"Include experiences the venue has switched off, cancelled or removed (default false), so an id an older booking still carries can be named."},"required":false,"description":"Include experiences the venue has switched off, cancelled or removed (default false), so an id an older booking still carries can be named.","name":"include_inactive","in":"query"}],"responses":{"200":{"description":"The restaurant’s experiences, in the venue’s own order.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b0-5e6f-7a10-8b21-7c8d9e0f1a23","name":"Seven-course tasting menu","active":true,"listed_online":true,"multi_area":false,"duration_minutes":180,"min_party_size":2,"max_party_size":8},{"id":"0198a5b0-5e6f-7a10-8b21-7c8d9e0f1a24","name":"Aperitif and dinner","active":true,"listed_online":false,"multi_area":true,"duration_minutes":null,"min_party_size":2,"max_party_size":null}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Experience"}}},"required":["data"]}}}},"400":{"description":"The `{restaurantId}` path segment is not a UUID (`invalid-ref`), `include_inactive` was neither `true` nor `false`, or the id names no restaurant this key may read (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"restaurantId-names-no-restaurant":{"summary":"GET /restaurants/0198a5b0-1234-7abc-8def-0123456789ab/experiences where that id is unknown, another tenant’s, or outside the key’s restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurantId","code":"invalid_value","detail":"No restaurant with this id on your tenant. Read the ids from GET /restaurants, with include_inactive=true for a disabled or demo one."}]}},"malformed-restaurantId":{"summary":"GET /restaurants/not-a-uuid/experiences","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {restaurantId} path segment: Invalid UUID","code":"INVALID_REF"}},"include_inactive-not-a-boolean":{"summary":"GET /restaurants/0198a5b0-1234-7abc-8def-0123456789ab/experiences?include_inactive=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_inactive","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"`app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/batch":{"post":{"operationId":"writeBatch","tags":["batch"],"security":[{"cdpApiKey":["attributes:write"]}],"summary":"Write attributes on many customers/bookings in one call","description":"Applies up to 100 attribute writes SEQUENTIALLY, one transaction per item, so each item succeeds or fails on its own and the call answers 200 with a result per item. Each item costs one rate-limit token. See https://developer.ninetables.io/guides/writing-attributes/#writing-many-records-with-post-batch. Requires `attributes:write`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"items":[{"entity":"customer","ref":"pos_x:cust-889","values":{"lifetime_spend":1250}},{"entity":"booking","ref":"pos_x:order-777","values":{"spend":1240}}]},"schema":{"$ref":"#/components/schemas/BatchBody"}}}},"responses":{"200":{"description":"One result per item, in request order. A refused item does not fail the batch, so read every result’s `status`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"results":[{"index":0,"status":200,"entity":"customer","ref":"pos_x:cust-889","values":{"company_name":{"value":"Acme AS","updated_at":"2026-08-20T11:41:09.884000Z","source":"api"}}},{"index":1,"status":404,"entity":"booking","ref":"pos_x:order-777","problem":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such booking","code":"NOT_FOUND","resource":"booking"}}]},"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/BatchResult"}}},"required":["results"]}}}},"400":{"description":"The envelope failed validation: `items` missing, empty or too long, or an item with an unknown member (`validation-failed`). A refused item never answers here; it rides in the 200 as that item’s `problem`. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"items-empty":{"summary":"POST /batch {\"items\": []}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"items","code":"schema_invalid","detail":"Too small: expected array to have >=1 items"}]}},"items-over-key-rate-limit":{"summary":"POST /batch with 60 items, under a key whose `rate_limit_per_min` is 50","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"items","code":"schema_invalid","detail":"A batch costs one token per item and this key's rate limit is 50 per minute, so a batch can carry at most 50 items"}]}},"item-unknown-member":{"summary":"POST /batch {\"items\": [{…, \"upsert\": true}]}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"items.0","code":"schema_invalid","detail":"Unrecognized key: \"upsert\""}]}},"item-ref-too-short":{"summary":"POST /batch {\"items\": [{\"entity\": \"customer\", \"ref\": \"\", …}]}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"items.0.ref","code":"schema_invalid","detail":"Too small: expected string to have >=1 characters"}]}},"idempotency-key-too-long":{"summary":"POST /batch with an `Idempotency-Key` header of 200 characters","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"idempotency-key","code":"schema_invalid","detail":"Too big: expected string to have <=128 characters"}]}},"body-missing":{"summary":"POST /batch with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /batch with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /batch with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /batch with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /batch with a key that lacks `attributes:write`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:write' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:write"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/segments":{"get":{"operationId":"listSegments","tags":["segments"],"security":[{"cdpApiKey":["segments:read"]}],"summary":"List segments","description":"Lists the tenant’s segments by name, without their rules; archived ones only with `include_archived=true`. A key limited to some restaurants does not see a segment it cannot hold to them. See https://developer.ninetables.io/guides/segments/#listing-and-reading-segments. Requires `segments:read`.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"}],"responses":{"200":{"description":"Every matching segment, ordered by name and unpaginated: a tenant holds at most 200.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b1-2a44-7e10-9c31-5b6e7f801234","name":"High spenders","kind":"dynamic","archived_at":null,"updated_at":"2026-08-19T17:02:27.273000Z"},{"id":"0198a5b1-3c07-7a22-b410-8d2f4e6a9c77","name":"VIP list","kind":"fixed","archived_at":null,"updated_at":"2026-08-15T08:20:11.004000Z"}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SegmentListItem"}}},"required":["data"]}}}},"400":{"description":"The `include_archived` query parameter was neither `true` nor `false` (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"include_archived-not-a-boolean":{"summary":"GET /segments?include_archived=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_archived","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /segments with a key that lacks `segments:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/segments/{id}":{"get":{"operationId":"getSegment","tags":["segments"],"security":[{"cdpApiKey":["segments:read"]}],"summary":"Get one segment including its rules","description":"Fetches one segment with its rules: groups OR-ed, and the conditions within a group AND-ed. An archived segment is still readable here, while its count and members answer 404. See https://developer.ninetables.io/guides/segments/#listing-and-reading-segments. Requires `segments:read`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The segment.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a5b1-2a44-7e10-9c31-5b6e7f801234","name":"High spenders","kind":"dynamic","archived_at":null,"updated_at":"2026-08-19T17:02:27.273000Z","description":"Customers whose lifetime spend exceeds 5 000 NOK.","rules":{"version":1,"groups":[{"conditions":[{"kind":"attribute","definition_key":"lifetime_spend","operator":"gt","value":5000},{"kind":"booking","count_operator":"gte","count":2,"window":{"type":"last_days","days":365},"filters":[{"field":"status","operator":"in","value":["completed"]}]}]}]},"created_at":"2026-08-12T10:31:00.000000Z"},"schema":{"$ref":"#/components/schemas/Segment"}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"GET /segments/not-a-uuid","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /segments/{id} with a key that lacks `segments:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such segment (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such segment","code":"NOT_FOUND","resource":"segment"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/segments/{id}/count":{"get":{"operationId":"getSegmentCount","tags":["segments"],"security":[{"cdpApiKey":["segments:read"]}],"summary":"Count a segment’s members","description":"Counts a fixed segment’s frozen list, or evaluates a dynamic one live under a 5s budget, capped at 10000 (`is_capped`) and up to 60 seconds old. `count: null` means only that the evaluation timed out, so retry later; a dynamic segment that reads an unsettled computed attribute answers 409 `segment-pending` instead of a count. See https://developer.ninetables.io/guides/segments/#counting-a-segment. Requires `segments:read`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The count, or `count: null` when the evaluation timed out.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"count":1284,"is_capped":false},"schema":{"type":"object","properties":{"count":{"type":["integer","null"]},"is_capped":{"type":"boolean"}},"required":["count","is_capped"]}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"GET /segments/not-a-uuid/count","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /segments/{id}/count with a key that lacks `segments:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such segment (`not-found`), or the segment is archived and no longer served (`segment-archived`). Tell them apart by `type`: `GET /segments/{id}` still returns an archived segment.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/segment-archived","title":"Segment Archived","status":404,"detail":"This segment is archived and no longer served","code":"SEGMENT_ARCHIVED"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A dynamic segment whose rules read a computed attribute that is still `computing` or has `failed` (`segment-pending`, naming each in `pending_attributes[]`). Nothing is evaluated until every one is `ready`, so no partial answer is served. A fixed segment never answers it.","headers":{"Retry-After":{"description":"Present only on `segment-pending` (always `15`): how often the platform advances the computation. A `failed` attribute does not settle on its own.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"segment-pending":{"summary":"GET /segments/{id}/count while the platform is still computing `total_visits`, which the segment’s rules read","value":{"type":"https://ninetables.io/problems/segment-pending","title":"Segment Pending","status":409,"detail":"This request reads computed attributes whose values are not settled yet (total_visits), so it is not answered until they are. Each one’s `compute_state` on GET /definitions says where it stands.","code":"SEGMENT_PENDING","pending_attributes":["total_visits"]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/segments/{id}/customers":{"get":{"operationId":"listSegmentCustomers","tags":["segments"],"security":[{"cdpApiKey":["segments:read"]}],"summary":"List a segment’s member customers","description":"One page of a segment’s members: a fixed segment’s frozen list in customer id order, or a dynamic one evaluated live per page, which `sort` can order by an attribute and `filter` narrow by attribute values. A row carries the member’s id, its key for the system you name, `created_at` and email/phone presence flags unless `include` adds more. See https://developer.ninetables.io/guides/segments/#paging-a-segments-members. Requires `segments:read`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":32856,"description":"Opaque cursor from a previous response — pass back verbatim, with the same `filter` and `sort`."},"required":false,"description":"Opaque cursor from a previous response — pass back verbatim, with the same `filter` and `sort`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Rows per page, 1 to 100, and as many as allowed when omitted. With `include=attributes` the page holds at most 25 rows: a larger `limit` is clamped to that, not refused."},"required":false,"description":"Rows per page, 1 to 100, and as many as allowed when omitted. With `include=attributes` the page holds at most 25 rows: a larger `limit` is clamped to that, not refused.","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":50,"description":"Comma-separated extras: `contact` adds firstname/lastname/email/phone and `marketing_consent` and needs `contacts:read`, and `attributes` adds the attribute value set, needs `attributes:read` and caps the page at 25."},"required":false,"description":"Comma-separated extras: `contact` adds firstname/lastname/email/phone and `marketing_consent` and needs `contacts:read`, and `attributes` adds the attribute value set, needs `attributes:read` and caps the page at 25.","name":"include","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"\\S","description":"Your own system: each member holding a key from it carries that key, and every other row carries both halves null. Omit it and no key is disclosed at all."},"required":false,"description":"Your own system: each member holding a key from it carries that key, and every other row carries both halves null. Omit it and no key is disclosed at all.","name":"source_system","in":"query"},{"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2048,"pattern":"^[a-z][a-z0-9_]{0,63}:(after|anniversary_in_month|anniversary_next_days|anniversary_today|before|between|contains|contains_all|contains_any|contains_none|ends_with|eq|gt|gte|in|in_last_days|in_next_days|is_empty|is_false|is_not_set|is_set|is_true|key_count_gte|key_count_lte|key_in_group|key_last_at_in_last_days|key_last_at_more_than_days_ago|lt|lte|more_than_days_ago|more_than_days_ahead|neq|not_contains|not_in|starts_with|total_count_gte)(:.*)?$"},"maxItems":5,"description":"Repeatable, up to 5 ANDed: `<definition_key>:<operator>:<value>`, one segment attribute condition, with a list operator’s value as a comma list and each value percent-encoded within the parameter. An operator the key’s `data_type` does not take is refused, as in segment rules. See https://developer.ninetables.io/guides/computed-attributes/#lists.","examples":[["loyalty_tier:eq:gold"],["visits_12m:gte:3","loyalty_tier:in:gold,silver"]]},"required":false,"description":"Repeatable, up to 5 ANDed: `<definition_key>:<operator>:<value>`, one segment attribute condition, with a list operator’s value as a comma list and each value percent-encoded within the parameter. An operator the key’s `data_type` does not take is refused, as in segment rules. See https://developer.ninetables.io/guides/computed-attributes/#lists.","name":"filter","in":"query"},{"schema":{"type":"string","pattern":"^-?[a-z][a-z0-9_]{0,63}$","description":"Orders the page by one attribute: `<definition_key>` ascending, `-<definition_key>` descending, ties and guests without the value (who come last in either direction) by customer id. A `multi_select` or `counter_list` key has no order and is refused. See https://developer.ninetables.io/guides/computed-attributes/#lists.","examples":["-visits_12m","loyalty_tier"]},"required":false,"description":"Orders the page by one attribute: `<definition_key>` ascending, `-<definition_key>` descending, ties and guests without the value (who come last in either direction) by customer id. A `multi_select` or `counter_list` key has no order and is refused. See https://developer.ninetables.io/guides/computed-attributes/#lists.","name":"sort","in":"query"}],"responses":{"200":{"description":"One page of a segment’s members, ordered by customer id ascending, or with `sort` by that attribute and then id.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","created_at":"2026-03-14T18:22:05.118204Z","has_email":true,"has_phone":true},{"id":"0198a5b0-8d40-7f55-a1c2-6e9f0a1b2c3d","source_system":null,"source_key":null,"created_at":"2026-05-02T11:40:17.502911Z","has_email":true,"has_phone":false}],"next_cursor":"MDE5OGE1YjAtOGQ0MC03ZjU1LWExYzItNmU5ZjBhMWIyYzNk","has_more":true},"schema":{"$ref":"#/components/schemas/SegmentMembersPage"}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`), or `cursor` is malformed, `limit` is outside 1–100, `include` names something other than `contact` / `attributes`, a `filter` or `sort` is malformed or names a key or operator it cannot take, or either is sent for a fixed segment (`validation-failed`). `limit`, the shape of `sort`, the count of `filter` parameters and each one’s length are checked first, before the segment is looked up; `cursor`, `include`, a filter’s key, operator and value, and a sort’s key are checked only after the segment resolves, so on an id matching nothing those answer 404.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-include":{"summary":"GET /segments/{id}/customers?include=bogus","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include","code":"invalid_value","detail":"Unknown include 'bogus' (expected contact and/or attributes)"}]}},"limit-out-of-range":{"summary":"GET /segments/{id}/customers?limit=0","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"limit","code":"schema_invalid","detail":"Too small: expected number to be >=1"}]}},"cursor-not-from-a-previous-page":{"summary":"GET /segments/{id}/customers?cursor=not-a-cursor","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"cursor","code":"schema_invalid","detail":"Invalid cursor — pass back a `next_cursor` from a previous page unchanged, or omit it for the first page"}]}},"malformed-id":{"summary":"GET /segments/not-a-uuid/customers","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}},"sort-malformed":{"summary":"GET /segments/{id}/customers?sort=Visits_12m","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"sort","code":"schema_invalid","detail":"Expected `<definition_key>` for ascending order or `-<definition_key>` for descending"}]}},"too-many-filters":{"summary":"GET /segments/{id}/customers with 6 `filter` parameters","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"filter","code":"schema_invalid","detail":"Too big: expected array to have <=5 items"}]}},"fixed-segment-sort":{"summary":"GET /segments/{id}/customers?sort=-visits_12m on a fixed segment","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"sort","code":"invalid_value","detail":"A fixed segment’s members are frozen in customer id order, so `filter` and `sort` apply to dynamic segments only."}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `segments:read`, or `include=contact` was sent without `contacts:read`, or `include=attributes`, a `filter` or a `sort` without `attributes:read` (`insufficient-scope`). All but the first run after the rate-limit charge and after the segment resolves, so they carry `X-RateLimit-*` and a 404 wins over them; they also run before a filter’s key, operator and value and a sort’s key are checked, and before a fixed segment refuses `filter` and `sort`. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-segments-read":{"summary":"GET /segments/{id}/customers with a key that lacks `segments:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"contact-without-contacts-read":{"summary":"GET /segments/{id}/customers?include=contact with a key that holds `segments:read` but not `contacts:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"attributes-without-attributes-read":{"summary":"GET /segments/{id}/customers?include=attributes with a key that holds `segments:read` but not `attributes:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:read"}},"sort-without-attributes-read":{"summary":"GET /segments/{id}/customers?sort=-visits_12m with a key that holds `segments:read` but not `attributes:read`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'attributes:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"attributes:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such segment (`not-found`), or the segment is archived and no longer served (`segment-archived`). Tell them apart by `type`: `GET /segments/{id}` still returns an archived segment.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/segment-archived","title":"Segment Archived","status":404,"detail":"This segment is archived and no longer served","code":"SEGMENT_ARCHIVED"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A dynamic segment whose rules, `filter` or `sort` read a computed attribute that is still `computing` or has `failed` (`segment-pending`, naming each in `pending_attributes[]`). Nothing is evaluated until every one is `ready`, so no partial answer is served. A fixed segment never answers it.","headers":{"Retry-After":{"description":"Present only on `segment-pending` (always `15`): how often the platform advances the computation. A `failed` attribute does not settle on its own.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"segment-pending":{"summary":"GET /segments/{id}/customers while the platform is still computing `total_visits`, which the segment’s rules read","value":{"type":"https://ninetables.io/problems/segment-pending","title":"Segment Pending","status":409,"detail":"This request reads computed attributes whose values are not settled yet (total_visits), so it is not answered until they are. Each one’s `compute_state` on GET /definitions says where it stands.","code":"SEGMENT_PENDING","pending_attributes":["total_visits"]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks":{"get":{"operationId":"listWebhooks","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"List webhook subscriptions","description":"All of the tenant’s subscriptions, oldest first and never with their secrets. A key limited to some restaurants lists only those filtered to one of them. See https://developer.ninetables.io/guides/webhooks/#managing-subscriptions. Requires `webhooks:manage`.","responses":{"200":{"description":"The subscriptions, at most 10.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f","url":"https://example.com/nine-tables-hook","events":["segment.customer.entered","segment.customer.exited"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"initial_emitted_at":null,"include_contact":false,"include_customer":false,"active":true,"consecutive_failures":0,"disabled_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z","last_capped_at":null,"failing_since":null,"disabled_reason":null}]},"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscription"}}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /webhooks with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createWebhook","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Register a webhook subscription","description":"Registers an HTTPS endpoint for customer, segment and booking events and returns its signing `secret`, which no later read includes. Each event family, `include_contact: true` and `include_customer: true` need their read scopes on top of `webhooks:manage`. See https://developer.ninetables.io/guides/webhooks/#managing-subscriptions. Requires `webhooks:manage`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"url":"https://example.com/nine-tables-hook","events":["customer.updated","booking.created","booking.updated"],"source_system":"pos_x"},"schema":{"$ref":"#/components/schemas/WebhookCreateBody"}}}},"responses":{"201":{"description":"Created, carrying `secret`; `Location` points at the subscription.","headers":{"Location":{"description":"Absolute path of the created resource, this API's base path (`/functions/v1/customer-data-api`) included: a GET on it, against the host you called, reads the resource back.","schema":{"type":"string","examples":["/functions/v1/customer-data-api/webhooks/0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f"]}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"id":"0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f","url":"https://example.com/nine-tables-hook","events":["segment.customer.entered","segment.customer.exited"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"initial_emitted_at":null,"include_contact":false,"include_customer":false,"active":true,"consecutive_failures":0,"disabled_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z","last_capped_at":null,"failing_since":null,"disabled_reason":null,"secret":"whsec_ZXhhbXBsZS1zZWNyZXQtZG8tbm90LXVzZS1wcm9kLTE="},"schema":{"$ref":"#/components/schemas/WebhookSubscriptionCreated"}}}},"400":{"description":"The body failed schema validation or the endpoint rules on `url` (see https://developer.ninetables.io/guides/webhooks/#the-endpoint-url), or names what the subscription cannot hold: a segment the tenant does not hold or a limited key cannot see, a fixed or archived segment, a restaurant outside the tenant or outside a limited key’s restaurants, a segment event from a limited key, `emit_initial` with no segment event to backfill, or `include_customer` with no booking snapshot event to embed the guest in (`validation-failed`). Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"url-not-https":{"summary":"POST /webhooks {\"url\": \"http://example.com/hooks/nine-tables\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"url","code":"invalid_value","detail":"Webhook URLs must use https://"}]}},"unknown-event-type":{"summary":"POST /webhooks {\"url\":\"https://example.com/hooks/nine-tables\",\"events\":[\"segment.customer.updated\"]}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"events.0","code":"schema_invalid","detail":"Invalid option: expected one of \"customer.created\"|\"customer.updated\"|\"customer.merged\"|\"customer.deleted\"|\"segment.customer.entered\"|\"segment.customer.exited\"|\"booking.created\"|\"booking.updated\"|\"booking.deleted\"|\"definition.computed\""}]}},"emit-initial-without-a-segment-event":{"summary":"POST /webhooks {\"events\": [\"booking.updated\"], \"emit_initial\": true}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"emit_initial","code":"invalid_value","detail":"emit_initial backfills segment membership, so it needs at least one segment.customer.* event in events"}]}},"include-customer-without-a-booking-snapshot-event":{"summary":"POST /webhooks {\"events\": [\"booking.deleted\"], \"include_customer\": true}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_customer","code":"invalid_value","detail":"include_customer embeds the guest in a booking snapshot, so it needs booking.created or booking.updated in events"}]}},"unknown-segment":{"summary":"POST /webhooks {\"segment_id\": \"<id of no segment of this tenant>\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"segment_id","code":"invalid_value","detail":"No segment of this tenant has that id — read the ids from GET /segments"}]}},"restaurant-outside-a-limited-key":{"summary":"POST /webhooks {\"restaurant_id\": null} with a key limited to some restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_id","code":"invalid_value","detail":"This key is limited to some restaurants, so a webhook it manages must set restaurant_id to one of them — GET /me lists them."}]}},"segment-events-on-a-limited-key":{"summary":"POST /webhooks {\"events\": [\"segment.customer.entered\"], \"segment_id\": \"<a dynamic segment’s id>\"} with a key limited to some restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"events","code":"invalid_value","detail":"This key is limited to some restaurants, so a webhook it manages cannot carry segment events: a segment’s membership in deliveries counts bookings at every restaurant. A key covering every restaurant can subscribe to them."}]}},"body-missing":{"summary":"POST /webhooks with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"POST /webhooks with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"POST /webhooks with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"POST /webhooks with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `webhooks:manage`, refused before the rate-limit charge, or the subscription the request would leave carries data whose read scope the key lacks (`insufficient-scope`, after the charge): each event family, `include_contact: true` and `include_customer: true` need the read scopes `ApiScope` lists for them. Nothing was written. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /webhooks with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"customer-events-without-customers-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage` but not `customers:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"customer-events-without-contacts-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"segment-events-without-segments-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage` but not `segments:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"segment-events-without-contacts-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage`, `segments:read` but not `contacts:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"booking-events-without-bookings-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage` but not `bookings:read`, for a `booking.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"definition-events-without-definitions-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage` but not `definitions:read`, for a `definition.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"include-contact-without-contacts-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage` but not `contacts:read`, for `include_contact: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"include-customer-without-customers-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage` but not `customers:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"include-customer-without-contacts-read":{"summary":"POST /webhooks with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}":{"get":{"operationId":"getWebhook","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Get one webhook subscription","description":"One subscription, without its secret. See https://developer.ninetables.io/guides/webhooks/#the-subscription-object. Requires `webhooks:manage`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The subscription.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f","url":"https://example.com/nine-tables-hook","events":["segment.customer.entered","segment.customer.exited"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"initial_emitted_at":null,"include_contact":false,"include_customer":false,"active":true,"consecutive_failures":0,"disabled_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-19T17:02:27.273000Z","last_capped_at":null,"failing_since":null,"disabled_reason":null},"schema":{"$ref":"#/components/schemas/WebhookSubscription"}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"GET /webhooks/not-a-uuid","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /webhooks/{id} with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"updateWebhook","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Update a webhook subscription","description":"Writes the members you send and leaves the rest. A PATCH that could send the subscription’s data somewhere new, or send more of it, also needs the read scopes of the subscription it leaves, while removing events or turning something off needs only `webhooks:manage`. See https://developer.ninetables.io/guides/webhooks/#managing-subscriptions. Requires `webhooks:manage`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"example":{"active":true},"schema":{"$ref":"#/components/schemas/WebhookPatchBody"}}}},"responses":{"200":{"description":"The updated subscription, secret-free.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"id":"0198a5b2-0e33-7b81-9d40-4c1a2b3d5e6f","url":"https://example.com/hooks/nine-tables/v2","events":["segment.customer.entered","segment.customer.exited"],"segment_id":null,"restaurant_id":null,"source_system":"pos_x","emit_initial":false,"initial_emitted_at":null,"include_contact":false,"include_customer":false,"active":true,"consecutive_failures":0,"disabled_at":null,"created_at":"2026-08-18T09:14:03.117000Z","updated_at":"2026-08-20T11:41:09.884000Z","last_capped_at":null,"failing_since":null,"disabled_reason":null},"schema":{"$ref":"#/components/schemas/WebhookSubscription"}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`), or the body is refused as on `POST /webhooks` (`validation-failed`), judged before the subscription is looked up, so a bad body answers 400 even on an id that does not exist. Four of the bodies below are the request-body contract (no body, unparseable JSON, an absent or non-JSON `Content-Type`), refused ahead of the handler and the rate-limit charge (see https://developer.ninetables.io/guides/http-conventions/#bodies-are-json).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"url-not-https":{"summary":"PATCH /webhooks/{id} {\"url\": \"http://example.com/hooks/nine-tables\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"url","code":"invalid_value","detail":"Webhook URLs must use https://"}]}},"unknown-event-type":{"summary":"PATCH /webhooks/{id} {\"events\":[\"segment.customer.updated\"]}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"events.0","code":"schema_invalid","detail":"Invalid option: expected one of \"customer.created\"|\"customer.updated\"|\"customer.merged\"|\"customer.deleted\"|\"segment.customer.entered\"|\"segment.customer.exited\"|\"booking.created\"|\"booking.updated\"|\"booking.deleted\"|\"definition.computed\""}]}},"emit-initial-without-a-segment-event":{"summary":"PATCH /webhooks/{id} {\"events\": [\"booking.updated\"], \"emit_initial\": true}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"emit_initial","code":"invalid_value","detail":"emit_initial backfills segment membership, so it needs at least one segment.customer.* event in events"}]}},"include-customer-without-a-booking-snapshot-event":{"summary":"PATCH /webhooks/{id} {\"events\": [\"booking.deleted\"], \"include_customer\": true}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"include_customer","code":"invalid_value","detail":"include_customer embeds the guest in a booking snapshot, so it needs booking.created or booking.updated in events"}]}},"unknown-segment":{"summary":"PATCH /webhooks/{id} {\"segment_id\": \"<id of no segment of this tenant>\"}","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"segment_id","code":"invalid_value","detail":"No segment of this tenant has that id — read the ids from GET /segments"}]}},"restaurant-outside-a-limited-key":{"summary":"PATCH /webhooks/{id} {\"restaurant_id\": null} with a key limited to some restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"restaurant_id","code":"invalid_value","detail":"This key is limited to some restaurants, so a webhook it manages must set restaurant_id to one of them — GET /me lists them."}]}},"segment-events-on-a-limited-key":{"summary":"PATCH /webhooks/{id} {\"events\": [\"segment.customer.entered\"], \"segment_id\": \"<a dynamic segment’s id>\"} with a key limited to some restaurants","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"events","code":"invalid_value","detail":"This key is limited to some restaurants, so a webhook it manages cannot carry segment events: a segment’s membership in deliveries counts bookings at every restaurant. A key covering every restaurant can subscribe to them."}]}},"malformed-id":{"summary":"PATCH /webhooks/not-a-uuid","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}},"body-missing":{"summary":"PATCH /webhooks/{id} with `Content-Type: application/json` and no body","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is required"}]}},"body-not-json":{"summary":"PATCH /webhooks/{id} with `Content-Type: application/json` and the body `{`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Request body is not valid JSON"}]}},"content-type-not-json":{"summary":"PATCH /webhooks/{id} with `Content-Type: text/plain`","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — got 'text/plain'"}]}},"content-type-absent":{"summary":"PATCH /webhooks/{id} with a body and no `Content-Type` header","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"(root)","code":"schema_invalid","detail":"Content-Type must be application/json — the request carried no Content-Type header"}]}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `webhooks:manage`, refused before the rate-limit charge, or the subscription the request would leave carries data whose read scope the key lacks (`insufficient-scope`, after the charge): each event family, `include_contact: true` and `include_customer: true` need the read scopes `ApiScope` lists for them. Nothing was written. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"PATCH /webhooks/{id} with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"customer-events-without-customers-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage` but not `customers:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"customer-events-without-contacts-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"segment-events-without-segments-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage` but not `segments:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"segment-events-without-contacts-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage`, `segments:read` but not `contacts:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"booking-events-without-bookings-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage` but not `bookings:read`, for a `booking.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"definition-events-without-definitions-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage` but not `definitions:read`, for a `definition.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"include-contact-without-contacts-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage` but not `contacts:read`, for `include_contact: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"include-customer-without-customers-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage` but not `customers:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"include-customer-without-contacts-read":{"summary":"PATCH /webhooks/{id} with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"operationId":"deleteWebhook","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Delete a webhook subscription","description":"Deletes the subscription outright, with its undelivered events, and frees its slot under the tenant’s subscription cap. See https://developer.ninetables.io/guides/webhooks/#managing-subscriptions. Requires `webhooks:manage`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"deleted":true},"schema":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"DELETE /webhooks/not-a-uuid","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"DELETE /webhooks/{id} with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Rotate the signing secret","description":"Mints a new signing secret, returned only here, while the previous one keeps co-signing for 24 hours. A second rotation inside that overlap answers 409 unless `force=true` ends it, and a lost response can only be recovered by replaying its `Idempotency-Key`, so send one. See https://developer.ninetables.io/guides/webhooks/#rotating-the-signing-secret. Requires `webhooks:manage`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"Rotate even though the previous secret is still inside its overlap window, ending that window immediately."},"required":false,"description":"Rotate even though the previous secret is still inside its overlap window, ending that window immediately.","name":"force","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"The new secret and when the previous one stops co-signing.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"secret":"whsec_ZXhhbXBsZS1zZWNyZXQtZG8tbm90LXVzZS1wcm9kLTE=","previous_secret_valid_until":"2026-08-21T11:41:09.884000Z"},"schema":{"type":"object","properties":{"secret":{"type":"string"},"previous_secret_valid_until":{"type":"string","format":"date-time"}},"required":["secret","previous_secret_valid_until"]}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`), or `force` is neither `true` nor `false` (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"force-not-a-boolean":{"summary":"POST /webhooks/{id}/rotate-secret?force=maybe","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"force","code":"schema_invalid","detail":"Invalid option: expected one of \"true\"|\"false\""}]}},"malformed-id":{"summary":"POST /webhooks/not-a-uuid/rotate-secret","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /webhooks/{id}/rotate-secret with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"The previous secret is still co-signing, or a concurrent rotation replaced the secret first (`conflict-secret-rotation`), and nothing was rotated. The co-signing refusal names the instant the overlap ends. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"previous-secret-still-co-signing":{"summary":"POST /webhooks/{id}/rotate-secret within 24h of the last rotation, without `?force=true`","value":{"type":"https://ninetables.io/problems/conflict-secret-rotation","title":"Conflict","status":409,"detail":"The previous secret co-signs until 2026-08-21T11:41:09.884000Z. Rotating again now would end that overlap early and break any consumer still verifying with it. Retry after that time, or repeat with force to end the overlap immediately.","code":"CONFLICT_SECRET_ROTATION"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}/test":{"post":{"operationId":"testWebhook","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Send a test delivery","description":"Sends a signed sample of the first event in `events` to the endpoint, with `X-NineTables-Test: true` and member for member what a real delivery carries, even while `active` is false. It waits for the endpoint for up to 10 seconds, so give your client a timeout above 15 seconds. See https://developer.ninetables.io/guides/webhooks/#the-test-delivery. Requires `webhooks:manage`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The outcome, 200 even when the endpoint failed: see `delivered`.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"delivered":true,"status_code":200,"duration_ms":184,"error":null,"transport_error":null},"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status_code":{"type":["integer","null"],"description":"The endpoint’s HTTP status, or null when it was never reached. Non-null is exactly the case `error` renders as `HTTP <status>`."},"duration_ms":{"type":"integer"},"error":{"anyOf":[{"type":"string","enum":["timeout","dns","tls","connect","unknown"]},{"type":"string","pattern":"^HTTP \\d{3}$"},{"type":"null"}],"description":"Null on success, `HTTP <status>` when the endpoint answered outside 2xx, otherwise the transport symbol. Branch on `transport_error` and `status_code` instead, because a generator types this member as a bare string."},"transport_error":{"anyOf":[{"$ref":"#/components/schemas/DeliveryFailureSymbol"},{"type":"null"}],"description":"The `DeliveryFailureSymbol` when the endpoint was never reached, and null otherwise, including when it answered with a status `status_code` reports."}},"required":["delivered","status_code","duration_ms","error","transport_error"]}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"POST /webhooks/not-a-uuid/test","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks the scope this operation requires (`insufficient-scope`, naming it in `required_scope`), refused before the rate-limit charge at no token cost. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /webhooks/{id}/test with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"List a subscription’s deliveries","description":"One subscription’s deliveries, newest first and cursor-paginated, each with its status and every recorded attempt; `GET /webhooks/{id}/deliveries/{deliveryId}` adds the body. A key limited to some restaurants sees no segment delivery, and a booking delivery only for a booking at one of its restaurants. See https://developer.ninetables.io/guides/webhooks/#the-delivery-log. Requires `webhooks:manage`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":2000,"description":"Opaque cursor from a previous response — pass back verbatim."},"required":false,"description":"Opaque cursor from a previous response — pass back verbatim.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["pending","delivered","failed"],"description":"Only deliveries in this `WebhookDeliveryStatus`. Omit for all of them."},"required":false,"description":"Only deliveries in this `WebhookDeliveryStatus`. Omit for all of them.","name":"status","in":"query"}],"responses":{"200":{"description":"One page of deliveries, newest first.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"data":[{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","event_type":"booking.updated","created_at":"2026-08-19T17:02:27.273000Z","status":"delivered","next_attempt_at":null,"delivered_at":"2026-08-19T17:04:28.913000Z","failed_at":null,"last_error":null,"attempts":[{"attempt_no":1,"attempted_at":"2026-08-19T17:02:28.402000Z","status":503,"duration_ms":214,"response_excerpt":"Service Unavailable","transport_error":null},{"attempt_no":2,"attempted_at":"2026-08-19T17:04:28.913000Z","status":200,"duration_ms":96,"response_excerpt":null,"transport_error":null}]}],"next_cursor":"MjAyNi0wOC0xOVQxNzowMjoyNy4yNzMrMDA6MDB8MDE5OGE2YzEtMmY0MC03ZDEzLThhNTItM2I0YzVkNmU3Zjgw","has_more":true},"schema":{"$ref":"#/components/schemas/WebhookDeliveriesPage"}}}},"400":{"description":"The `{id}` path segment is not a UUID (`invalid-ref`), or `status`, `limit` or `cursor` is out of range (`validation-failed`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"unknown-status":{"summary":"GET /webhooks/{id}/deliveries?status=held","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"status","code":"schema_invalid","detail":"Invalid option: expected one of \"pending\"|\"delivered\"|\"failed\""}]}},"limit-out-of-range":{"summary":"GET /webhooks/{id}/deliveries?limit=0","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"limit","code":"schema_invalid","detail":"Too small: expected number to be >=1"}]}},"cursor-not-from-a-previous-page":{"summary":"GET /webhooks/{id}/deliveries?cursor=not-a-cursor","value":{"type":"https://ninetables.io/problems/validation-failed","title":"Validation Failed","status":400,"detail":"Request validation failed","code":"VALIDATION_FAILED","errors":[{"key":"cursor","code":"schema_invalid","detail":"Invalid cursor — pass back a `next_cursor` from a previous page unchanged, or omit it for the first page"}]}},"malformed-id":{"summary":"GET /webhooks/not-a-uuid/deliveries","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `webhooks:manage`, refused before the rate-limit charge, or the stored subscription carries data whose read scope the key lacks (`insufficient-scope`, after the charge): each event family, `include_contact: true` and `include_customer: true` need the read scopes `ApiScope` lists for them. Nothing was read or queued. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /webhooks/{id}/deliveries with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"customer-events-without-customers-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage` but not `customers:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"customer-events-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"segment-events-without-segments-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage` but not `segments:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"segment-events-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage`, `segments:read` but not `contacts:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"booking-events-without-bookings-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage` but not `bookings:read`, for a `booking.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"definition-events-without-definitions-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage` but not `definitions:read`, for a `definition.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"include-contact-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage` but not `contacts:read`, for `include_contact: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"include-customer-without-customers-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage` but not `customers:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"include-customer-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"example":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}/deliveries/{deliveryId}":{"get":{"operationId":"getWebhookDelivery","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Get one delivery with its body","description":"One delivery of the subscription: its delivery-log entry and the `body` it carries, as the dispatcher sends it. A delivery the delivery log does not show the key, or of an event the subscription no longer carries, answers 404. See https://developer.ninetables.io/guides/webhooks/#the-delivery-log. Requires `webhooks:manage`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"deliveryId","in":"path"}],"responses":{"200":{"description":"The delivery and its body.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/json":{"example":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","event_type":"booking.updated","created_at":"2026-08-19T17:02:27.273000Z","status":"delivered","next_attempt_at":null,"delivered_at":"2026-08-19T17:04:28.913000Z","failed_at":null,"last_error":null,"attempts":[{"attempt_no":1,"attempted_at":"2026-08-19T17:02:28.402000Z","status":503,"duration_ms":214,"response_excerpt":"Service Unavailable","transport_error":null},{"attempt_no":2,"attempted_at":"2026-08-19T17:04:28.913000Z","status":200,"duration_ms":96,"response_excerpt":null,"transport_error":null}],"body":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","type":"booking.updated","api_version":"1","created_at":"2026-08-19T17:02:27.273000Z","data":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"sample-order-1","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"booking_confirmed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":null,"allergens":["gluten"],"dietary_preferences":[],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"tables":[{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"12","capacity_from":2,"capacity_to":4,"active":true,"booking_priority":10,"shape":"rectangle"}],"changed":["status","guest_count"]}}},"schema":{"$ref":"#/components/schemas/WebhookDeliveryDetail"}}}},"400":{"description":"The `{id}` or `{deliveryId}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"GET /webhooks/not-a-uuid/deliveries/{deliveryId}","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}},"malformed-delivery-id":{"summary":"GET /webhooks/{id}/deliveries/not-a-uuid","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {deliveryId} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `webhooks:manage`, refused before the rate-limit charge, or the stored subscription carries data whose read scope the key lacks (`insufficient-scope`, after the charge): each event family, `include_contact: true` and `include_customer: true` need the read scopes `ApiScope` lists for them. Nothing was read or queued. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"customer-events-without-customers-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage` but not `customers:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"customer-events-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"segment-events-without-segments-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage` but not `segments:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"segment-events-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage`, `segments:read` but not `contacts:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"booking-events-without-bookings-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage` but not `bookings:read`, for a `booking.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"definition-events-without-definitions-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage` but not `definitions:read`, for a `definition.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"include-contact-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage` but not `contacts:read`, for `include_contact: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"include-customer-without-customers-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage` but not `customers:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"include-customer-without-contacts-read":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook or delivery (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"webhook-not-found":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with an id that is no subscription of this tenant","value":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"}},"delivery-not-found":{"summary":"GET /webhooks/{id}/deliveries/{deliveryId} with a `deliveryId` that is no delivery of that subscription","value":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such delivery","code":"NOT_FOUND","resource":"delivery"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{id}/deliveries/{deliveryId}/redeliver":{"post":{"operationId":"redeliverWebhookDelivery","tags":["webhooks"],"security":[{"cdpApiKey":["webhooks:manage"]}],"summary":"Redeliver one delivery","description":"Queues a delivered or failed delivery to be sent again, with the same `webhook-id`, the body as it is stored now (turning `include_contact` or `include_customer` off, or erasing the guest, reduces it) and a fresh retry schedule, and leaves a `pending` one as it is; the subscription must be active, and a delivery the delivery log does not show the key, or of an event the subscription no longer carries, answers 404. A customer or segment delivery that was sent before the guest was erased answers 409 `conflict-delivery-erased` and is never sent again; the `customer.deleted` event the erasure sends, and booking deliveries (with `customer_id` and any embedded `customer` null), stay redeliverable. See https://developer.ninetables.io/guides/webhooks/#redelivery. Requires `webhooks:manage`. Accepts `Idempotency-Key`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"deliveryId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","example":"outbox-row-7c1f0a3e"},"required":false,"description":"Opt-in replay protection, kept 24h per API key id: the same method, path, declared query parameters and body replay the stored response with `Idempotent-Replay: true`, any other request answers 422, and a concurrent duplicate 409 with `Retry-After: 2`. Only operations declaring this parameter honour it. See https://developer.ninetables.io/guides/idempotency/.","name":"idempotency-key","in":"header"}],"responses":{"202":{"description":"Queued — the delivery as it now stands.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}},"Idempotent-Replay":{"description":"Present, always `true`, only when this is the stored response replayed for a repeated `Idempotency-Key`; the original response carries no such header.","schema":{"type":"string","const":"true"}}},"content":{"application/json":{"example":{"id":"0198a6c1-2f40-7d13-8a52-3b4c5d6e7f80","status":"pending","attempts":2,"next_attempt_at":"2026-08-20T08:15:42.118000Z"},"schema":{"$ref":"#/components/schemas/WebhookRedelivery"}}}},"400":{"description":"The `{id}` or `{deliveryId}` path segment is not a UUID (`invalid-ref`).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"malformed-id":{"summary":"POST /webhooks/not-a-uuid/deliveries/{deliveryId}/redeliver","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {id} path segment: Invalid UUID","code":"INVALID_REF"}},"malformed-delivery-id":{"summary":"POST /webhooks/{id}/deliveries/not-a-uuid/redeliver","value":{"type":"https://ninetables.io/problems/invalid-ref","title":"Invalid Reference","status":400,"detail":"'not-a-uuid' is not a valid {deliveryId} path segment: Invalid UUID","code":"INVALID_REF"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The key lacks `webhooks:manage`, refused before the rate-limit charge, or the stored subscription carries data whose read scope the key lacks (`insufficient-scope`, after the charge): each event family, `include_contact: true` and `include_customer: true` need the read scopes `ApiScope` lists for them. Nothing was read or queued. `app-not-installed` answers every key of a restaurant with the Customer Data app uninstalled, before the scope gate and the charge (see https://developer.ninetables.io/guides/errors/#403-a-scope-or-the-restaurants-app).","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"missing-scope":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that lacks `webhooks:manage`","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'webhooks:manage' scope","code":"INSUFFICIENT_SCOPE","required_scope":"webhooks:manage"}},"customer-events-without-customers-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage` but not `customers:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"customer-events-without-contacts-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for a `customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"segment-events-without-segments-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage` but not `segments:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'segments:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"segments:read"}},"segment-events-without-contacts-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage`, `segments:read` but not `contacts:read`, for a `segment.customer.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"booking-events-without-bookings-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage` but not `bookings:read`, for a `booking.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'bookings:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"bookings:read"}},"definition-events-without-definitions-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage` but not `definitions:read`, for a `definition.*` event in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'definitions:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"definitions:read"}},"include-contact-without-contacts-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage` but not `contacts:read`, for `include_contact: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"include-customer-without-customers-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage` but not `customers:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'customers:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"customers:read"}},"include-customer-without-contacts-read":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a key that holds `webhooks:manage`, `customers:read` but not `contacts:read`, for `include_customer: true` in the subscription it creates, leaves after a PATCH that could widen it, or whose deliveries it lists, reads or redelivers","value":{"type":"https://ninetables.io/problems/insufficient-scope","title":"Insufficient Scope","status":403,"detail":"This operation requires the 'contacts:read' scope","code":"INSUFFICIENT_SCOPE","required_scope":"contacts:read"}},"app-not-installed":{"summary":"Any request with a key of a restaurant that has Customer Data uninstalled","value":{"type":"https://ninetables.io/problems/app-not-installed","title":"App Not Installed","status":403,"detail":"Customer Data is not installed for this restaurant. Requests and webhooks resume when the restaurant reinstalls it.","code":"APP_NOT_INSTALLED"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"404":{"description":"No such webhook or delivery (`not-found`). A resource in ANOTHER tenant answers the identical 404 — the API never reveals that it exists.","headers":{"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"webhook-not-found":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with an id that is no subscription of this tenant","value":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such webhook","code":"NOT_FOUND","resource":"webhook"}},"delivery-not-found":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver with a `deliveryId` that is no delivery of that subscription","value":{"type":"https://ninetables.io/problems/not-found","title":"Not Found","status":404,"detail":"No such delivery","code":"NOT_FOUND","resource":"delivery"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"409":{"description":"Nothing was queued: the subscription is inactive, paused or disabled by the platform (`conflict-webhook-inactive`), so resume it, then redeliver; or the delivery is a customer or segment delivery that was sent before the guest was erased (`conflict-delivery-erased`), which is never sent again, so retrying is pointless. The `customer.deleted` event the erasure sends, and booking deliveries, are not refused. A concurrent request is still in flight for the same `Idempotency-Key` (`idempotency-key-in-flight`, carries `Retry-After: 2`) — retry shortly.","headers":{"Retry-After":{"description":"Present only on `idempotency-key-in-flight` (always `2`), not on a domain conflict.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key’s fixed-window budget (requests per minute).","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix seconds at which the current window resets.","schema":{"type":"integer"}},"X-NT-API-Version":{"description":"API major version — always `1` within v1, and the `api_version` member of every webhook delivery.","schema":{"type":"string","const":"1"}},"Link":{"description":"Where this API is documented, as RFC 8631 links on the docs site of the deployment you called: `<{docs}/openapi.json>; rel=\"service-desc\"; type=\"application/json\", <{docs}/>; rel=\"service-doc\"`.","schema":{"type":"string"}}},"content":{"application/problem+json":{"examples":{"webhook-inactive":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver on a subscription with `active: false`","value":{"type":"https://ninetables.io/problems/conflict-webhook-inactive","title":"Conflict","status":409,"detail":"This webhook is not active, so a redelivery would be held rather than sent. Resume the webhook, then redeliver.","code":"CONFLICT_WEBHOOK_INACTIVE"}},"delivery-erased":{"summary":"POST /webhooks/{id}/deliveries/{deliveryId}/redeliver for a customer delivery about an erased guest","value":{"type":"https://ninetables.io/problems/conflict-delivery-erased","title":"Conflict","status":409,"detail":"The guest this delivery is about has been erased, so it is kept only as a record that it was sent and will not be sent again.","code":"CONFLICT_DELIVERY_ERASED"}},"idempotency-key-in-flight":{"summary":"the same `Idempotency-Key` on two concurrent requests","value":{"type":"https://ninetables.io/problems/idempotency-key-in-flight","title":"Idempotency Key In Flight","status":409,"detail":"A request with this Idempotency-Key is still being processed; retry shortly","code":"IDEMPOTENCY_KEY_IN_FLIGHT"}}},"schema":{"$ref":"#/components/schemas/ProblemBody"}}}},"422":{"$ref":"#/components/responses/IdempotencyKeyConflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"webhooks":{"customer.created":{"post":{"operationId":"onCustomerCreated","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a guest is created, restored or unmerged","description":"Sent to every active subscription that asked for this event, once per real change to a guest record; customer events take no filter. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#customer-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-4b2e-7c10-8f3d-1e2f3a4b5c6d","type":"customer.created","api_version":"1","created_at":"2026-08-21T09:12:44.208000Z","data":{"customer":{"id":"01a021aa-e40c-7350-94d9-c5b7d7e1db0f","source_system":"pos_x","source_key":"cust-889","firstname":"Kari","lastname":"Nordmann","created_at":"2026-03-14T18:22:05.118204Z"}}},"schema":{"$ref":"#/components/schemas/WebhookCustomerDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"customer.updated":{"post":{"operationId":"onCustomerUpdated","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a guest’s name, contact, marketing consent or a filled-in attribute changes","description":"Sent to every active subscription that asked for this event, once per real change to a guest record; customer events take no filter. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#customer-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-5c3f-7d21-9a4e-2f3a4b5c6d7e","type":"customer.updated","api_version":"1","created_at":"2026-08-21T10:03:17.551000Z","data":{"customer":{"id":"01a021aa-e40c-7350-94d9-c5b7d7e1db0f","source_system":"pos_x","source_key":"cust-889","firstname":"Kari","lastname":"Nordmann","created_at":"2026-03-14T18:22:05.118204Z"},"changed":["email","attributes.allergies"]}},"schema":{"$ref":"#/components/schemas/WebhookCustomerDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"customer.merged":{"post":{"operationId":"onCustomerMerged","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered once per merge, for the surviving guest","description":"Sent to every active subscription that asked for this event, once per real change to a guest record; customer events take no filter. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#customer-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-6d40-7e32-8b5f-3a4b5c6d7e8f","type":"customer.merged","api_version":"1","created_at":"2026-08-21T11:45:02.090000Z","data":{"customer":{"id":"01a021aa-e40c-7350-94d9-c5b7d7e1db0f","source_system":"pos_x","source_key":"cust-889","firstname":"Kari","lastname":"Nordmann","created_at":"2026-03-14T18:22:05.118204Z"},"merged_customer_ids":["01a021aa-f1d2-7b3c-8d4e-5f6a7b8c9d0e"]}},"schema":{"$ref":"#/components/schemas/WebhookCustomerDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"customer.deleted":{"post":{"operationId":"onCustomerDeleted","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a guest is deleted or erased","description":"Sent to every active subscription that asked for this event, once per real change to a guest record; customer events take no filter. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#customer-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-7e51-7f43-9c60-4b5c6d7e8f90","type":"customer.deleted","api_version":"1","created_at":"2026-08-21T12:30:58.763000Z","data":{"customer":{"id":"01a021aa-e40c-7350-94d9-c5b7d7e1db0f","source_system":"pos_x","source_key":"cust-889"},"reason":"deleted"}},"schema":{"$ref":"#/components/schemas/WebhookCustomerDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"segment.customer.entered":{"post":{"operationId":"onSegmentCustomerEntered","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a customer enters a segment","description":"Sent to every active subscription covering the segment when the 5-minute membership sample sees a customer enter or leave it. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#segment-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021aa-e40b-7d46-9332-0bee5c13fa45","type":"segment.customer.entered","api_version":"1","created_at":"2026-08-21T00:00:00.000000Z","data":{"segment":{"id":"01a021aa-e40c-7350-94d9-c5b629a34d4b","name":"Regulars"},"customer":{"id":"01a021aa-e40c-7350-94d9-c5b7d7e1db0f","source_system":"pos_x","source_key":"cust-889","firstname":"Kari","lastname":"Nordmann","created_at":"2026-03-14T18:22:05.118204Z"}}},"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"segment.customer.exited":{"post":{"operationId":"onSegmentCustomerExited","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a customer leaves a segment","description":"Sent to every active subscription covering the segment when the 5-minute membership sample sees a customer enter or leave it. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#segment-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021aa-e40b-7d46-9332-0bee5c13fa45","type":"segment.customer.exited","api_version":"1","created_at":"2026-08-21T00:00:00.000000Z","data":{"segment":{"id":"01a021aa-e40c-7350-94d9-c5b629a34d4b","name":"Regulars"},"customer":{"id":"01a021aa-e40c-7350-94d9-c5b7d7e1db0f","source_system":"pos_x","source_key":"cust-889","firstname":"Kari","lastname":"Nordmann","created_at":"2026-03-14T18:22:05.118204Z"}}},"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"booking.created":{"post":{"operationId":"onBookingCreated","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a booking is created or restored from the trash","description":"Sent to every active subscription that asked for this event and covers the booking’s restaurant, from the booking write itself, with the full booking snapshot and, under `include_customer`, the guest. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#booking-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-3c1d-7e42-bb90-0c2f7ad4e611","type":"booking.created","api_version":"1","created_at":"2026-08-18T14:32:07.412000Z","data":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"tables":[{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"12","capacity_from":2,"capacity_to":4,"active":true,"booking_priority":10,"shape":"rectangle"}],"customer":{"id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","source_system":"pos_x","source_key":"cust-889","firstname":"Kari","lastname":"Nordmann","created_at":"2026-03-14T18:22:05.118204Z"}}},"schema":{"$ref":"#/components/schemas/WebhookBookingDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"booking.updated":{"post":{"operationId":"onBookingUpdated","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a watched member or a filled-in attribute of a booking changes","description":"Sent to every active subscription that asked for this event and covers the booking’s restaurant, from the booking write itself, with the full booking snapshot and, under `include_customer`, the guest. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#booking-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-9f07-7a55-8c31-5d6e7f8a9b0c","type":"booking.updated","api_version":"1","created_at":"2026-08-18T15:04:51.038000Z","data":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","start_time":"2026-08-18T19:00:00.000000Z","end_time":"2026-08-18T21:00:00.000000Z","status":"completed","guest_count":4,"restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab","customer_id":"0198a5b0-7c2e-7d31-b7c4-1f4dcaa1e001","customer_notes":"Window table if one is free","staff_notes":"Regular — give table 7 if free","allergens":["gluten"],"dietary_preferences":["vegetarian"],"requested_area_id":null,"requested_table_count":null,"table_ids":["0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88"]},"tables":[{"id":"0198a5b0-77aa-7b10-9c21-5d3e4f6a7b88","area_id":"0198a5b0-3c4d-7e10-9f21-6a7b8c9d0e11","name":"12","capacity_from":2,"capacity_to":4,"active":true,"booking_priority":10,"shape":"rectangle"}],"changed":["status","guest_count"]}},"schema":{"$ref":"#/components/schemas/WebhookBookingDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"booking.deleted":{"post":{"operationId":"onBookingDeleted","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a booking is moved to the trash or deleted","description":"Sent when a booking is moved to the trash or deleted outright, with the booking id, its restaurant and your own key rather than a snapshot. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/webhooks/#booking-events.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-a018-7b66-9d42-6e7f8a9b0c1d","type":"booking.deleted","api_version":"1","created_at":"2026-08-18T16:20:33.917000Z","data":{"booking":{"id":"0198a5b0-9f11-7c02-8e5d-2a7b3c9d4e55","source_system":"pos_x","source_key":"order-777","restaurant_id":"0198a5b0-1234-7abc-8def-0123456789ab"}}},"schema":{"$ref":"#/components/schemas/WebhookBookingDeletedDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}},"definition.computed":{"post":{"operationId":"onDefinitionComputed","tags":["webhooks"],"security":[{"ninetablesWebhookSignature":[]}],"summary":"Delivered when a computed attribute finishes computing, or fails","description":"Sent to every active subscription that asked for this event, once per computed attribute whose first computation or recompute finishes or fails, with how many guests hold a value. Delivery is at-least-once and unordered, so verify the signature and deduplicate on `webhook-id`. See https://developer.ninetables.io/guides/computed-attributes/#webhook.","parameters":[{"schema":{"type":"string","format":"uuid","description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","example":"01a021aa-e40b-7d46-9332-0bee5c13fa45"},"required":true,"description":"The delivery id, equal to the body’s `id` and signed: the key to dedupe on after verifying. A retry or a redelivery of the same event carries the same value.","name":"webhook-id","in":"header"},{"schema":{"type":"string","description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","example":"1787270400"},"required":true,"description":"Unix seconds when this attempt was sent, signed. Reject a skew over 300s.","name":"webhook-timestamp","in":"header"},{"schema":{"type":"string","description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","example":"v1,QDAJf0tgJ5Aq/FyoUjpJ2LPe9NJFTj8RYUbhOfPdkLk="},"required":true,"description":"`v1,<base64 HMAC-SHA256>` over `webhook-id + \".\" + webhook-timestamp + \".\" + rawBody`, keyed with the base64-decoded part of the secret after `whsec_` (Standard Webhooks, https://www.standardwebhooks.com). During the 24-hour rotation overlap it carries a second, space-separated entry signed with the previous secret, so accept the delivery when any entry matches.","name":"webhook-signature","in":"header"},{"schema":{"$ref":"#/components/schemas/WebhookEventType"},"required":true,"description":"What a subscription can ask to be told about, and the closed set a delivery announces itself as, in a subscription’s `events`, the body’s `type` and the `X-NineTables-Event` header alike. Customer and booking events are produced by the write itself, segment events by a 5-minute membership sampler and definition events by a computation finishing, and every one is delivered at-least-once and unordered. See https://developer.ninetables.io/guides/webhooks/#events for what raises each event.","name":"x-ninetables-event","in":"header"},{"schema":{"type":"string","enum":["true"],"description":"Present only on a delivery from `POST /webhooks/{id}/test`."},"required":false,"description":"Present only on a delivery from `POST /webhooks/{id}/test`.","name":"x-ninetables-test","in":"header"}],"requestBody":{"content":{"application/json":{"example":{"id":"01a021ab-b129-7c77-8e53-7f8a9b0c1d2e","type":"definition.computed","api_version":"1","created_at":"2026-08-20T11:44:52.418000Z","data":{"definition":{"entity":"customer","key":"total_visits","name":"Total visits","source":"system"},"state":"ready","guest_count":4812,"computed_at":"2026-08-20T11:44:52.301000Z"}},"schema":{"$ref":"#/components/schemas/WebhookDefinitionComputedDelivery"}}}},"responses":{"410":{"description":"The endpoint is gone for good: the attempt fails and the subscription is disabled at once with `disabled_reason: \"gone\"`."},"429":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"503":{"description":"Fails the attempt, retried on the schedule or after `Retry-After` when that asks for longer, up to 6 hours."},"2XX":{"description":"Acknowledged: any 2xx counts, and the body is ignored. Answer within 10 seconds and process the delivery afterwards."},"default":{"description":"Any other status, a redirect, a timeout or a transport failure fails the attempt, and a delivery is tried up to 10 times over about 14.5 hours. See https://developer.ninetables.io/guides/webhooks/#retries-and-redelivery for the schedule and for when a failing endpoint disables its subscription."}}}}},"servers":[{"url":"https://umqgbvlvbcwhqrnbfchs.supabase.co/functions/v1/customer-data-api","description":"Production"}]}