Authentication

All requests to MassAccess API are authenticated via an API key in the X-API-Key header.

Getting an API Key

An API key is generated in your dashboard under Settings → API.

WarningKeep your API key secure. Do not share it with third parties or publish it in public repositories.

Using the API Key

The key is passed in the X-API-Key header of each request:

Request Headers

HeaderValueRequired
X-API-KeystringYes
Content-Typeapplication/jsonYes

Examples

bash
curl -X POST /api/v1/send \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "phone_number": "12345678901",
  "text": "Test"
}'

# 202 Accepted
{
  "status": "accepted",
  "data": {
    "event_id": "...",
    "status": "new"
  }
}

Authentication Errors

If the key is invalid or missing, the API returns HTTP 401:

json
# 401 Unauthorized
{
  "detail": "Invalid or missing API key"
}