> ## 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.

# List Alerts

> List the alerts in the caller's project (oldest first) with its capacity.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/public/alerts
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:
    get:
      tags:
        - Alerts
      summary: List Alerts
      description: >-
        List the alerts in the caller's project (oldest first) with its
        capacity.
      operationId: list_alerts
      parameters:
        - description: Items per page
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: Items per page
            maximum: 200
            minimum: 1
            title: Limit
            type: integer
        - description: 0-based page index
          in: query
          name: page
          required: false
          schema:
            default: 0
            description: 0-based page index
            maximum: 10000
            minimum: 0
            title: Page
            type: integer
        - description: Case-insensitive substring match on the alert name
          in: query
          name: search_query
          required: false
          schema:
            anyOf:
              - maxLength: 200
                type: string
              - type: 'null'
            description: Case-insensitive substring match on the alert name
            title: Search Query
        - description: >-
            Target project for the request. Required when authenticating with a
            user session token (a user credential is only meaningful scoped to a
            project); for an API key it is optional and, if given, must match
            the key's project.
          in: query
          name: project_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Target project for the request. Required when authenticating with
              a user session token (a user credential is only meaningful scoped
              to a project); for an API key it is optional and, if given, must
              match the key's project.
            title: Project Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAlertListResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    PublicAlertListResponse:
      description: Paginated list of the project's alerts for the public API.
      properties:
        data:
          items:
            $ref: '#/components/schemas/AlertSummary'
          title: Data
          type: array
        meta:
          $ref: '#/components/schemas/AlertListMeta'
      required:
        - data
        - meta
      title: PublicAlertListResponse
      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
    AlertSummary:
      description: >-
        The alert fields shared by the list and detail reads (Postgres
        ``alerts``).


        ``threshold`` is stored as a decimal and served as a JSON number.

        ``creator`` is the created-by user's display name (or email), resolved
        by

        the internal route; it is None when the creating account was deleted.
      properties:
        aggregation:
          title: Aggregation
          type: string
        alerted_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Alerted At
        create_time:
          format: date-time
          title: Create Time
          type: string
        creator:
          anyOf:
            - type: string
            - type: 'null'
          title: Creator
        id:
          title: Id
          type: string
        last_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error
        last_error_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Error At
        last_evaluated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Evaluated At
        last_notify_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Notify At
        last_notify_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Notify Error
        last_notify_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Notify Status
        measure:
          title: Measure
          type: string
        name:
          title: Name
          type: string
        severity:
          title: Severity
          type: string
        severity_changed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Severity Changed At
        status:
          title: Status
          type: string
        threshold:
          title: Threshold
          type: number
        threshold_operator:
          title: Threshold Operator
          type: string
        update_time:
          format: date-time
          title: Update Time
          type: string
        view:
          title: View
          type: string
        window:
          title: Window
          type: string
      required:
        - id
        - name
        - view
        - measure
        - aggregation
        - window
        - threshold_operator
        - threshold
        - status
        - severity
        - severity_changed_at
        - alerted_at
        - last_evaluated_at
        - last_error
        - last_error_at
        - last_notify_status
        - last_notify_error
        - last_notify_at
        - create_time
        - update_time
        - creator
      title: AlertSummary
      type: object
    AlertListMeta:
      description: Pagination plus the project's alert capacity.
      properties:
        capacity:
          $ref: '#/components/schemas/AlertCapacity'
        limit:
          title: Limit
          type: integer
        page:
          title: Page
          type: integer
        total:
          title: Total
          type: integer
      required:
        - page
        - limit
        - total
        - capacity
      title: AlertListMeta
      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
    AlertCapacity:
      description: How many alerts the project holds against its per-project cap.
      properties:
        max:
          title: Max
          type: integer
        used:
          title: Used
          type: integer
      required:
        - used
        - max
      title: AlertCapacity
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

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