Appearance
API keys and scopes
There are two ways to call the API: a sub-account API key, for your own scripts, your website or an automation platform, and an app that a sub-account admin connects with OAuth. Both carry scopes, and both act in exactly one sub-account.
You'll need
- To be an owner or admin of the agency, or an admin of the sub-account.
- The sub-account chosen in Working in on the agency screens. Keys belong to a sub-account.
Create an API key
- On the agency screens, choose the sub-account in Working in.
- Open the user menu and select Security.
- Scroll to API keys for your sub-account. Under Create a key, enter a Key name that says what will use it, for example "Zapier".
- Under Permissions, tick only the scopes the tool needs (see the table below).
- Choose when it Expires: In 30 days, In 90 days, In a year or Never.
- Select Create key.
- Copy the key now. It is shown once and never again. Select Done.
Screenshot: The Security page's API keys section, with the Create a key form (Key name, a grid of Permissions checkboxes, the Expires menu and the Create key button) above a list of existing keys, each showing its status, key prefix, permissions, last used time, and Revoke and History buttons
Keys look like sk_live_ followed by 64 hexadecimal characters (sk_test_ outside production). Only a hash is stored, so a lost key cannot be recovered: create a new one.
Send the key
Send the key in the X-API-Key header:
bash
curl https://api.example.com/api/v1/rest/contacts \
-H "X-API-Key: sk_live_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"Authorization: ApiKey sk_live_... also works. On the REST API, Authorization: Bearer is for app access tokens, not keys. The MCP endpoint is the one place that also accepts Authorization: Bearer sk_live_....
Scopes
Each route needs exactly one scope. Give each tool its own key with only the scopes it needs.
| Scope | Shown in Security as | What it allows |
|---|---|---|
profile:read | Read the business profile | Read the sub-account's business name, address and website |
contacts:read | Read contacts | See contacts, their tags and custom fields |
contacts:write | Create and edit contacts | Create, update and delete contacts and their tags |
messages:send | Send messages | Text and email contacts (consent, quiet hours and opt-outs still apply) |
bookings:read | Read bookings | See calendars and booked appointments |
bookings:write | Create and change bookings | Book free slots, reschedule and cancel appointments, and mark them completed or no-show |
conversations:read | Read conversations | Read conversations and their messages |
opportunities:read | Read opportunities | See pipelines and opportunities |
opportunities:write | Create and move opportunities | Create opportunities and move them between stages |
invoices:read | Read invoices | See invoices and what was paid |
forms:read | Read form submissions | See forms and their submissions |
campaigns:read | Read campaigns | See email and text campaigns |
social:read | Read social posts | See social posts and where they were published |
objects:read | Read custom objects | See custom objects, their records and links |
objects:write | Manage custom objects | Create, update, link and delete custom object records |
webhooks:write | Subscribe to events (webhooks) | Subscribe to events (new contacts, messages, bookings, payments) by webhook |
workflows:write | Draft workflows with an AI assistant (MCP, beta) | Draft, check and test automation workflows through the MCP endpoint; publishing stays with your team |
courses:read | Read courses and enrolments | See courses, membership tiers, who is enrolled and each member's progress |
courses:write | Enrol contacts in courses and memberships | Give contacts access to courses and membership tiers, and take it away |
products:read | Read products and offers | See products, their prices and checkout offers |
tasks:read | Read tasks | See contacts' tasks |
tasks:write | Add and complete tasks | Add tasks to contacts and mark them done |
workflows:enroll | Add contacts to workflows | See published workflows and add contacts to them or take them out |
conversations:write | Suggest replies (internal notes) | Add internal notes and suggested replies to conversations for your team to send (nothing is sent) |
customValues:read | Read custom values | See the sub-account's custom values and the agency values it inherits |
customValues:write | Manage custom values | Add and change the sub-account's custom values |
fields:read | Read custom field definitions | See the custom contact fields: their keys, labels and types |
users:read | Read team members | See who works in the sub-account (names and emails), to assign records |
calendars:write | Manage calendars | Create calendars and change their length, notice, buffers, location, hosts and whether they take bookings |
invoices:write | Create and send invoices | Create draft invoices for contacts and email them with their pay link |
subscriptions:read | Read subscriptions | See subscriptions, their status and what they cost |
subscriptions:write | Cancel subscriptions | Cancel subscriptions now or at the end of the paid period |
The API reference lists the scope each route needs. A request without it answers 403 with WWW-Authenticate: Bearer error="insufficient_scope".
Expiry and revoking
- A key stops working at its expiry date and shows as expired in the list. Requests with it answer
401. - To stop a key at once, select Revoke next to it. Revoking cannot be undone; create a new key if you need one again.
- The list shows each key's prefix, scopes and when it was last used. History shows when it was created and revoked.
Apps with OAuth
If you are building an app that other sub-accounts install, use OAuth 2 instead of keys. Agency owners and admins register apps in Developer portal, in the agency section of the sidebar.
- Under Register an app, enter the App name and the Redirect URIs (one per line, matched exactly; https, or http only for localhost).
- Choose the Client type: Confidential (a server: client secret plus PKCE) or Public (browser or mobile: PKCE only).
- Tick the Scopes the app may request and select Register app. Copy the client secret now; it is not shown again.
The flow is the authorization code grant with PKCE (S256 only):
- Send the user to the app's consent page,
https://app.example.com/oauth/consenton your agency's app address, withclient_id,redirect_uri,scope(space-separated),state,code_challengeandcode_challenge_method=S256. - The user picks a sub-account. A sub-account admin selects Allow or Deny.
- On Allow, the browser returns to your redirect URI with
codeandstate. The code works once, for 5 minutes. - Exchange it at
POST https://api.example.com/api/v1/oauth/tokenwithgrant_type=authorization_code,code,redirect_uri,code_verifierandclient_id. Confidential clients also send their secret, with HTTP Basic auth or asclient_secret.
The answer holds an access_token (oat_..., valid for 1 hour), a refresh_token (ort_..., valid for 30 days), the granted scope and the subaccount_id. Call the API with Authorization: Bearer oat_....
- Refresh with
grant_type=refresh_token. Each refresh returns a new refresh token; reusing an old one revokes every token from that authorization. POST /api/v1/oauth/revokerevokes a token, andPOST /api/v1/oauth/introspectdescribes one.- A token works only in the sub-account that consented. Uninstalling the app ends its tokens.
- Until the app is approved in review (Submit for review on the app's page), it can only be installed in your own agency's sub-accounts.
Agency installs
An app can also ask to be installed once for a whole agency. Add install_target=agency to the consent page address (with the same parameters). An agency owner or admin then sees the agency, the scopes and chooses every sub-account or some of them, and whether sub-accounts created later are added.
- On Allow for the agency, the browser returns with an agency
code(oagc_...). Exchange it atPOST /api/v1/oauth/tokenexactly as above. - The answer holds an agency
access_token(oaga_..., 1 hour), arefresh_token(oagr_..., 30 days, rotated on each refresh with the same reuse rule), thescope, theagency_idanduser_type: "agency". - The agency token reads no data itself.
GET /api/v1/oauth/agency-installationwithAuthorization: Bearer oaga_...lists the sub-accounts the install covers. POST /api/v1/oauth/subaccount-tokenwith the same bearer andsubaccount_id(form or JSON; optionally a narrowerscope) answers an ordinary sub-account token pair (oat_.../ort_...) for that one sub-account. Refresh those as usual.
A sub-account token works only in its own sub-account. subaccount-token refuses (invalid_grant) a sub-account of another agency, one the install does not cover, one that removed the app, and every request once the agency uninstalls the app (which revokes all its tokens) or once the person who installed it is no longer an owner or admin of the agency. AI assistants that registered themselves cannot be installed for an agency.
Offer agency installs. In the developer portal, open the app and under Agency installs tick Offer the app for whole agencies and enter your Agency install start page: a page of yours that starts the flow above (it creates the PKCE verifier and redirects to the consent page with install_target=agency). Agencies then see Install for agency next to the app in Marketplace settings; it opens your start page with install_target=agency and agency_id added, so you can pass the agency on (the consent page preselects it). The consent page refuses an agency install of an app that has not opted in (unauthorized_client), except in your own agency, where you can test it first. Installs already made keep working if you stop offering it.
Deleting the app revokes its agency tokens and pending agency codes, ends every agency's install of it (each agency's audit log shows it as uninstalled because the app was deleted), and uninstalls it from every sub-account with all their tokens.
Good to know
- A staff member's signed-in session also works on the API routes, with that person's role instead of scopes. For an integration, use a key or an app so access is limited and can be revoked.