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

# Get top faulty resources

> Retrieves a list of the top 10 most frequently faulting resources over the last 14 days, along with a sample of their most recent fault events. This is useful for identifying problematic areas in your network.



## OpenAPI

````yaml /api/en/faults.yaml get /fault/top_faults
openapi: 3.0.3
info:
  title: Altostrat Faults API
  version: 1.0.0
  description: >-
    Query, resolve, and share SDX fault data through the public `/fault` gateway
    path. Use query parameters on `/fault` for site-specific and recent fault
    views.
servers:
  - url: https://v1.api.altostrat.io
    description: Production API Server
security:
  - BearerAuth: []
tags:
  - name: Faults
    description: Manage and retrieve fault records.
  - name: Comments
    description: Add comments to existing faults.
  - name: Analytics
    description: Access aggregated fault data and reports.
  - name: Access Tokens
    description: Generate temporary access tokens.
paths:
  /fault/top_faults:
    get:
      tags:
        - Analytics
      summary: Get top faulty resources
      description: >-
        Retrieves a list of the top 10 most frequently faulting resources over
        the last 14 days, along with a sample of their most recent fault events.
        This is useful for identifying problematic areas in your network.
      operationId: getTopFaults
      responses:
        '200':
          description: An array of the top faulty resources.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TopFaultsItem'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    TopFaultsItem:
      type: object
      description: An aggregated summary of a top faulting resource.
      properties:
        tunnel_name:
          type: string
          description: >-
            The display name of the resource, often extracted from the fault
            message.
          example: Primary link (WAN1)
        site_id:
          type: string
          nullable: true
          description: The identifier of the site this resource belongs to.
          example: site_8a7b6c5d4e3f2g1h
        count:
          type: integer
          description: >-
            The total number of faults recorded for this resource in the last 14
            days.
          example: 42
        resource_id:
          type: string
          description: The unique identifier of the resource.
          example: dev_2j4k2l2j3k4l2j3k4
        faults:
          type: array
          description: A sample of recent fault events for this resource.
          items:
            $ref: '#/components/schemas/RecentFault'
    RecentFault:
      type: object
      description: A fault object in a legacy format for backward compatibility.
      properties:
        id:
          type: string
          description: A unique identifier for the fault object.
          example: flt_31pkd1t8FvW7qZv0jG2a9kH5mB1
        message:
          type: string
          description: A concise summary of the fault.
          example: 'WAN link failover: Primary link (WAN1) is down'
        resolved_at:
          type: string
          format: date-time
          nullable: true
          description: The timestamp when the fault was resolved.
          example: null
        created_at:
          type: string
          format: date-time
          description: The timestamp when the fault was created.
          example: '2025-10-21T12:00:00.000000Z'
        duration:
          type: string
          description: A human-readable string representing the duration of the fault.
          example: 2 hours, 15 minutes
        severity:
          type: string
          description: The severity of the fault.
          example: error
        type:
          type: string
          description: The type of the fault.
          example: wantunnel
        cause:
          type: string
          description: The probable cause of the fault.
          example: 'Probe failed: Latency exceeded 500ms threshold'
        site_id:
          type: string
          nullable: true
          description: The identifier of the site this resource belongs to.
          example: site_8a7b6c5d4e3f2g1h
        resource_identifier:
          type: string
          description: The unique identifier of the resource.
          example: dev_2j4k2l2j3k4l2j3k4
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'resource_id' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
  responses:
    Unauthorized:
      description: Unauthorized - The API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: authentication_error
            code: api_key_invalid
            message: The provided API key is invalid.
            doc_url: https://docs.altostrat.io/errors/api_key_invalid
    ServerError:
      description: Internal Server Error - An unexpected error occurred on our servers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: api_error
            code: internal_server_error
            message: >-
              An internal error occurred. Please try again or contact support if
              the issue persists.
            doc_url: https://docs.altostrat.io/errors/internal_server_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        API requests are authenticated using a JSON Web Token (JWT) provided in
        the `Authorization` header.

````