api_key_in_use
The delete was refused because the key you asked to remove is the one authenticating the request. The key is untouched and still works.
Status: 409
{
"status": 409,
"type": "api_key_in_use",
"message": "Cannot delete the API key used to make this request",
"request_id": "req_01J8K2P...",
"doc_url": "https://docs.epostix.com/errors/api_key_in_use"
}
Why you got this
- The key in the path is the same key as the one in the
Authorizationheader. - A cleanup script listed the workspace's keys and deleted them in order until it reached its own credentials.
- A rotation ran in the wrong order and deleted the old key while it was still the one making calls.
How to fix it
Authenticate with a different key that holds api-keys:manage and delete the target from
there, or delete it from the dashboard. Either way the request is authenticated by a key
other than the one being removed.
When rotating, create the replacement first, deploy it, confirm your traffic is using it, and delete the old key last. Have bulk cleanups skip any key that matches the credentials they are running under, so a sweep cannot cut itself off partway through.
Is it safe to retry
No, not with the same credentials. The check compares the target against the caller, so it fails the same way every time. Retry with another key and the delete succeeds.