---
title: "Toggle an allowed IP for an API key."
method: POST
path: "/api-keys/{id}/allowed-ips"
tags: ["ApiKeys"]
---

# Toggle an allowed IP for an API key.

`POST /api-keys/{id}/allowed-ips`

## Request

- Base URL: `https://api.enterprise.airtm.com/v2`
- URL: `https://api.enterprise.airtm.com/v2/api-keys/{id}/allowed-ips`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/airtm/apis/airtm-enterprise-api-v2/docs/api-keys/:id/allowed-ips/post.ts> (a function with typed inputs; its response is checked against the schema)

Toggle an IPv4 address on this API key's allowlist. If the IP is already
allowed, it is removed; otherwise it is added. Returns the resulting
allowlist.

## Path parameters

- `id` string, required

## Request body

- IpItem
  - `ip` string, required
  - `label` string

## Response `200`

Ok

- IpItem[]
  - `ip` string, required
  - `label` string

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/airtm/apis/airtm-enterprise-api-v2.md) - [All operations](https://skmtc.dev/airtm/apis/airtm-enterprise-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/airtm/apis/airtm-enterprise-api-v2/revisions/c9ed13d4c5c0?raw)
