Delete API Key
Permanently revoke an API key.
DELETE /api/v1/keys/:id
Permanently revokes the API key. Revoked keys are rejected immediately and cannot be re-activated. Authenticate with a JWT.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The key ID |
Response
Returns 200 OK with a confirmation message:
{ "message": "key revoked" }Code examples
curl -X DELETE https://api.smail.dev/api/v1/keys/key_01hx... \
-H "Authorization: Bearer eyJ..."await smail.keys.revoke("key_01hx...");err := client.Keys.Revoke(ctx, "key_01hx...")Error responses
| Status | Error | Description |
|---|---|---|
401 | unauthorized | Missing or invalid JWT |
404 | not found | Key ID does not exist or belongs to another account |