Docs pages
Authentication
Every request carries the API key of one of your sites. Find it on the site page in your dashboard.
Send your key
Send the key in the Authorization header with Bearer, or in the X-Api-Key header. Send it from your server only: the key is a secret.
Authorization: Bearer YOUR_API_KEY
# or
X-Api-Key: YOUR_API_KEY
The key decides the site. Its messages count towards your plan and show up in that site's logs. A missing, wrong or replaced key gets 401 invalid_api_key.
Verify a key
Check that a key works and see the plan and usage behind it. Verifying a key never counts as a message.
GEThttps://api.anti-spam.store/v1/verify
curl https://api.anti-spam.store/v1/verify -H "Authorization: Bearer YOUR_API_KEY"
{
"valid": true,
"site": { "id": 12, "name": "Acme Shop" },
"plan": { "code": "pro", "name": "Pro" },
"usage": { "used": 1284, "limit": 10000, "period": "monthly" },
"quota_exhausted": false
}
| Field | Type | Description |
|---|---|---|
valid | boolean | Always true. A key that is not valid gets 401 invalid_api_key. |
site | object | The id and name of the site the key belongs to. |
plan | object | The code and name of your plan. |
usage | object | Messages checked this period, the plan limit (null when there is none) and the period: "monthly" or "lifetime". |
quota_exhausted | boolean | True when your plan limit is reached. The key stays valid. |
Replace a key
Each site has one key. You can use it on more than one website, and all their messages count towards the same plan.
If a key leaks, make a new one on the site page. The old key stops working at once, so update every website that uses it.