Troubleshooting¶
Find the HTTP status or symptom below. Errors and limits lists every error code.
400 Bad Request¶
validation_error:messagenames the field.bloganduser_ipare required, anduser_ipmust be the visitor's IPv4 or IPv6 address, not a hostname.invalid_json: the body isn't valid JSON. Send it withContent-Type: application/jsonand check the quoting in shell commands.
401 Unauthorized¶
missing_api_key: send the key in theX-API-Keyheader.invalid_api_key: the key is mistyped, revoked or not a SpamAPI key. Keys start withspa_; Stripe keys don't work. Check the API keys page and create a new key if needed; the full key is shown only when it is created.- If you also send
api_keyin the JSON body, it must be the same key as the header.
403 Forbidden¶
account_unavailable: the account can't use the API. Contact support.
429 Too Many Requests¶
rate_limit_exceeded: too many requests in a minute. Wait for the seconds inRetry-After, then slow down. See the rate limits.usage_limit_exceeded: this month's checks are used up. They reset at the start of the next UTC month;GET /api/v1/usagereturns the time inresets_at. To continue now, upgrade on the dashboard's Billing page.
5xx Errors¶
- Retry with a growing delay, not in a tight loop. A retried check is a new check.
- Note the
X-Request-IDresponse header for support.
503 Service Unavailable¶
detection_unavailablemeans SpamAPI could not complete the spam check. The response contains no spam decision and does not use a check.- Keep the submission pending for a later retry or manual review. Do not treat this error as a successful check or as a decision to allow the submission.
quota_unavailablemeans SpamAPI couldn't read or record usage. Retry later.
Every result looks the same¶
- Requests with
is_test: trueanduser_role: "administrator"always return ham, and the test values always return spam, without classification. Remove them from real traffic. - Send the submission's text in
comment_contentand the author details you have. A request with onlybloganduser_ipgives SpamAPI little to go on.
WordPress plugin¶
- Connection failed: Invalid Key: paste the key again, click Save Settings, then Test Connection. The test uses the saved key.
- Connection failed with another message: the site couldn't reach SpamAPI, or SpamAPI answered with an error such as too many requests. Wait a minute and try again. Leave API URL at its default unless you run your own SpamAPI server, and check that the server allows outgoing HTTPS requests.
- Nothing is checked: Enable spam protection must be checked and saved. Comments from users who can moderate comments, pingbacks, trackbacks and unsupported form plugins aren't checked; see the supported comments and forms.
- Spam got through: if SpamAPI can't answer, the plugin lets the comment or submission through and writes the error to the PHP error log. This also happens when the month's checks are used up; the plugin's settings page shows the usage. Choose a higher Strictness Level to block more.
- A legitimate message was blocked: approve the comment from the spam list, or find the entry among the form's spam entries. Choose a lower Strictness Level to block less.
Contact support¶
Write to support@spamapi.de with the time of the request, the endpoint, the
HTTP status, the error code and the X-Request-ID response header. Never send
your API key.