Skip to content

API Key Authentication

Every request to the omnichannel API must include your API key. Keys are issued per account from System → Developer → API Key (also Profile → API Key). Send the key on the apikey HTTP header (or apiKey / body apikey). Portal walkthrough: Account → API keys.

What an API key is

The key identifies your account, not a logged-in portal user. Portal screens use a login session. HTTP send uses this key.

UseAuth
Portal compose, inbox, fallback, CDPSign in
POST /v1/sms, /v1/whatsapp, /v1/rcs, /v1/verifyapikey header
Public CDP form / inbound webhookForm or webhook slug — not this key

One account can have several keys (for example staging vs production). Inactive users or keys are rejected.

Create a key

  1. Open System → Developer → API Key, or Profile → API Key. See Account.
  2. Generate API Key and give it a title you will recognise later.
  3. Copy the key once. Store it in your server environment (AZMARQ_API_KEY if you use the SDK).
  4. Optional: set an IP allowlist and priority (below).

You need wallet credits and an approved sender / template / bot before the first send. The key alone is not enough. Quickstart walks the first SMS.

How to send it

Prefer the header. Body apikey is accepted on many send endpoints so older clients still work.

PlaceName
Header (preferred)apikey or apiKey
JSON body or queryapikey

Do not send Authorization: Bearer … as a substitute. Some MCP hosts only emit Bearer; Omni still expects apikey (or x-api-key on the public MCP HTTP bind).

Headers

  • Name
    apikey
    Type
    string
    Description

    Your dashboard API key. Required on every request.

  • Name
    Content-Type
    Type
    string
    Description

    Use application/json for JSON bodies. Use multipart/form-data only when an endpoint uploads a file, such as WhatsApp header media.

Base URL

The HTTP API host is https://api.azmarq.com. Each endpoint page prints the full URL, such as https://api.azmarq.com/v1/sms. In examples, $API_BASE_URL is https://api.azmarq.com — copy the path from the endpoint bar on the same page. Do not invent a hostname.

IP allowlist and priority

SettingWhat it does
IP allowlistOnly those server IPs can call the APIs with this key. Empty means any IP (still keep the key secret).
PriorityQueue priority for sends on a busy account

If you set an allowlist and then call from a laptop or CI IP that is not listed, the send fails even with a valid key. Add the egress IP of the environment that actually posts.

Rotate and disable

  • Rotate when a key may have leaked, a teammate left, or you split staging from production.
  • Disable / delete keys you no longer use.
  • After rotate, update the server env and any Postman apiKey variable.

Disabling a key does not log you out of the portal.

Example

Authenticated request

curl -X POST "https://api.azmarq.com/v1/sms" \
  -H "Content-Type: application/json" \
  -H "apikey: YOUR_API_KEY" \
  -d '{
    "sender": "senderName",
    "to": "91XXXXXXXXXX",
    "text": "Hello World!",
    "type": "TRANSACTIONAL"
  }'

A missing or unknown key returns:

Error response

{
  "error": true,
  "message": "Api Key not found"
}

The Omni SDK (azmarqomni) and Omni MCP (azmarqomni-mcp) use this same key. The SDK reads AZMARQ_API_KEY and sends apikey. MCP stdio does the same. A public MCP HTTP bind ignores the process env key and requires apikey (or x-api-key) on each request.

Typical mistakes

SituationWhat to do
Api Key not foundHeader name is apikey, no extra quotes, key still active
Works in Postman, fails in productionIP allowlist missing the server egress IP
Portal works, HTTP failsPortal login is not the API key — create a developer key
Key in a website widgetWidgets do not use apikey. See Get Widgets
401-style Bearer setupUse the apikey header

See Errors for how to read unsuccessful responses, then Quickstart to send your first message.

Was this page helpful?