Help centerIntegrations

For: Admins

Authenticate API requests with a key

Send your key as a bearer token to the Admin Panel's API for a manage key or the portal's API for a hub key, and limit it to your IP addresses.

In this article4 sections

This page covers where to send each kind of API keyKey A secret token, created under Integration, that lets your own software use the hub's API., how to send it, and why a key is refused.

Addresses

KeyBase addressExample
Manage keyhttps://prd-api-manage.caseactive.com/v1/<hub id>/https://prd-api-manage.caseactive.com/v1/ca-7e6d5c4b3a2f10/cases
Manage key, importshttps://prd-api-manage.caseactive.com/v1/integration/<hub id>/https://prd-api-manage.caseactive.com/v1/integration/ca-7e6d5c4b3a2f10/imports
Hub keyhttps://prd-api-app.caseactive.com/v1/<hub id>/https://prd-api-app.caseactive.com/v1/ca-7e6d5c4b3a2f10/cases
Hub key, one casehttps://prd-api-app.caseactive.com/v1/<hub id>/<case id>/https://prd-api-app.caseactive.com/v1/ca-7e6d5c4b3a2f10/cc-1a2b3c4d5e6f70/posts

Your hub ID is ca- and 14 characters. It shows as Hub Id on the Info page of any case in your portal, with a copy button. A case ID is cc- and 14 characters, shown there as Case Id.

Sending the key

Send the key in the Authorization header of every call, after Bearer and a space:

curl https://prd-api-manage.caseactive.com/v1/ca-7e6d5c4b3a2f10/roles \
  -H "Authorization: Bearer YOUR_API_KEY"
  • Send JSON bodies with Content-Type: application/json.
  • A key doesn't expire. It works until an Admin switches it off or deletes it in Integration › Keys.
  • Every call signs in afresh: there's no session or token to exchange.
  • Dates and times come back in UTC.

Limiting where it's used

Under Source CIDR, a key can be limited to your system's public IPv4 address, such as 203.0.113.10, or a range, such as 203.0.113.0/24. The API takes IPv4 connections only, so an IPv6 address or range is refused when you save it. A call from anywhere else is refused with 401 LoginSourceIpException. To change the range, see Restrict or revoke an API key.

When a key is refused

Every refusal comes back as an error body whose message names it; see Handle API errors and status codes.

StatusmessageWhyWhat to do
401UnauthorizedNo key was sent, or what was sent isn't a keyCheck the Authorization header
401HostNotFoundExceptionThe hub ID in the address doesn't existCopy Hub Id again
401HostPurgingExceptionThe hub is being deletedAsk an Admin of your hub
401SessionNotFoundExceptionThe key was deleted, or belongs to another hubUse a current key for this hub
401LoginKeyInactiveExceptionThe key is switched offAsk an Admin to switch it on
401LoginKeyWrongApiExceptionA manage key was sent to the hub key's address, or the other way roundUse the address for the key's type
401LoginSourceIpExceptionThe call came from outside the key's rangeCall from an allowed address, or widen the range
401LoginSourceCidrExceptionThe key's saved range can't be readCorrect Source CIDR
403BotNotAllowedExceptionA manage key called something it can't useSee Understand what the API can do
403ManageBillingInactiveExceptionYour hub's Admin Panel is locked after a failed payment (manage key only)Ask an Admin to update the payment method
403BillingReadOnlyExceptionYour hub's subscription has lapsed and its portal is read-only, so a hub key can read but not change anythingAsk an Admin to restart the subscription
403CaseClosedExceptionA hub key tried to change a closed caseReopen the case first
404CaseNotFoundExceptionA hub key named a case that doesn't exist, or isn't in your hubCheck the case ID
503LoginSessionExceptionThe hub was too busy to check the keyTry again shortly

A 401 always means the key itself was refused, so a sync can stop and alert someone. Other errors are about the call.

Related articles

Handle API errors and status codesRead the error body, what 400, 401, 403, 404, 500 and 503 mean, and why an item your key can't see answers 404.Integrations