API Reference

Delete API key

DELETE /api-keys/:id — revoke an API key.

DELETE/api-keys/:id

Revokes an API key immediately. The key stops working on its next use. An API-key caller must hold full_access to revoke keys.

Path parameters
idstringrequired

The API key ID.

import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.apiKeys.remove('dacf4072-4119-4d88-932f-6202748ac7c8');
console.log({ data, error });

Response

{
  "object": "api_key",
  "id": "dacf4072-4119-4d88-932f-6202748ac7c8",
  "deleted": true
}
Errors: not_found if the key does not exist or is not yours; invalid_access if the calling key lacks full access.