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

# Create custom rule



## OpenAPI

````yaml /api-reference/services_docs_mintlify_enriched/waap_api.yaml post /waap/v1/domains/{domain_id}/custom-rules
openapi: 3.1.0
info:
  title: Gcore OpenAPI – WAAP API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  contact:
    email: support@gcore.com
  version: bc9130169b96
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: API Discovery
  - name: Advanced Rules
  - name: Analytics
  - name: Custom Page Sets
  - name: Custom Rules
  - name: Domains
  - name: Filter Templates
  - name: Firewall Rules
  - name: IP Reputation
  - name: IP Spotlight
  - name: Network Organizations
  - name: Policies
  - name: Policy Overrides
  - name: Pre-billing
  - name: Security Insights
  - name: Tags
  - name: WAAP Service
paths:
  /waap/v1/domains/{domain_id}/custom-rules:
    post:
      tags:
        - Custom Rules
      summary: Create custom rule
      operationId: create_custom_rule_v1_domains__domain_id__custom_rules_post
      parameters:
        - name: domain_id
          in: path
          required: true
          schema:
            type: integer
            exclusiveMinimum: 0
            description: The domain ID
            title: Domain Id
          description: The domain ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRule'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRuleResponse'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: http-bad-request
                title: Bad Request
                status: 400
                detail: 'Invalid domain name: '''''''''
          description: Bad Request
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              example:
                detail: Auth token is missing or invalid
        '403':
          description: Quota limit exceeded
          content:
            application/problem+json:
              example:
                title: Quota limit exceeded
                type: quota-check-limit-exceeded
                status: 403
                detail: >-
                  You have reached the maximum limit allowed for your current
                  plan. Please upgrade your plan to add more.
        '404':
          description: Resource not found
          content:
            application/problem+json:
              example:
                title: Resource not found
                type: quota-check-no-resource
                status: 404
                detail: >-
                  The quota resource requested does not exist. Cannot enable
                  WAAP for this domain. Please reach out to our support team.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APICompositeError'
              example:
                type: request-validation-failed
                title: Request validation error.
                status: 422
                detail: One or more fields have validation errors.
                errors:
                  - loc:
                      - body
                      - name
                    detail: Input should be a valid string
                  - loc:
                      - body
                      - date
                    detail: Field required
                  - loc:
                      - query
                      - limit
                    detail: Field required
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/APIError'
              example:
                type: internal-server-error
                title: Internal server error.
                status: 500
                detail: >-
                  An unexpected condition was encountered which prevented the
                  server from fulfilling the request.
          description: Internal Server Error
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            waap_custom_rule = client.waap.domains.custom_rules.create(
                domain_id=1,
                action={},
                conditions=[{}],
                enabled=True,
                name="Block foobar bot",
            )
            print(waap_custom_rule.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/option\"\n\t\"github.com/G-Core/gcore-go/waap\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\twaapCustomRule, err := client.Waap.Domains.CustomRules.New(\n\t\tcontext.TODO(),\n\t\t1,\n\t\twaap.DomainCustomRuleNewParams{\n\t\t\tAction:     waap.DomainCustomRuleNewParamsAction{},\n\t\t\tConditions: []waap.DomainCustomRuleNewParamsCondition{{}},\n\t\t\tEnabled:    true,\n\t\t\tName:       \"Block foobar bot\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", waapCustomRule.ID)\n}\n"
components:
  schemas:
    CustomRule:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          pattern: ^[A-Za-z0-9\s.:'";<>?&|\\_-]+$
          title: Name
          description: The name assigned to the rule
          example: Block foobar bot
          examples:
            - Block foobar bot
        description:
          type: string
          maxLength: 100
          title: Description
          description: A human-readable description.
          default: ''
        enabled:
          type: boolean
          title: Enabled
          description: Whether or not the rule is enabled
        action:
          $ref: '#/components/schemas/CustomerRuleAction'
          description: >-
            The action that the rule takes when triggered. Only one action can
            be set per rule.
        conditions:
          items:
            $ref: '#/components/schemas/CustomRuleCondition'
          type: array
          maxItems: 5
          minItems: 1
          title: Conditions
          description: >-
            The conditions required for the WAAP engine to trigger the rule.
            Rules may have between 1 and 5 conditions. All conditions must pass
            for the rule to trigger
      type: object
      required:
        - name
        - enabled
        - action
        - conditions
      title: CustomRule
      description: A request to create a new WAAP rule
    CustomRuleResponse:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          pattern: ^[A-Za-z0-9\s.:'";<>?&|\\_-]+$
          title: Name
          description: The name assigned to the rule
          example: Block foobar bot
          examples:
            - Block foobar bot
        description:
          type: string
          maxLength: 100
          title: Description
          description: A human-readable description.
          default: ''
        enabled:
          type: boolean
          title: Enabled
          description: Whether or not the rule is enabled
        action:
          $ref: '#/components/schemas/CustomerRuleAction'
          description: >-
            The action that the rule takes when triggered. Only one action can
            be set per rule.
        id:
          type: integer
          title: Id
          description: The unique identifier for the rule
        conditions:
          items:
            $ref: '#/components/schemas/CustomRuleConditionResponse'
          type: array
          maxItems: 5
          minItems: 1
          title: Conditions
          description: >-
            The conditions required for the WAAP engine to trigger the rule.
            Rules may have between 1 and 5 conditions. All conditions must pass
            for the rule to trigger
      type: object
      required:
        - name
        - enabled
        - action
        - id
        - conditions
      title: CustomRuleResponse
      description: An WAAP rule applied to a domain
    APIError:
      properties:
        type:
          type: string
          title: Type
          description: A URI identifier that categorizes the type of error.
        title:
          type: string
          title: Title
          description: A brief, human-readable title for the error.
        status:
          type: integer
          title: Status
          description: The HTTP status code applicable to this error.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: A detailed human-readable explanation of the error.
      type: object
      required:
        - type
        - title
        - status
        - detail
      title: APIError
    APICompositeError:
      properties:
        type:
          type: string
          title: Type
          description: A URI identifier that categorizes the type of error.
        title:
          type: string
          title: Title
          description: A brief, human-readable title for the error.
        status:
          type: integer
          title: Status
          description: The HTTP status code applicable to this error.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
          description: A detailed human-readable explanation of the error.
        errors:
          items:
            $ref: '#/components/schemas/APIFieldError'
          type: array
          title: Errors
          description: A list of detailed errors for individual fields.
      type: object
      required:
        - type
        - title
        - status
        - detail
        - errors
      title: APICompositeError
    CustomerRuleAction:
      properties:
        allow:
          $ref: '#/components/schemas/RuleAllowAction'
        block:
          $ref: '#/components/schemas/RuleBlockAction'
        captcha:
          $ref: '#/components/schemas/RuleCaptchaAction'
        handshake:
          $ref: '#/components/schemas/RuleHandshakeAction'
        monitor:
          $ref: '#/components/schemas/RuleMonitorAction'
        tag:
          $ref: '#/components/schemas/RuleTagAction'
      additionalProperties: false
      type: object
      title: CustomerRuleAction
      description: The action that a WAAP rule takes when triggered.
    CustomRuleCondition:
      properties:
        ip:
          $ref: '#/components/schemas/IpCondition'
        ip_range:
          $ref: '#/components/schemas/IpRangeCondition'
        url:
          $ref: '#/components/schemas/UrlCondition'
        user_agent:
          $ref: '#/components/schemas/UserAgentCondition'
        header:
          $ref: '#/components/schemas/HeaderCondition'
        header_exists:
          $ref: '#/components/schemas/HeaderExistsCondition'
        http_method:
          $ref: '#/components/schemas/HttpMethodCondition'
        file_extension:
          $ref: '#/components/schemas/FileExtensionCondition'
        content_type:
          $ref: '#/components/schemas/ContentTypeCondition'
        country:
          $ref: '#/components/schemas/CountryCondition'
        organization:
          $ref: '#/components/schemas/OrganizationCondition'
        asn:
          $ref: '#/components/schemas/AsnCondition'
        request_rate:
          $ref: '#/components/schemas/RequestRateCondition'
        owner_types:
          $ref: '#/components/schemas/OwnerTypesCondition'
        tags:
          $ref: '#/components/schemas/TagsCondition'
        session_request_count:
          $ref: '#/components/schemas/SessionRequestCountCondition'
        user_defined_tags:
          $ref: '#/components/schemas/UserDefinedTagsCondition'
        ja3:
          $ref: '#/components/schemas/Ja3Condition-Input'
        ja4:
          $ref: '#/components/schemas/Ja4Condition-Input'
      additionalProperties: false
      type: object
      title: CustomRuleCondition
      description: >-
        The criteria of an incoming web request and the models of the various
        values those criteria can take.


        Used for creating and updating custom rules. Does not include the
        ResponseHeader/

        ResponseHeaderExists condition types, which are only readable on
        existing rules

        (see CustomRuleConditionResponse).
    CustomRuleConditionResponse:
      properties:
        ip:
          $ref: '#/components/schemas/IpCondition'
        ip_range:
          $ref: '#/components/schemas/IpRangeCondition'
        url:
          $ref: '#/components/schemas/UrlCondition'
        user_agent:
          $ref: '#/components/schemas/UserAgentCondition'
        header:
          $ref: '#/components/schemas/HeaderCondition'
        header_exists:
          $ref: '#/components/schemas/HeaderExistsCondition'
        http_method:
          $ref: '#/components/schemas/HttpMethodCondition'
        file_extension:
          $ref: '#/components/schemas/FileExtensionCondition'
        content_type:
          $ref: '#/components/schemas/ContentTypeCondition'
        country:
          $ref: '#/components/schemas/CountryCondition'
        organization:
          $ref: '#/components/schemas/OrganizationCondition'
        asn:
          $ref: '#/components/schemas/AsnCondition'
        request_rate:
          $ref: '#/components/schemas/RequestRateCondition'
        owner_types:
          $ref: '#/components/schemas/OwnerTypesCondition'
        tags:
          $ref: '#/components/schemas/TagsCondition'
        session_request_count:
          $ref: '#/components/schemas/SessionRequestCountCondition'
        user_defined_tags:
          $ref: '#/components/schemas/UserDefinedTagsCondition'
        ja3:
          $ref: '#/components/schemas/Ja3Condition-Output'
        ja4:
          $ref: '#/components/schemas/Ja4Condition-Output'
        response_header:
          $ref: '#/components/schemas/ResponseHeaderCondition'
        response_header_exists:
          $ref: '#/components/schemas/ResponseHeaderExistsCondition'
      additionalProperties: false
      type: object
      title: CustomRuleConditionResponse
      description: >-
        The full set of custom rule condition types, including
        ResponseHeader/ResponseHeaderExists

        conditions that may exist on rules already stored in Lime but cannot be
        created or updated

        through the API.
    APIFieldError:
      properties:
        loc:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: string
              type: array
            - {}
          title: Loc
          description: The location of the field or a character number causing the error.
        detail:
          type: string
          title: Detail
          description: A human-readable message describing the error.
      type: object
      required:
        - loc
        - detail
      title: APIFieldError
    RuleAllowAction:
      properties: {}
      additionalProperties: true
      type: object
      title: RuleAllowAction
      description: The WAAP allows the request
    RuleBlockAction:
      properties:
        status_code:
          $ref: '#/components/schemas/RuleBlockStatusCode'
          description: >-
            An HTTP status code that the WAAP returns if a rule blocks a
            request.
          default: 403
        action_duration:
          type: string
          maxLength: 10
          minLength: 1
          pattern: ^[1-9][0-9]*[smhd]?$
          title: Action Duration
          description: >-
            How long a rule's block action will apply to subsequent requests.
            Can be specified in seconds or by using a numeral followed by 's',
            'm', 'h', or 'd' to represent time format (seconds, minutes, hours,
            or days). Empty time intervals are not allowed. If not specified,
            the action is applied only to the request that triggers the rule.
          example: 12h
          examples:
            - 12h
            - 60s
            - '30'
      additionalProperties: false
      type: object
      title: RuleBlockAction
      description: >-
        WAAP block action behavior could be configured with response status code
        and action duration.
    RuleCaptchaAction:
      properties: {}
      additionalProperties: true
      type: object
      title: RuleCaptchaAction
      description: The WAAP presents the user with a captcha
    RuleHandshakeAction:
      properties: {}
      additionalProperties: true
      type: object
      title: RuleHandshakeAction
      description: The WAAP performs automatic browser validation
    RuleMonitorAction:
      properties: {}
      additionalProperties: true
      type: object
      title: RuleMonitorAction
      description: The WAAP monitors the request but takes no action
    RuleTagAction:
      properties:
        tags:
          items:
            type: string
          type: array
          maxItems: 5
          minItems: 1
          title: Tags
          description: The list of user defined tags to tag the request with
      type: object
      required:
        - tags
      title: RuleTagAction
      description: WAAP tag action gets a list of tags to tag the request scope with
    IpCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        ip_address:
          type: string
          format: ipvanyaddress
          title: Ip Address
          description: A single IPv4 or IPv6 address
      type: object
      required:
        - ip_address
      title: IpCondition
      description: Match the incoming request against a single IP address
    IpRangeCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        lower_bound:
          type: string
          format: ipvanyaddress
          title: Lower Bound
          description: The lower bound IPv4 or IPv6 address to match against
        upper_bound:
          type: string
          format: ipvanyaddress
          title: Upper Bound
          description: The upper bound IPv4 or IPv6 address to match against
      type: object
      required:
        - lower_bound
        - upper_bound
      title: IpRangeCondition
      description: Match the incoming request against an IP range
    UrlCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        match_type:
          type: string
          enum:
            - Exact
            - Contains
            - Regex
          title: Match Type
          description: The type of matching condition.
          default: Contains
        url:
          type: string
          maxLength: 500
          minLength: 1
          title: Url
          description: >-
            The pattern to match against the request URL.

            Constraints depend on `match_type`:


            - **Exact/Contains**: plain text matching (e.g., `/admin`, must
            comply with `^[\w!\$~:#\[\]@\(\)*\+,=\/\-\.\%]+$`).

            - **Regex**: a valid regular expression (e.g.,
            `^/upload(/\d+)?/\w+`). Lookahead/lookbehind constructs are
            forbidden.
          example: /wp-admin/
          examples:
            - /wp-admin/
      type: object
      required:
        - url
      title: UrlCondition
      description: Match the incoming request URL
    UserAgentCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        user_agent:
          type: string
          maxLength: 300
          title: User Agent
          description: The user agent value to match
          example: curl/
          examples:
            - curl/
        match_type:
          type: string
          enum:
            - Exact
            - Contains
          title: Match Type
          description: The type of matching condition.
          default: Contains
      type: object
      required:
        - user_agent
      title: UserAgentCondition
      description: Match the user agent making the request
    HeaderCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        header:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z0-9-]+$
          title: Header
          description: The request header name
          example: Origin
          examples:
            - Origin
        value:
          type: string
          maxLength: 100
          pattern: ^[a-zA-Z0-9-_ :;.\/\"'?!(){}\[\]@<>=\-\+\*#$&`|~^%]+$
          title: Value
          description: The request header value
        match_type:
          type: string
          enum:
            - Exact
            - Contains
          title: Match Type
          description: The type of matching condition for header and value.
          default: Contains
      type: object
      required:
        - header
        - value
      title: HeaderCondition
      description: Match an incoming request header
    HeaderExistsCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        header:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z0-9-]+$
          title: Header
          description: The request header name
          example: Origin
          examples:
            - Origin
      type: object
      required:
        - header
      title: HeaderExistsCondition
      description: Match when an incoming request header is present
    HttpMethodCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        http_method:
          $ref: '#/components/schemas/HTTPMethod'
          description: HTTP methods of a request
          examples:
            - CONNECT
      type: object
      required:
        - http_method
      title: HttpMethodCondition
      description: Match the incoming HTTP method
    FileExtensionCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        file_extension:
          items:
            type: string
            maxLength: 10
            minLength: 1
            pattern: '[a-z0-9]+$'
            description: A file extension without the leading dot
            example: pdf
            examples:
              - pdf
              - png
          type: array
          maxItems: 20
          minItems: 1
          title: File Extension
          description: The list of file extensions to match against
      type: object
      required:
        - file_extension
      title: FileExtensionCondition
      description: Match the incoming file extension
    ContentTypeCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        content_type:
          items:
            type: string
            maxLength: 50
            minLength: 1
            description: Individual MIME type to match
            example: application/xml
            examples:
              - application/xml
          type: array
          maxItems: 10
          minItems: 1
          title: Content Type
          description: The list of content types to match against
      type: object
      required:
        - content_type
      title: ContentTypeCondition
      description: Match the requested Content-Type
    CountryCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        country_code:
          items:
            type: string
            pattern: ^\w{2}$
          type: array
          maxItems: 100
          minItems: 1
          title: Country Code
          description: >-
            A list of ISO 3166-1 alpha-2 formatted strings representing the
            countries to match against
          example: CN
          examples:
            - CN
            - TW
      type: object
      required:
        - country_code
      title: CountryCondition
      description: Match the country that the request originated from
    OrganizationCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        organization:
          type: string
          maxLength: 100
          title: Organization
          description: The organization to match against
          example: UptimeRobot s.r.o
          examples:
            - UptimeRobot s.r.o
      type: object
      required:
        - organization
      title: OrganizationCondition
      description: >-
        Match the organization the request originated from, as determined by a
        WHOIS lookup of the requesting IP
    AsnCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        asns:
          items:
            type: integer
            maximum: 4294967295
            exclusiveMinimum: 0
            description: An Autonomous System Number to match against
          type: array
          maxItems: 100
          minItems: 1
          title: Asns
          description: A list of Autonomous System Numbers (ASNs) to match against
          example: 15169
          examples:
            - 15169
            - 13335
      type: object
      required:
        - asns
      title: AsnCondition
      description: >-
        Match the ASN (Autonomous System Number) the request originated from, as
        determined by a WHOIS lookup of the requesting IP
    RequestRateCondition:
      properties:
        ips:
          items:
            type: string
            format: ipvanyaddress
          type: array
          maxItems: 10
          title: Ips
          description: A list of source IPs that can trigger a request rate condition
        http_methods:
          items:
            $ref: '#/components/schemas/HTTPMethod'
          type: array
          title: Http Methods
          description: >-
            Possible HTTP request methods that can trigger a request rate
            condition
        path_pattern:
          type: string
          maxLength: 500
          minLength: 1
          title: Path Pattern
          description: A regular expression matching the URL path of the incoming request
          example: /
          examples:
            - /
            - /path/to
        requests:
          type: integer
          minimum: 20
          title: Requests
          description: >-
            The number of incoming requests over the given time that can trigger
            a request rate condition
        time:
          type: integer
          maximum: 3600
          minimum: 1
          title: Time
          description: >-
            The number of seconds that the WAAP measures incoming requests over
            before triggering a request rate condition
        user_defined_tag:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z]+[ a-zA-Z0-9]*$
          title: User Defined Tag
          description: >-
            A user-defined tag that can be included in incoming requests and
            used to trigger a request rate condition
      additionalProperties: false
      type: object
      required:
        - path_pattern
        - requests
        - time
      title: RequestRateCondition
      description: Match the rate at which requests come in that match certain conditions
    OwnerTypesCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        owner_types:
          items:
            type: string
            enum:
              - COMMERCIAL
              - EDUCATIONAL
              - GOVERNMENT
              - HOSTING_SERVICES
              - ISP
              - MOBILE_NETWORK
              - NETWORK
              - RESERVED
          type: array
          minItems: 1
          title: Owner Types
          description: >-
            Match the type of organization that owns the IP address making an
            incoming request
          default:
            - COMMERCIAL
      type: object
      title: OwnerTypesCondition
      description: >-
        Match the type of organization that owns the IP address making an
        incoming request
    TagsCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        tags:
          items:
            type: string
          type: array
          maxItems: 5
          minItems: 1
          title: Tags
          description: A list of tags to match against the request tags
          example: botnetclient
          examples:
            - botnetclient
            - xss
      type: object
      required:
        - tags
      title: TagsCondition
      description: Matches requests based on specified tags
    SessionRequestCountCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        request_count:
          type: integer
          exclusiveMinimum: 0
          title: Request Count
          description: The number of dynamic requests in the session
      type: object
      required:
        - request_count
      title: SessionRequestCountCondition
      description: Match the number of dynamic page requests made in a WAAP session
    UserDefinedTagsCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        tags:
          items:
            type: string
            maxLength: 50
            minLength: 1
            pattern: ^[a-zA-Z]+[ a-zA-Z0-9]*$
            description: A user-defined tag assigned to the request
          type: array
          maxItems: 10
          minItems: 1
          title: Tags
          description: A list of user-defined tags to match against the request tags
      type: object
      required:
        - tags
      title: UserDefinedTagsCondition
      description: Matches requests based on user-defined tags
    Ja3Condition-Input:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        ja3_fingerprints:
          items:
            type: string
            description: >-
              A JA3 TLS client fingerprint (32-character MD5 hash, mixed case
              allowed and normalized to lowercase)
            example: e7d705a3286e19ea42f587b344ee6865
            examples:
              - e7d705a3286e19ea42f587b344ee6865
          type: array
          maxItems: 10
          minItems: 1
          title: Ja3 Fingerprints
          description: A list of JA3 TLS client fingerprints to match against the request
      type: object
      required:
        - ja3_fingerprints
      title: Ja3Condition
      description: Match the JA3 TLS client fingerprint of the request
    Ja4Condition-Input:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        ja4_fingerprints:
          items:
            type: string
            description: >-
              A JA4 TLS client fingerprint in the form __ (10-character prefix
              and two 12-character hexadecimal hashes, mixed case allowed and
              normalized to lowercase)
            example: t13d3113h2_e8f1e7e78f70_ce5650b735ce
            examples:
              - t13d3113h2_e8f1e7e78f70_ce5650b735ce
          type: array
          maxItems: 10
          minItems: 1
          title: Ja4 Fingerprints
          description: A list of JA4 TLS client fingerprints to match against the request
      type: object
      required:
        - ja4_fingerprints
      title: Ja4Condition
      description: Match the JA4 TLS client fingerprint of the request
    Ja3Condition-Output:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        ja3_fingerprints:
          items:
            type: string
            pattern: ^[a-f0-9]{32}$
            description: >-
              A JA3 TLS client fingerprint (32-character MD5 hash, mixed case
              allowed and normalized to lowercase)
            example: e7d705a3286e19ea42f587b344ee6865
            examples:
              - e7d705a3286e19ea42f587b344ee6865
          type: array
          maxItems: 10
          minItems: 1
          title: Ja3 Fingerprints
          description: A list of JA3 TLS client fingerprints to match against the request
      type: object
      required:
        - ja3_fingerprints
      title: Ja3Condition
      description: Match the JA3 TLS client fingerprint of the request
    Ja4Condition-Output:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        ja4_fingerprints:
          items:
            type: string
            pattern: >-
              ^[tq][0-9]{2}[di][0-9]{2}[0-9]{2}[a-z0-9_]{2}_[a-f0-9]{12}_[a-f0-9]{12}$
            description: >-
              A JA4 TLS client fingerprint in the form __ (10-character prefix
              and two 12-character hexadecimal hashes, mixed case allowed and
              normalized to lowercase)
            example: t13d3113h2_e8f1e7e78f70_ce5650b735ce
            examples:
              - t13d3113h2_e8f1e7e78f70_ce5650b735ce
          type: array
          maxItems: 10
          minItems: 1
          title: Ja4 Fingerprints
          description: A list of JA4 TLS client fingerprints to match against the request
      type: object
      required:
        - ja4_fingerprints
      title: Ja4Condition
      description: Match the JA4 TLS client fingerprint of the request
    ResponseHeaderCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        header:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z0-9-]+$
          title: Header
          description: The response header name
        value:
          type: string
          maxLength: 100
          pattern: ^[a-zA-Z0-9-_ :;.\/\"'?!(){}\[\]@<>=\-\+\*#$&`|~^%]+$
          title: Value
          description: The response header value
        match_type:
          type: string
          enum:
            - Exact
            - Contains
          title: Match Type
          description: The type of matching condition for header and value.
          default: Contains
      type: object
      required:
        - header
        - value
      title: ResponseHeaderCondition
      description: Match a response header
    ResponseHeaderExistsCondition:
      properties:
        negation:
          type: boolean
          title: Negation
          description: >-
            Whether or not to apply a boolean NOT operation to the rule's
            condition
          default: false
        header:
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[a-zA-Z0-9-]+$
          title: Header
          description: The response header name
      type: object
      required:
        - header
      title: ResponseHeaderExistsCondition
      description: Match when a response header is present
    RuleBlockStatusCode:
      type: integer
      enum:
        - 403
        - 405
        - 418
        - 429
      title: RuleBlockStatusCode
      description: Designates the HTTP status code to deliver when a request is blocked.
    HTTPMethod:
      type: string
      enum:
        - CONNECT
        - DELETE
        - GET
        - HEAD
        - OPTIONS
        - PATCH
        - POST
        - PUT
        - TRACE
      title: HTTPMethod
      description: |-
        HTTP methods and descriptions

        Methods from the following RFCs are all observed:

         - RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
        - RFC 5789: PATCH Method for HTTP
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234_abcdef`
      type: apiKey
      in: header
      name: Authorization

````