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

# Delete an alert

> Hard-delete an alert.

Requires MEMBER role or higher in the project's workspace (the write
service decides). An outstanding page is discarded, not resolved: the
response reports ``page_cleared`` when one was open.

Args:
    request (Request): Incoming request (rate-limit plumbing).
    response (Response): Outgoing response (rate-limit plumbing).
    auth (AccountStampedAuth): Account-scope user auth (session token or
        CLI access JWT); its resolved ``user_id`` becomes the actor.
    alert_id (str): The alert to delete.
    project_id (str): The project the alert belongs to.
    reason (str): Why it is being deleted; recorded on the audit row.
    _live (None): Write-path liveness gate (blocks a revoked JWT session).

Returns:
    DeleteAlertResponse: The removed alert and whether a page was cleared.

Raises:
    HTTPException: The write service's 400/403/404 verbatim, or a 503
        when its response is ambiguous.



## OpenAPI

````yaml /api-reference/openapi.json delete /api/v1/public/alerts/{alert_id}
openapi: 3.1.0
info:
  title: TraceRoot Public API
  version: 0.1.0
servers:
  - description: TraceRoot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your TraceRoot backend URL
security: []
paths:
  /api/v1/public/alerts/{alert_id}:
    delete:
      tags:
        - Alerts
      summary: Delete an alert
      description: |-
        Hard-delete an alert.

        Requires MEMBER role or higher in the project's workspace (the write
        service decides). An outstanding page is discarded, not resolved: the
        response reports ``page_cleared`` when one was open.

        Args:
            request (Request): Incoming request (rate-limit plumbing).
            response (Response): Outgoing response (rate-limit plumbing).
            auth (AccountStampedAuth): Account-scope user auth (session token or
                CLI access JWT); its resolved ``user_id`` becomes the actor.
            alert_id (str): The alert to delete.
            project_id (str): The project the alert belongs to.
            reason (str): Why it is being deleted; recorded on the audit row.
            _live (None): Write-path liveness gate (blocks a revoked JWT session).

        Returns:
            DeleteAlertResponse: The removed alert and whether a page was cleared.

        Raises:
            HTTPException: The write service's 400/403/404 verbatim, or a 503
                when its response is ambiguous.
      operationId: delete_alert
      parameters:
        - in: path
          name: alert_id
          required: true
          schema:
            title: Alert Id
            type: string
        - description: The project the resource belongs to
          in: query
          name: project_id
          required: true
          schema:
            description: The project the resource belongs to
            title: Project Id
            type: string
        - description: Why the resource is being deleted; recorded on the audit row
          in: query
          name: reason
          required: true
          schema:
            description: Why the resource is being deleted; recorded on the audit row
            maxLength: 500
            minLength: 3
            title: Reason
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteAlertResponse'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed or session revoked
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Insufficient role or wrong credential kind
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Write service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    DeleteAlertResponse:
      description: >-
        A hard-deleted alert; ``page_cleared`` reports an open page it
        discarded.
      properties:
        alert:
          $ref: '#/components/schemas/DeletedResource'
        deleted:
          title: Deleted
          type: boolean
        page_cleared:
          default: false
          title: Page Cleared
          type: boolean
        reason:
          title: Reason
          type: string
      required:
        - deleted
        - reason
        - alert
      title: DeleteAlertResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DeletedResource:
      description: 'What a delete removed: the row''s id and name, for the receipt.'
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
      required:
        - id
        - name
      title: DeletedResource
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

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