invalid_api_key
The key is wrong, revoked, expired, or used from an address it is not allowed from
HTTP 401invalid_api_key
A credential was presented and Woyra does not accept it.
Why it happens
- The key was revoked in the console, or it expired.
- A test key was copied into production, or the other way round.
- The key has an IP allowlist and the request came from somewhere else.
- Whitespace or a newline was copied along with the key.
How to fix it
- Check the key prefix:
wk_live_spends money and sends real messages,wk_test_sends nothing and costs nothing. - Look at the key in the console. A revoked key is listed as revoked and cannot be restored; mint a new one.
- If the key has an allowlist, add the address your application actually calls from. Serverless platforms change address freely.
Is it worth retrying?
Only after you change something. Retrying as-is will fail again.
What the response looks like
HTTP/1.1 401
Content-Type: application/json
Woyra-Request-Id: req_01J...
{
"error": {
"code": "invalid_api_key",
"message": "…",
"doc_url": "https://docs.woyra.io/errors/invalid_api_key",
"param": null,
"request_id": "req_01J..."
}
}