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
| Header | Value | Required |
|---|---|---|
| X-API-Key | string | Yes |
| Content-Type | application/json | Yes |
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": {"message_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"
}