Keys and rotation
How API keys are issued, scoped, rotated and revoked.
Pilot wineries only. During the pilot, keys can be created only for wineries on the pilot list. A winery owner creates, rotates and revokes them in the Garde admin under API keys; other wineries don’t see that page yet.
Format and storage
- A key looks like
gk_live_<16 hex id>_<64 hex secret>: 89 characters in every environment. - Everything before the last underscore (
gk_live_<id>) is the key’s public prefix. It identifies the key in lists and history and is safe to log. - Garde stores only a SHA-256 digest of the whole key. The key is shown once, when it is created, and can’t be recovered. If you lose it, revoke it and create another.
- Send it only as
Authorization: Bearer <key>. Never put it in a URL, a browser app or a shared chat: browser (CORS) access is denied, and a leaked key works until it is revoked.
Ownership and history
- Keys belong to the winery, not the person who created them.
- Winery owners manage keys in the Garde admin. Garde support can also create and revoke them. Every creation and revocation is recorded, and owners see that history on the same page, including who did it.
- A key never reaches another winery’s data, and admin sessions don’t work on the API.
Scopes
Each key carries one or more scopes. A request without the scope gets a 403.
| Scope | Grants | Endpoints |
|---|---|---|
winery:read | The winery the key belongs to: name, platform and status. | /winery |
sessions:read | Cancel and skip sessions and their events, with pseudonymous member IDs. | /sessions/sessions/{id}/sessions/{id}/events |
analytics:read | Cancel-flow analytics matching the dashboard: the summary, results per cancel reason, and saves per offer position. | /analytics/summary/analytics/reasons/analytics/offers |
flows:read | Current cancel and skip configuration, reason labels, offer positions, and the text members see after accepting an offer. | /flows/flows/{type}/reasons/flows/{type}/offers |
Rotation
A winery can hold at most 5 unrevoked keys, and a key kept during a rotation counts. To rotate:
- Create the new key. If the winery already has 5, revoke one first.
- Deploy the new key everywhere the old one is used.
- Revoke the old key.
Paging continues across a rotation: a cursor is tied to the winery and the filter, not to the key that fetched it.
Revocation and expiry
- Revocation is permanent and applies to the next request. Garde doesn’t cache key checks.
- A revoked key stays revoked if the winery uninstalls and reinstalls Garde.
- Keys of an inactive winery are refused with a 401. Uninstalling Garde from Commerce7 revokes the winery’s keys automatically; other uninstalls don’t yet, so revoke your keys under API keys (or ask Garde support) before you uninstall.
- Pilot keys don’t expire.
Lost a key or think one leaked? Contact support from the Help Center.