Skip to content
Sandadocs

API keys

Make, scope and revoke the keys another system uses to reach your CRM's API. A key acts as the person who made it, and only as far as their role allows.

An API key is a secret string that lets another system call the CRM API as you. It always begins with bck_. You paste it into the other system once, and it sends the key with every call.

A key is a person's, as a personal access token is. Every call made with it acts as the person who made it, asks again what their role in the CRM lets them do now, and is written in the record's history as theirs, through the key, such as Jo Tran through API key “Xero sync”. A key never does more than its person could do on the CRM's own pages, and its scope can narrow that further.

Make a key

Anybody who can open the CRM can make keys of their own.

  1. Open Settings · API keys. In the CRM, go to Settings and choose API keys, under Your connections.
  2. Press Make a key.
  3. Name it. Under Name, say what will hold it, such as "Xero sync" or "Website form". A name is up to 80 characters, and it is how a record's history names the key.
  4. Choose what it may do. Under What it may do, choose Read only, Read and change or Read, change and set up. Only the ones your role has are offered. See scopes.
  5. Choose when it expires. Under Expires, choose Never: until it is revoked, 30 days, 90 days or A year.
  6. Press Make the key, and copy it. The key is shown once. The CRM keeps only a fingerprint of it and cannot show it again: if you lose it, make another and revoke the old one.

One person keeps up to 10 keys in one CRM at a time. Revoke one you no longer use to make another.

Scopes

A key's scope is the most it may do. Each includes the one before it.

Scope On Settings · API keys What a key with it may do
crm:read Read only Read companies, people, deals, agreements, the timeline and the change feed.
crm:write Read and change Also add and change them, a deal’s lines and invoices, and log on the timeline.
crm:manage Read, change and set up Also archive and restore records, and manage webhooks.

Every endpoint names the scope it needs in the reference. A call the key's scope does not cover answers 403 with the code insufficient_scope and the scope it needed.

The person's role is asked on every call as well. A key made with Read and change by somebody whose role later becomes read-only reads and no longer changes anything. Webhooks are part of setting up the CRM, so they need an owner or admin as well as crm:manage.

Send the key

Send it as a bearer token, which is what most clients do:

HTTP
GET /api/crm/v1/me HTTP/1.1
Host: crm.sanda-os.com.au
Authorization: Bearer bck_...

Some tools send an email address and an API token as Basic authentication. That works too: send the key as either half, and the other half is ignored.

Shell
curl https://crm.sanda-os.com.au/api/crm/v1/me -u "you@example.com:bck_..."

A call with no key, or with one the CRM does not know, has revoked or has seen expire, answers 401.

Who sees and revokes keys

  • Everybody sees their own keys on Settings · API keys, with when each was made, when it expires and when it was last used, and revokes any of them with Revoke.
  • An owner or admin also sees everybody else's keys, under Everybody else’s keys, and may revoke any of them. A key that outlives its purpose is the CRM's risk, not only its maker's.

Revoking a key stops it at once. A key also stops working, without anybody revoking it, when it expires or when its person leaves the workspace.

Keep keys safe

  • One key for each system, named for it, so you can revoke one without stopping the others, and a record's history says which system made each change.
  • The narrowest scope that works. A report that reads deals needs Read only.
  • An expiry for a key you make to try something.
  • Never in a browser page, a repository or a support email. A key is a password to your CRM. Keep it in the other system's secret store.

Something unclear or out of date? Tell us, and we will fix the page.