Getting a key
The restaurant you integrate with issues your key. Its Owner mints it in the Nine Tables app under Customer Data → API, which appears once the Customer Data app is installed on the tenant. No one else can mint one, and this API cannot either; Authentication explains why.
What the Owner is asked for
Section titled “What the Owner is asked for”Creating a key asks the Owner for the following, so send them your answers before they start:
- Name — how the key is listed in the app, such as “POS integration”.
- Key holder — your company, a contact person, and that person’s email and phone. All four are required: they record who answers for the key.
- What the key is for — its purpose, in a sentence.
- Rate limit — requests per minute. Left blank, it is
120. Each item of
POST /batchand each member of a loyalty transfer counts as one, so ask for more if you will move many members (see Loyalty club members). - Scopes — at least one. The
ApiScopecomponent lists what each scope allows. - Restaurants — every restaurant on the tenant, including ones added
later, or only the ones the Owner picks. A key that transfers loyalty members
(
loyalty:import) needs every restaurant. See Keys limited to restaurants.
The full key is shown once, when the Owner creates it, so agree beforehand on how they will pass it to you.
What is fixed once the key exists
Section titled “What is fixed once the key exists”A key keeps the scopes, restaurants and rate limit it was minted with: the app
creates, lists and revokes keys, and changes none. A different setting means a
new key, with the same changeover as a rotation. The one exception so far is
the 1.1.0 change, which granted customers:write to every key that held
bookings:write (see the changelog).
Keys do not expire, and there is no rotate operation. A key works until an
Owner revokes it. To rotate, the Owner mints a second key, you deploy it and
verify it with GET /me, and the Owner then revokes the first; the steps are in
Key lifecycle.
Start narrow
Section titled “Start narrow”Ask for the scopes your first build needs, on a key limited to one
restaurant. A key that can do less exposes less while you are still learning
the API, and widening it later is a second key, which a rotation needs anyway.
GET /me reports the scopes, restaurants and rate limit your key actually has.
Production and staging
Section titled “Production and staging”The key’s prefix names the deployment it works against, and each deployment has its own base URL:
nt_live_— production:https://yovrgsvvkuirzofqbwfn.supabase.co/functions/v1/customer-data-apint_test_— staging:https://xvlolcjxgvardnirjmrz.supabase.co/functions/v1/customer-data-api, and local deployments.
There is no self-serve sandbox or test tenant, so expect your first key to be
an nt_live_ key on the restaurant’s production data, and keep it narrow. The
rest of the key format is under
Key format.
Every request carries the key in the Authorization header:
GET https://yovrgsvvkuirzofqbwfn.supabase.co/functions/v1/customer-data-api/meAuthorization: Bearer nt_live_…Who to contact
Section titled “Who to contact”The restaurant’s Owner answers for the key: its scopes, its restaurants, its rate limit and its revocation. If you have no restaurant to integrate with yet, write to Nine Tables at support@ninetables.io.