---
title: "Toggle default-deny mode for an API key"
method: PATCH
path: "/v1/accounts/{id}/api-keys/{keyId}/default-deny"
tags: ["Accounts"]
---

# Toggle default-deny mode for an API key

`PATCH /v1/accounts/{id}/api-keys/{keyId}/default-deny`

## Request

- Base URL: `https://api.honkio.ca`
- URL: `https://api.honkio.ca/v1/accounts/{id}/api-keys/{keyId}/default-deny`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

When default_deny is true, messages via this key are blocked unless the recipient is in an assigned ALLOW list.

Requires `api_keys:m`.

## Path parameters

- `id` string, required
- `keyId` string, required

## Request body

- object
  - `default_deny` boolean, required

## Response `200`

The key's new default-deny setting.

- object: The key's new default-deny setting.
  - `api_key_id` string, required
  - `default_deny` boolean, required

## Other responses

- `401`: Missing, invalid, revoked or expired API key.
- `402`: The account has no balance, or a LIVE key was used before the first top-up.
- `403`: FORBIDDEN (not your account), LIVE_KEY_REQUIRED (a test key changing a live key), or KEY_FENCED (a fenced key changing its own or any other key's default-deny).
- `404`: NOT_FOUND: no such resource on this account.
- `422`: VALIDATION_ERROR: the request failed validation; details names the fields.
- `429`: Rate limit reached: 100 requests per second per account, or a route-specific limit (Retry-After set where one applies).
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/honkio/apis/honkio-api.md) · [All operations](https://skmtc.dev/honkio/apis/honkio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/honkio/apis/honkio-api/revisions/ce4ed3fe9691?raw)
