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

# Block or always allow an address on Cloud Defender

> Add an address or a CIDR range to a domain's lists. `action: block` bans it, for `hours` (1 to 2160) or until you remove it; `action: allow` puts it on the Whitelist, so it skips the banned list and Threat Intelligence. Cloud Defender applies the change within about two minutes. Private addresses, Cloudflare's network and Google's own services are refused with a `400` and a reason code. Owners and security officers with a live licence.



## OpenAPI

````yaml post /api/v1/cloud-defender/{id}/ip-rules
openapi: 3.1.0
info:
  title: Aegister API
  version: 2.10.0
servers: []
security: []
paths:
  /api/v1/cloud-defender/{id}/ip-rules:
    post:
      tags:
        - cloud-defender
      summary: Block or always allow an address on a Cloud Defender domain
      description: >-
        Applied by the host proxy within about two minutes. `source: auto_ban`
        (with `event`, the fingerprint

        that triggered it) is the Cloud Defender producer's and reserved to
        Aegister; repeating it extends the ban.
      operationId: cloud_defender_ip_rules_create
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                net:
                  type: string
                  description: One address, a v4 /24 or a v6 /64.
                action:
                  type: string
                  enum:
                    - block
                    - allow
                reason:
                  type: string
                hours:
                  type: integer
                  description: >-
                    Block only: how long it lasts (1-2160). Absent = until
                    removed.
            examples:
              BanAnAddressForAMonth:
                value:
                  net: 203.0.113.7
                  action: block
                  reason: Scanning our login page
                  hours: 720
                summary: Ban an address for a month
              WhitelistAnOfficeNetwork:
                value:
                  net: 2001:db8:10::/64
                  action: allow
                  reason: Office
                summary: Whitelist an office network
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 0
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - []
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                      net:
                        type: string
                        description: One address, a v4 /24 or a v6 /64.
                      action:
                        type: string
                        enum:
                          - block
                          - allow
                        description: >-
                          `block`: banned on this domain. `allow`: on its
                          whitelist.
                      source:
                        type: string
                        enum:
                          - manual
                          - auto_ban
                        description: >-
                          `manual`: added by a person (this API, the console's
                          Protection tab or a Ban button). `auto_ban`: banned
                          automatically by Cloud Defender for 24 hours, after a
                          burst of requests it blocked as attacks on this
                          domain.
                      reason:
                        type: string
                      expires_at:
                        type:
                          - string
                          - 'null'
                        format: date-time
                        description: When a ban ends. Null = until removed.
                      created_at:
                        type: string
                        format: date-time
                      created_by:
                        type:
                          - string
                          - 'null'
                        description: The user who added it.
                      event_id:
                        type:
                          - integer
                          - 'null'
                        description: The detection a ban came from, while it still exists.
                      created:
                        type: boolean
                        description: >-
                          False when the address was already on this list: the
                          entry is the existing one.
              examples:
                Banned:
                  value:
                    error: 0
                    messages: []
                    data:
                      id: 41
                      net: 203.0.113.7
                      action: block
                      source: manual
                      reason: Scanning our login page
                      expires_at: '2026-11-27T09:30:00Z'
                      created_at: '2026-10-28T09:30:00Z'
                      created_by: 00000000-0000-4000-8000-000000000000
                      event_id: null
                      created: true
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 1
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - - Invalid data provided
                        - net_invalid
                        - net_private
                        - net_cloudflare
                        - net_known_good
                        - net_listed
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 1
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - []
          description: ''
        '503':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    description: |-
                      Any value different from 0 indicates an error.  
                      More details can be found in `messages`.
                    minimum: 0
                    maximum: 0
                    examples:
                      - 1
                  messages:
                    type: array
                    description: >-
                      If `error` is `1`, contains zero or more details on the
                      error.
                    examples:
                      - []
          description: ''
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Aegister-Token

````

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