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

# Update a sandbox network policy

> Replaces the outbound network policy and waits for the owning node to apply it.



## OpenAPI

````yaml https://api.thundercompute.com:8443/openapi.json patch /sandboxes/{id}/network-policy
openapi: 3.1.0
info:
  contact:
    email: support@thundercompute.com
    name: Thunder Compute API Support
    url: https://thundercompute.com/support
  description: Retrieve current GPU availability using mode-less spec keys
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Thunder Compute API
  version: '1.0'
servers:
  - description: Production server
    url: https://api.thundercompute.com:8443/v1
  - description: Production server
    url: https://api.thundercompute.com:8443
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /sandboxes/{id}/network-policy:
    patch:
      tags:
        - Sandboxes
      summary: Update a sandbox network policy
      description: >-
        Replaces the outbound network policy and waits for the owning node to
        apply it.
      parameters:
        - description: Sandbox ID
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                - $ref: >-
                    #/components/schemas/thundertypes.SandboxNetworkPolicyUpdateRequest
                  summary: body
                  description: Sandbox network policy update
        description: Sandbox network policy update
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/thundertypes.SandboxNetworkPolicyUpdateResponse
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Conflict
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    thundertypes.SandboxNetworkPolicyUpdateRequest:
      properties:
        network_policy:
          $ref: '#/components/schemas/thundertypes.SandboxNetworkPolicy'
      required:
        - network_policy
      type: object
    thundertypes.SandboxNetworkPolicyUpdateResponse:
      properties:
        id:
          type: string
        network_policy:
          $ref: '#/components/schemas/thundertypes.SandboxNetworkPolicy'
      required:
        - id
        - network_policy
      type: object
    thundertypes.ErrorResponse:
      properties:
        code:
          example: 400
          type: integer
        error:
          example: invalid_request
          type: string
        message:
          example: The request is malformed
          type: string
      type: object
    thundertypes.SandboxNetworkPolicy:
      properties:
        cidr_allowlist:
          items:
            type: string
          type: array
          uniqueItems: false
        domain_allowlist:
          items:
            type: string
          type: array
          uniqueItems: false
        internet_access:
          $ref: '#/components/schemas/thundertypes.SandboxInternetAccess'
      required:
        - internet_access
      type: object
    thundertypes.SandboxInternetAccess:
      enum:
        - closed
        - open
        - restricted
      type: string
      x-enum-varnames:
        - SandboxInternetAccessClosed
        - SandboxInternetAccessOpen
        - SandboxInternetAccessRestricted
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Bearer token authentication. Provide your API token prefixed with
        "Bearer ", e.g. "Bearer your-api-token".
      in: header
      name: Authorization
      type: apiKey

````