> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create IP zone

> Creates an IP zone. While the API IP allowlist is enabled, every API token request from an IP address outside all IP zones is rejected with 403, so create zones before enabling enforcement. Admin only.



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml post /ip-zones
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: >-
    The Opal API is a RESTful API that allows you to interact with the Opal
    Security platform programmatically.
  title: Opal API
  version: '1.0'
servers:
  - description: Production
    url: https://api.opal.dev/v1
security: []
tags:
  - name: access-rules
    description: Operations related to access rules
  - name: agent-activity
    description: Operations related to agent activity telemetry
  - name: apps
    description: Operations related to apps
  - name: bundles
    description: Operations related to bundles
  - name: campaigns
    description: Operations related to access review campaigns
  - name: configuration-templates
    description: Operations related to configuration templates
  - name: delegations
    description: Operations related to request reviewer delegations
  - name: event-streams
    description: Operations related to event streaming connections
  - name: events
    description: Operations related to events
  - name: groups
    description: Operations related to groups
  - name: group-bindings
    description: Operations related to group bindings
  - name: idp-group-mappings
    description: Operations related to IDP group mappings
  - name: idp-user-attribute-mappings
    description: >-
      Operations related to the user attributes Opal imports from identity
      providers and HRIS apps
  - name: ip-acl
    description: >-
      Operations related to the API IP allowlist (IP zones and its enforcement
      setting)
  - name: message-channels
    description: Operations related to message channels
  - name: non-human-identities
    description: Operations related to non-human identities
  - name: on-call-schedules
    description: Operations related to on-call schedules
  - name: opal-queries
    description: Operations related to OpalQuery
  - name: opal-scripts
    description: Operations related to OpalScripts
  - name: owners
    description: Operations related to owners
  - name: requests
    description: Operations related to requests
  - name: resources
    description: Operations related to resources
  - name: role-assignments
    description: >-
      Operations related to role assignments (general grants between an entity
      and a principal)
  - name: paladin
    description: Operations related to Paladin
  - name: service-users
    description: Operations related to service users (non-human identities owned by a team)
  - name: sessions
    description: Operations related to sessions
  - name: tags
    description: Operations related to tags
  - name: tokens
    description: Operations related to API tokens
  - name: uars
    description: Operations related to UARs. Deprecated in favor of the `campaigns` API.
  - name: users
    description: Operations related to users
paths:
  /ip-zones:
    post:
      tags:
        - ip-acl
      summary: Create IP zone
      description: >-
        Creates an IP zone. While the API IP allowlist is enabled, every API
        token request from an IP address outside all IP zones is rejected with
        403, so create zones before enabling enforcement. Admin only.
      operationId: createIPZone
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIpZoneInfo'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpZone'
          description: The IP zone just created.
      security:
        - BearerAuth: []
components:
  schemas:
    CreateIpZoneInfo:
      description: Information needed to create an IP zone.
      properties:
        name:
          description: The name of the IP zone.
          example: Office network
          type: string
        description:
          description: A description of the IP zone.
          type: string
        ip_addresses:
          description: The IP addresses or CIDR ranges to allow. At least one is required.
          example:
            - 192.168.1.1
            - 10.0.0.0/24
          items:
            type: string
          type: array
      required:
        - name
        - ip_addresses
      type: object
    IpZone:
      description: >-
        A named list of IP addresses or CIDR ranges allowed to use API tokens
        while the API IP allowlist is enabled.
      example:
        ip_zone_id: 4baf8423-db0a-4037-a4cf-f79c60cb67a5
        name: Office network
        description: Egress IPs for the main office
        ip_addresses:
          - 192.168.1.1
          - 10.0.0.0/24
        created_by_user_id: d4a7d928-783e-4599-8ec6-088d635a5bcc
        created_at: '2022-01-23T04:56:07.000Z'
        updated_at: '2022-02-23T01:34:07.000Z'
      properties:
        ip_zone_id:
          description: The ID of the IP zone.
          format: uuid
          type: string
        name:
          description: The name of the IP zone.
          type: string
        description:
          description: A description of the IP zone.
          type: string
        ip_addresses:
          description: The IP addresses or CIDR ranges in the IP zone.
          items:
            type: string
          type: array
        created_by_user_id:
          description: The ID of the user that created the IP zone.
          format: uuid
          type: string
        created_at:
          description: The date the IP zone was created.
          format: date-time
          type: string
        updated_at:
          description: The date the IP zone was last updated.
          format: date-time
          type: string
      required:
        - ip_zone_id
        - name
        - ip_addresses
        - created_by_user_id
        - created_at
        - updated_at
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.