401 API_KEY_REQUIRED. A key that is unknown, revoked or expired gets 401 API_KEY_INVALID. The response is the same in all three cases, so it never reveals why a key was rejected or whether it ever existed.
Kinds of key
Use a service key for a system that serves the brokerage, such as reporting, a CRM sync or accounting. Use a member key for a personal tool that should see only what that person sees.
Scopes
A key holds one or more scopes, and each endpoint requires one:tasks:read and events:read need deals:read because task descriptions and events can name clients. Granting deals:read is how a brokerage agrees to share client details with the key.
A valid key without the scope an endpoint needs gets 403 INSUFFICIENT_SCOPE.
Keeping keys safe
- A key is shown once, when it is created. Store it in a secrets manager.
- Give each system its own key, so you can revoke one without breaking the others.
- Grant only the scopes a system needs.
- Revoke a key from Get API Keys as soon as it is no longer used or may have leaked. Revocation takes effect on the next request.