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

# Get firewall

> > ⚠️ This endpoint is in [public preview](/preview/roadmap).

Retrieve a firewall by ID or resource path. Includes the workspace's 'default' firewall, fetched the same way as any other.



## OpenAPI

````yaml /preview/openapi.json get /preview/v2/firewalls/{id}
openapi: 3.1.0
info:
  title: sfc-api
  description: >-
    Public preview API - subject to change. See
    https://docs.sfcompute.com/preview/roadmap for details.
  version: 0.1.0
servers:
  - url: https://api.sfcompute.com
security:
  - bearer_auth: []
tags:
  - name: Account
    description: The authenticated account and logged-in user.
  - name: Pools
    description: A bucket of owned compute balance over time.
  - name: Orders
    description: >-
      Place orders targeting a capacity to increase your reserved compute
      balance during some time period.
  - name: Instance Templates
    description: Reusable instance configuration.
  - name: Images
    description: Custom machine images for instances.
  - name: Roles
    description: TOML-based permission role definitions.
  - name: Grants
    description: Bind principals (users or tokens) to roles on a workspace.
  - name: Tokens
    description: Workspace-scoped API tokens.
  - name: Instances
    description: Spin up instances in a capacity to use your available compute.
  - name: Instance SKU Catalog
    description: Browse available instance SKU property definitions.
  - name: Procurements
    description: Market automations that maintain capacity by placing buy/sell orders.
  - name: Deployments
    description: >-
      Deployment automations that maintain a fleet of instances, including spot
      deployments that buy capacity up to a maximum price.
  - name: Users
    description: Read-only access to users within the caller's organization.
  - name: Workspaces
    description: Resource containers scoped to an account.
  - name: Permissions
    description: Inspect what the caller is allowed to do.
  - name: Billing
    description: Billing profile, contacts, and auto top-up settings.
  - name: Orderbook
    description: >-
      Read-only orderbook visibility: bid/ask spread, depth, open and filled
      orders, and historical fills, keyed on hardware requirements + delivery
      window.
  - name: Orders
    description: >-
      Estimate an order before placing it: filled price, fee, and operational
      notices.
paths:
  /preview/v2/firewalls/{id}:
    get:
      tags:
        - Firewalls
      summary: Get firewall
      description: >-
        > ⚠️ This endpoint is in [public preview](/preview/roadmap).


        Retrieve a firewall by ID or resource path. Includes the workspace's
        'default' firewall, fetched the same way as any other.
      operationId: fetch_firewall
      parameters:
        - name: id
          in: path
          description: Firewall ID or resource path
          required: true
          schema:
            type: string
            description: >-
              A resource path like 'sfc:firewall:acme:prod:my-firewall' _or_ an
              ID. Resource paths are human-readable but not stable - they change
              when resources are renamed or moved. IDs are stable and permanent.
            examples:
              - frwl_k3R-nX9vLm7Qp2Yw5Jd8F
            pattern: >-
              (frwl_[0-9a-zA-Z_-]{1,21})|(sfc:firewall:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){2,2})
      responses:
        '200':
          description: Firewall details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FirewallResponse'
        '400':
          description: Malformed request parameters or body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Firewall not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '429':
          description: >-
            Rate limit exceeded. Retry after the interval indicated by the
            rate-limit response headers.
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    FirewallResponse:
      allOf:
        - $ref: '#/components/schemas/FirewallScope'
        - $ref: '#/components/schemas/FirewallSpec'
        - type: object
          required:
            - object
            - created_at
            - updated_at
          properties:
            object:
              type: string
              const: firewall
              default: firewall
              readOnly: true
            created_at:
              $ref: '#/components/schemas/UnixEpoch'
            updated_at:
              $ref: '#/components/schemas/UnixEpoch'
    BadRequestError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: invalid_request_error
              default: invalid_request_error
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
            details:
              type: array
              items:
                $ref: '#/components/schemas/ErrorDetail'
    UnauthorizedError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: authentication_error
              default: authentication_error
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    ForbiddenError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: forbidden
              default: forbidden
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    NotFoundError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: not_found
              default: not_found
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    InternalServerError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: api_error
              default: api_error
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    FirewallScope:
      type: object
      required:
        - id
        - resource_path
        - owner
        - workspace
        - workspace_id
        - name
      properties:
        id:
          $ref: '#/components/schemas/FirewallId'
        resource_path:
          $ref: '#/components/schemas/firewallResourcePath_FirewallId'
        owner:
          $ref: '#/components/schemas/Name'
        workspace:
          $ref: '#/components/schemas/Name'
        workspace_id:
          $ref: '#/components/schemas/WorkspaceId'
        name:
          $ref: '#/components/schemas/Name'
    FirewallSpec:
      type: object
      description: The set of rules a firewall enforces.
      required:
        - rules
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/FirewallRule'
          description: >-
            Allow-only ingress rules. Order is preserved across reads and PUT
            replacements.
    UnixEpoch:
      type: integer
      format: int64
      description: Unix timestamp.
      example: 1738972800
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        field:
          type:
            - string
            - 'null'
          description: The field that caused the error (for validation errors)
        code:
          type: string
          description: Specific error code for this detail
        message:
          type: string
          description: Human-readable error message
    FirewallId:
      type: string
      examples:
        - frwl_k3R-nX9vLm7Qp2Yw5Jd8F
      pattern: frwl_[0-9a-zA-Z_-]{1,21}
    firewallResourcePath_FirewallId:
      type: string
      description: >-
        A resource path for a firewall resource. Format:
        sfc:firewall:<account>:<workspace>:<name>.
      examples:
        - sfc:firewall:<account_id>:<workspace>:<name>
      pattern: sfc:firewall:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+
    Name:
      type: string
      examples:
        - my-resource-name
      maxLength: 255
      minLength: 1
      pattern: '[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}'
    WorkspaceId:
      type: string
      examples:
        - wksp_k3R-nX9vLm7Qp2Yw5Jd8F
      pattern: wksp_[0-9a-zA-Z_-]{1,21}
    FirewallRule:
      type: object
      required:
        - direction
        - protocol
      properties:
        direction:
          $ref: '#/components/schemas/FirewallDirection'
        protocol:
          $ref: '#/components/schemas/FirewallProtocol'
        port:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FirewallPort'
              description: Required for tcp/udp; must be absent on icmp.
        source:
          $ref: '#/components/schemas/CidrInfo'
          description: >-
            IPv4 source CIDR. Defaults to `0.0.0.0/0` (allow from any address)
            when omitted on input. Cannot overlap non-publicly-routable space
            (private, loopback, link-local, CGNAT, documentation, multicast,
            etc.); the wildcard `0.0.0.0/0` is the only exception.
    FirewallDirection:
      type: string
      description: >-
        Direction of a firewall rule. Only `ingress` is accepted today; `egress`
        is reserved for future use and rejected with 422 if submitted.
      enum:
        - ingress
        - egress
    FirewallProtocol:
      type: string
      enum:
        - tcp
        - udp
        - icmp
    FirewallPort:
      type: string
      description: >-
        A single port (e.g. "22") or a closed range (e.g. "8000-8999"). Both
        endpoints must be in 0-65535 with start <= end. Required for tcp/udp
        rules; forbidden on icmp rules.
      examples:
        - '22'
        - 8000-8999
      pattern: ^(0|[1-9][0-9]{0,4})(-(0|[1-9][0-9]{0,4}))?$
    CidrInfo:
      type: string
      description: >-
        An IPv4 CIDR block (e.g. "10.0.0.0/24"). Host bits must be zero; prefix
        length is 0–32.
      examples:
        - 10.0.0.0/24
        - 0.0.0.0/0
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Create an API token using `sf tokens create` or at
        https://sfcompute.com/account/api-keys.

````