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

# Create Firewall

> Creates a new firewall with a given set of rules. See Representation and validation for FirewallRule object structure. Location-specific endpoint.



## OpenAPI

````yaml https://raw.githubusercontent.com/vidinfra/open-api-docs/refs/heads/main/cloud-api.json post /network/firewalls
openapi: 3.0.0
info:
  title: Tenbyte Cloud API
  version: 1.0.0
  description: >-
    API for managing cloud resources like Virtual Machines, Storage, Networks,
    and more on tenbytecloud.com.
servers:
  - url: https://api.tenbytecloud.com/v1
    description: Production server
security:
  - apikey-header-apikey: []
tags:
  - name: User
    description: User profile and SSH key management
  - name: Token
    description: API token management
  - name: Locations
    description: Available data centre locations
  - name: VM
    description: Virtual machine management
  - name: Block Storage
    description: Block storage disk management
  - name: Object Storage
    description: S3-compatible object storage management
  - name: Private networks
    description: Private network management
  - name: Floating IP
    description: Floating IP address management
  - name: Firewall
    description: Firewall management
  - name: Network Load Balancer
    description: Network load balancer management
  - name: Parameters
    description: VM creation parameters and image lists
paths:
  /network/firewalls:
    post:
      tags:
        - Firewall
      summary: Create Firewall
      description: >-
        Creates a new firewall with a given set of rules. See Representation and
        validation for FirewallRule object structure. Location-specific
        endpoint.
      operationId: createFirewall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type: string
                billing_account_id:
                  type: integer
                rules:
                  type: array
                  items:
                    type: object
                  description: Array of FirewallRule objects
            example:
              display_name: Database Firewall
              billing_account_id: 123
              rules:
                - protocol: tcp
                  direction: inbound
                  port_start: 3306
                  port_end: 3306
                  endpoint_spec_type: ip_prefixes
                  endpoint_spec:
                    - 10.0.0.0/24
      responses:
        '200':
          description: Created firewall
          content:
            application/json:
              schema:
                type: object
              example:
                uuid: 2a874f44-310f-4df8-9340-1dc274c2bd51
                display_name: Database Firewall
                billing_account_id: 123
                rules:
                  - uuid: db9acadc-91e1-4225-b934-7f264f9f75a2
                    direction: inbound
                    protocol: tcp
                    port_start: 3306
                    port_end: 3306
                    endpoint_spec_type: ip_prefixes
                    endpoint_spec:
                      - 10.0.0.0/24
                resources_assigned: []
      security:
        - apikey-header-apikey: []
components:
  securitySchemes:
    apikey-header-apikey:
      type: apiKey
      in: header
      name: apikey

````