---
title: "Create a new IP access control rule"
method: POST
path: "/ip-access-control"
tags: ["IP Access Control"]
---

# Create a new IP access control rule

`POST /ip-access-control`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ip-access-control`
- Auth: HTTP bearer

## Request body

- CreateIpAccessControlRequest: Request to create an IP access control rule
  - `acknowledge_lockout` boolean: Required to save a block rule that matches the address this request came from.
  - `action` string, required: Action to take: "block" or "allow"
  - `confirm_broad_range` boolean: Required to save a block rule broader than /8 (IPv4) or /16 (IPv6).
  - `ip_address` string, required: IPv4 or IPv6 address, in CIDR notation for ranges (e.g., "192.168.1.1", "10.0.0.0/24", "2001:db8::1", or "2001:db8::/32")
  - `reason` string, nullable: Optional reason for the action

## Response `201`

IP access control rule created

- IpAccessControlResponse: Response model for IP access control rules
  - `action` string, required
  - `created_at` string, required
  - `created_by` integer, nullable
  - `id` integer, required
  - `ip_address` string, required
  - `reason` string, nullable
  - `updated_at` string, required

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: Insufficient permissions
- `409`: Duplicate IP address, a block range broader than /8 (IPv4) or /16 (IPv6) without confirm_broad_range, or a block rule that matches the caller's own address without acknowledge_lockout
- `500`: Internal server error

## Changes

- **2026-11-15** `c5965797b8b1`: 2 info
  - added the new optional request property `acknowledge_lockout`
  - added the new optional request property `confirm_broad_range`
- **2026-11-15** `4e654843cab2`: 2 warning
  - removed the request property `acknowledge_lockout`
  - removed the request property `confirm_broad_range`
- **2026-11-15** `7b49a82605a5`: 2 info
  - added the new optional request property `acknowledge_lockout`
  - added the new optional request property `confirm_broad_range`
- **2026-11-09** `12896146b193`: 5 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `409` status
  - …1 more
- **2026-10-05** `4b228ebed583`: 5 info
  - added the optional property `status` to the response with the `400` status
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - added the optional property `status` to the response with the `409` status
  - …1 more

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ip-access-control/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
