Skip to main content
Every request to the BlueReacher API is authenticated with an API key sent in an Authorization header. There are no OAuth flows, no request signing, and no session cookies. One header, one key.

API key format

A BlueReacher key is a single string that starts with bluereacher_:
Treat the key as opaque. The characters after the prefix are random and carry no meaning you should parse. Store the whole string, prefix included, and pass it through unchanged. Two rules for storage:
  • Store it as a variable-length string. Key length can change over time, so do not cap the column or config field at a fixed size.
  • Match on the bluereacher_ prefix if you need to detect keys in logs or scrub them from output.

Where keys come from

Keys are generated per customer in the BlueReacher dashboard under Settings, API Keys. Create one, give it a name that says where it runs (production-crm, staging-worker), and copy it immediately. The full key is shown once at creation. After that the dashboard displays only the prefix and last four characters so you can identify a key without seeing it. You can hold several active keys at once. Use one key per service or environment. When something goes wrong you can then revoke a single key instead of taking every integration offline. A key is scoped to your account. It can send only from lines assigned to you, and it can read only your own messages and contacts.

Sending the key

Send the key as a bearer token on every request. The base URL is https://api.bluereacher.com/functions/v1/.

Verify a key

The fastest way to confirm a key works is to list your lines:
A working key returns your lines:

Authenticated request in JavaScript

Authenticated request in Python

Both examples read the key from an environment variable. Do that in your own code too.

Keeping keys safe

An API key can send messages from your lines and read your message history. Anyone holding it can do the same. Handle it like a database password.
  • Server side only. Call the API from your backend, a serverless function, or a workflow tool. Never put a key in browser JavaScript, a mobile app bundle, a Chrome extension, or an HTML page. Anything shipped to a device can be read off that device.
  • Never commit keys to source control. Use environment variables or a secret manager (AWS Secrets Manager, Doppler, 1Password, your platform’s built-in store). Add .env to .gitignore before the first commit, not after.
  • Keep keys out of logs and tickets. Scrub any string starting with bluereacher_ from request logs and error reports. Do not paste a key into a support ticket, a screenshot, or a shared channel. If you need help debugging, send the key prefix and last four characters.
  • Separate keys per environment. Production, staging, and each third-party tool get their own key. Revoking one then costs you one deploy, not five.
  • Rotate on any suspicion of exposure. A key in a public repo, a shared screen, a departed contractor’s laptop, or a vendor breach all count. You do not need proof of misuse to rotate. Assume exposure means compromise.

Rotating a key

Rotation takes four steps and no downtime:
  1. Create a new key in the dashboard with the same name plus a version suffix.
  2. Deploy the new key to your service and restart it.
  3. Watch traffic on the new key in the dashboard until you see requests landing.
  4. Revoke the old key.
Revocation takes effect on the next request. Any request that arrives with a revoked key gets a 401.

401 versus 403

Both mean the request was rejected. They fail for different reasons and need different fixes. Short version: 401 is about the key, 403 is about permissions. Error responses share one shape:
Common code values on 401 are missing_authorization_header, malformed_authorization_header, invalid_api_key, and revoked_api_key. On 403 you will see line_not_authorized, channel_not_enabled, and account_suspended. Neither status is retryable. Retrying a 401 or 403 with the same key produces the same result, so treat both as fatal in your queue: stop the job, alert someone, and fix the key or the permission. Reserve retries for 429 and 5xx.

Debugging checklist

If a request is failing auth, walk this list in order:
  1. Is the header spelled Authorization with the word Bearer and a single space before the key?
  2. Did your shell or config file add quotes, a trailing newline, or a line break inside the key?
  3. Does the key in your environment match a key listed as active in the dashboard?
  4. Did the environment variable actually load? Print its length, never its value.
  5. Is the request hitting https://api.bluereacher.com/functions/v1/, on HTTPS, with no redirect stripping the header?
If all five check out and you still get a 401, create a fresh key and test it with the curl command above.