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

# Delete a network policy by slug or full reference. It must not be bound to any access token.

> Delete an S2 network policy by slug or full reference.

> [card] [Network policy concepts](https://s2.dev/docs/concepts/network-policies.md)
>
> Review how rules are evaluated, how tokens are bound, and how to debug denied requests.

> [!NOTE]
>
> A policy cannot be deleted while an access token is bound to it. The request fails with `network_policy_in_use`; revoke those tokens first.


## OpenAPI

````yaml delete /network-policies/{id}
openapi: 3.1.0
info:
  title: S2, the durable streams API
  description: Streams as a cloud storage primitive.
  termsOfService: https://s2.dev/terms
  contact:
    email: support@s2.dev
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://a.s2.dev/v1
security:
  - access_token: []
tags:
  - name: metrics
    description: Usage metrics and data.
  - name: basins
    description: Manage basins
  - name: access-tokens
    description: Manage access tokens
  - name: network-policies
    description: Manage network policies
  - name: locations
    description: Manage locations
  - name: streams
    description: Manage streams
  - name: records
    description: Manage records
paths:
  /network-policies/{id}:
    delete:
      tags:
        - network-policies
      summary: >-
        Delete a network policy by slug or full reference. It must not be bound
        to any access token.
      operationId: delete_network_policy
      parameters:
        - name: id
          in: path
          description: Network policy slug, or full `<slug>.<nonce>` reference.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '408':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
components:
  schemas:
    ErrorInfo:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    access_token:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your access token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.