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

# Create a fault

> Manually creates a new fault object. This is typically used for creating faults from external systems or for testing purposes. For automated ingestion, other microservices push events that are processed into faults.



## OpenAPI

````yaml /api/en/faults.yaml post /fault
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:
    post:
      tags:
        - Faults
      summary: Create a fault
      description: >-
        Manually creates a new fault object. This is typically used for creating
        faults from external systems or for testing purposes. For automated
        ingestion, other microservices push events that are processed into
        faults.
      operationId: createFault
      requestBody:
        description: The details of the fault to create.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFaultRequest'
      responses:
        '201':
          description: The newly created fault object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Fault'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    CreateFaultRequest:
      type: object
      required:
        - resource_id
        - microservice_id
        - type
        - severity
        - message
        - cause
      properties:
        resource_id:
          type: string
          description: The unique identifier of the resource experiencing the fault.
          example: dev_2j4k2l2j3k4l2j3k4
        microservice_id:
          type: string
          description: The identifier of the microservice reporting the fault.
          example: manual-api-entry
        type:
          type: string
          description: A slug-style category for the fault.
          example: wan-degradation
        severity:
          type: string
          description: The severity level of the fault.
          enum:
            - LOW
            - MEDIUM
            - HIGH
            - CRITICAL
            - WARNING
          example: HIGH
        message:
          type: string
          description: A concise, human-readable summary of the fault.
          example: 'WAN link latency high: Primary link (WAN1) latency is elevated'
        cause:
          type: string
          description: A detailed explanation of the probable cause.
          example: Latency probe exceeded 250ms for 5 consecutive checks.
        resource_ancestry_path:
          type: string
          description: Optional. A pipe-delimited `|` string for hierarchical context.
          example: site_8a7b6c5d4e3f2g1h|dev_2j4k2l2j3k4l2j3k4
    Fault:
      type: object
      description: >-
        The `Fault` object represents a detected issue or event within the
        network.
      properties:
        id:
          type: string
          description: A unique identifier for the fault object, prefixed with `flt_`.
          example: flt_31pkd1t8FvW7qZv0jG2a9kH5mB1
        resource_id:
          type: string
          description: The unique identifier of the resource that experienced the fault.
          example: dev_2j4k2l2j3k4l2j3k4
        customer_id:
          type: string
          description: The unique identifier of the customer account this fault belongs to.
          example: cus_1i2j3k4l5m6n7o8p
        microservice_id:
          type: string
          description: The identifier of the microservice that reported the fault.
          example: wantunnel-monitor
        type:
          type: string
          description: The category or type of the fault.
          example: wantunnel
        status:
          type: string
          description: The current status of the fault.
          enum:
            - unresolved
            - resolved
          example: unresolved
        severity:
          type: string
          description: The severity level of the fault.
          enum:
            - LOW
            - MEDIUM
            - HIGH
            - CRITICAL
            - WARNING
          example: CRITICAL
        message:
          type: string
          description: A concise, human-readable summary of the fault.
          example: 'WAN link failover: Primary link (WAN1) is down'
        cause:
          type: string
          description: A detailed explanation of the probable cause of the fault.
          example: 'Probe failed: Latency exceeded 500ms threshold'
        created_at:
          type: string
          format: date-time
          description: The timestamp when the fault was first detected and created.
          example: '2025-10-21T12:00:00.000000Z'
        resolved_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            The timestamp when the fault was resolved. Null if the fault is
            still active.
          example: null
        resource_ancestry_path:
          type: string
          nullable: true
          description: >-
            A pipe-delimited `|` string representing the hierarchical location
            of the resource, used for filtering faults by a parent resource
            (e.g., a specific site).
          example: site_8a7b6c5d4e3f2g1h|dev_2j4k2l2j3k4l2j3k4
        ttl:
          type: integer
          nullable: true
          description: >-
            A Unix timestamp indicating when the fault record will automatically
            expire from the database.
          example: 1797825595
        comments:
          type: array
          description: >-
            A list of comments associated with the fault, ordered from oldest to
            newest.
          items:
            $ref: '#/components/schemas/Comment'
    Comment:
      type: object
      description: A comment added to a fault object.
      properties:
        user_id:
          type: string
          description: The unique identifier of the user who added the comment.
          example: user_a1b2c3d4e5f6g7h8
        comment:
          type: string
          description: The text content of the comment.
          example: Contacted ISP, they are investigating a local outage.
        created_at:
          type: string
          format: date-time
          description: The timestamp when the comment was created.
          example: '2025-10-21T12:05:30.000000Z'
    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:
    BadRequest:
      description: Bad Request - The request was malformed or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: invalid_request_error
            code: parameter_missing
            message: The 'message' parameter is required for this request.
            doc_url: https://docs.altostrat.io/errors/parameter_missing
    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
    Forbidden:
      description: Forbidden - The API key does not have permission to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            type: permission_error
            code: permission_denied
            message: You do not have the required scope to perform this action.
            doc_url: https://docs.altostrat.io/errors/permission_denied
    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.

````