> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /analyze-incident

> Triggers an AI analysis of the provided incident data.
Uses the Gemini service if available, otherwise falls back to basic heuristics.



## OpenAPI

````yaml /specs/infrastructure.json post /analyze-incident
openapi: 3.1.0
info:
  title: resq-api
  description: ''
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  version: 0.1.0
servers: []
security: []
tags:
  - name: resq-backend
    description: ResQ Infrastructure API
  - name: auth
    description: Authentication endpoints
  - name: incidents
    description: Incident management endpoints
  - name: evidence
    description: Evidence management endpoints
  - name: blockchain
    description: Blockchain query endpoints
  - name: solana
    description: Solana program endpoints (PoD + airspace)
paths:
  /analyze-incident:
    post:
      tags:
        - resq-backend
      summary: POST /analyze-incident
      description: >-
        Triggers an AI analysis of the provided incident data.

        Uses the Gemini service if available, otherwise falls back to basic
        heuristics.
      operationId: analyze_incident
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyzeIncidentRequest'
        required: true
      responses:
        '200':
          description: Incident analyzed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisResponse'
        '500':
          description: Internal server error
components:
  schemas:
    AnalyzeIncidentRequest:
      type: object
      description: Request payload for analyzing an incident.
      properties:
        incident:
          description: The incident data to analyze.
        networkState:
          description: The current state of the network.
    AnalysisResponse:
      type: object
      description: Response payload containing incident analysis results.
      required:
        - status
        - incident
        - analysis
        - agents_used
        - fallback_active
        - timestamp
      properties:
        agents_used:
          type: array
          items:
            type: string
          description: List of AI agents used during analysis.
        analysis:
          $ref: '#/components/schemas/AnalysisDetails'
          description: Detailed analysis results.
        fallback_active:
          type: boolean
          description: Whether fallback logic was active during analysis.
        incident:
          description: The original incident data.
        status:
          type: string
          description: status of the analysis.
        timestamp:
          type: string
          description: ISO 8601 timestamp of the response.
    AnalysisDetails:
      type: object
      description: Detailed results of an incident analysis.
      required:
        - severity
        - should_report
        - confidence
        - reasoning
        - recommended_actions
      properties:
        confidence:
          type: number
          format: double
          description: Confidence score of the analysis (0.0 to 1.0).
        reasoning:
          type: string
          description: Reasoning behind the analysis results.
        recommended_actions:
          type: array
          items:
            type: string
          description: List of recommended actions to mitigate the incident.
        severity:
          type: string
          description: >-
            Severity level of the incident (e.g., "Critical", "High", "Medium",
            "Low").
        should_report:
          type: boolean
          description: Whether the incident should be reported to authorities.

````