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

# Create a rule



## OpenAPI

````yaml /openapi.json post /firewall/groups/{firewallGroup}/rules
openapi: 3.1.0
info:
  title: Wenium Cloud API
  version: 2.0.0
  description: >-
    Complete API documentation for the Wenium Cloud platform.


    **Authentication.** All authenticated endpoints require a personal access
    token. Send the token in the `Authorization: Bearer <token>` header.
servers:
  - url: https://console.wenium.com/api
    description: Production API Server
security:
  - bearerAuth: []
paths:
  /firewall/groups/{firewallGroup}/rules:
    post:
      summary: Create a rule
      parameters:
        - name: firewallGroup
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - action
                - protocol
                - port
                - address
              properties:
                type:
                  type: string
                  enum:
                    - Inbound
                    - Outbound
                  example: Inbound
                action:
                  type: string
                  enum:
                    - ACCEPT
                    - REJECT
                    - DROP
                  example: ACCEPT
                protocol:
                  type: string
                  enum:
                    - TCP
                    - UDP
                    - ICMP
                    - All
                  example: TCP
                port:
                  type: string
                  example: '80'
                address:
                  type: string
                  example: 0.0.0.0/0
      responses:
        '200':
          description: Rule created
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Firewall Rule created and sync triggered.
                  data:
                    $ref: '#/components/schemas/FirewallRule'
components:
  schemas:
    FirewallRule:
      type: object
      properties:
        id:
          type: integer
          example: 1
        firewall_group_id:
          type: integer
          example: 1
        type:
          type: string
          enum:
            - Inbound
            - Outbound
          example: Inbound
        action:
          type: string
          enum:
            - ACCEPT
            - REJECT
            - DROP
          example: ACCEPT
        protocol:
          type: string
          enum:
            - TCP
            - UDP
            - ICMP
            - All
          example: TCP
        port:
          type: string
          example: '80'
        address:
          type: string
          example: 0.0.0.0/0
        created_at:
          type: string
          format: date-time
          example: '2026-07-03T00:00:00.000000Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-07-03T00:00:00.000000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Sanctum personal access token

````