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

# [Firewall] Apply firewall rules to an instance

> Apply all configured firewall rules to the compute instance. This is an asynchronous operation that updates the instance's network security configuration. Rules that were added, modified, or deleted will take effect after this operation completes.



## OpenAPI

````yaml https://api.onetsolutions.net/schema post /v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{instance_id}/firewall/apply
openapi: 3.0.3
info:
  title: OnetSolutions API
  version: v1 (v1)
  description: >

    ## Overview


    The OnetSolutions API provides programmatic access to manage your cloud
    infrastructure, domains, and web hosting services.


    ## Authentication


    All API requests require authentication using one of the following methods:


    - **JWT Token**: Obtain a token via login endpoints and include it in the
    `Authorization: Bearer <token>` header

    - **API Key**: Generate an API key from your account settings and use it as
    `Authorization: Bearer sk-onetsolutions-...`


    ## Rate Limiting


    API requests are rate-limited to ensure fair usage:

    - **Standard**: 1000 requests per minute

    - **Burst**: 100 requests per second


    ## Pagination


    List endpoints return paginated results. Use `page` and `page_size` query
    parameters.


    ## Error Handling


    The API uses standard HTTP status codes:

    - `200` Success

    - `201` Created

    - `400` Bad Request

    - `401` Unauthorized

    - `403` Forbidden

    - `404` Not Found

    - `429` Too Many Requests
servers:
  - url: https://api.onetsolutions.net
    description: Production
security: []
tags:
  - name: Authentication
    description: >-
      Login, passwordless authentication, MFA, OAuth providers, and token
      management.
  - name: Organizations
    description: >-
      Organization management, members, roles, modules, audit logs, and
      notification settings.
  - name: Projects
    description: Project management, team members, and project-scoped resources.
  - name: Compute
    description: >-
      Cloud instances, volumes, snapshots, backups, VPCs, firewalls, SSH keys,
      uptime monitors, and instance tasks.
  - name: Domains
    description: >-
      Domain availability, registration, transfers, DNS zones, DNS records, and
      TLD information.
  - name: Web Hosting
    description: >-
      cPanel-based web hosting, emails, databases, subdomains, FTP accounts,
      addon domains, and SSL certificates.
paths:
  /v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{instance_id}/firewall/apply:
    post:
      tags:
        - Compute
      summary: '[Firewall] Apply firewall rules to an instance'
      description: >-
        Apply all configured firewall rules to the compute instance. This is an
        asynchronous operation that updates the instance's network security
        configuration. Rules that were added, modified, or deleted will take
        effect after this operation completes.
      operationId: apply_firewall_rules
      parameters:
        - in: path
          name: instance_id
          schema:
            type: string
          description: Unique identifier of the compute instance.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          description: Unique identifier of the organization that owns the resource.
          required: true
        - in: path
          name: project_id
          schema:
            type: string
          description: Unique identifier of the project containing the resource.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstanceFirewallRule'
        required: true
      responses:
        '202':
          description: Firewall rules application initiated
        '401':
          description: Authentication credentials missing or invalid
        '403':
          description: Insufficient permissions to apply firewall rules
        '404':
          description: Instance not found
        '409':
          description: Another firewall operation is in progress
      security:
        - BearerAuth: []
components:
  schemas:
    InstanceFirewallRule:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        instance:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Rule name
          maxLength: 255
        description:
          type: string
          description: Rule description
        direction:
          enum:
            - inbound
            - outbound
          type: string
          description: |-
            * `inbound` - Inbound
            * `outbound` - Outbound
          x-spec-enum-id: d75ca10233d5f788
        action:
          enum:
            - accept
            - drop
            - reject
          type: string
          description: |-
            * `accept` - Accept
            * `drop` - Drop
            * `reject` - Reject
          x-spec-enum-id: dc7ed9226c81bd6d
        protocol:
          enum:
            - tcp
            - udp
            - icmp
            - all
          type: string
          description: |-
            * `tcp` - TCP
            * `udp` - UDP
            * `icmp` - ICMP
            * `all` - All
          x-spec-enum-id: 45748e0bee7973fd
        destination_port:
          type: string
        source_cidr:
          type: string
          description: 'Source IP en notation CIDR (ex: 0.0.0.0/0 pour tout)'
          maxLength: 100
        destination_cidr:
          type: string
          description: Destination IP en notation CIDR
          maxLength: 100
        priority:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Priorité (plus petit = plus prioritaire)
        is_enabled:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - created
        - id
        - instance
        - modified
        - name
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: >-
        Use `Authorization: Bearer <token>` header. Token can be a JWT token or
        an API key (format: `sk-onetsolutions-...`).

````