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

# Delete a policy

> Deleting a policy detaches it from every project it governs, so it is conditional on the policy's `revision` the same way an edit is. Evaluations a past scan was gated by survive the delete — the scan-anchored verdict read does not join `policies`.



## OpenAPI

````yaml /api-reference/earnie/policies-openapi.json delete /v1/policies/{id}
openapi: 3.0.3
info:
  title: Earnie Policies API
  description: >-
    Author policies, attach them to projects, and read how projects, scans, and
    findings evaluate against them.
  version: 1.0.0
servers:
  - url: https://{tenant}.earnie.dev
    description: Your Earnie deployment
    variables:
      tenant:
        default: your-company
        description: >-
          Your organization's Earnie address, as shown in your browser when you
          sign in.
security:
  - bearerAuth: []
paths:
  /v1/policies/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
    delete:
      summary: Delete a policy
      description: >-
        Deleting a policy detaches it from every project it governs, so it is
        conditional on the policy's `revision` the same way an edit is.
        Evaluations a past scan was gated by survive the delete — the
        scan-anchored verdict read does not join `policies`.
      operationId: DeletePolicy
      parameters:
        - name: If-Match
          in: header
          required: true
          schema:
            type: string
          description: >-
            The policy `revision` the caller last read. Required: a policy
            mutation is never last-write-wins. Omitted → `428
            precondition_required`; no longer current → `409 policy_conflict`.


            The bare digest, its quoted form and its weak form all mean the same
            revision. `*` is refused with `409` rather than honoured as "any
            current representation", which would be exactly the unconditional
            write this exists to prevent. A comma-separated list of entity tags
            is refused with `400`: a policy has one current revision, so
            offering several is not meaningful here, and saying so beats
            answering `409` for a request that was not understood.
      responses:
        '204':
          description: Deleted
        '400':
          description: >-
            `invalid_request` — the request was not understood. Reaches this
            operation two ways, both about `If-Match`: a comma-separated list of
            entity tags, which a policy's single current revision makes
            meaningless here, and the header sent more than once. Distinct from
            `428`, which is the header being absent, and from `409`, which is
            the header being understood and out of date.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            `policy_conflict` — the policy has moved on from the `If-Match`
            revision. Re-read the policy and reapply the change.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '428':
          description: '`precondition_required` — `If-Match` was not supplied.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An Earnie API key, sent as `Authorization: Bearer sk_earnie_...`. Create
        one under Settings > API keys. The key's scopes decide which operations
        it may call.

````

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