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

# Diagnose

> Ask the platform agent to diagnose a failed deployment. The diagnosis is cached after the first call; only failed deployments are diagnosable.



## OpenAPI

````yaml /openapi.json post /v1/orgs/{orgId}/projects/{projectId}/deploys/{deployId}/diagnosis
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/orgs/{orgId}/projects/{projectId}/deploys/{deployId}/diagnosis:
    post:
      tags:
        - deploys
      summary: Diagnose
      description: >-
        Ask the platform agent to diagnose a failed deployment. The diagnosis is
        cached after the first call; only failed deployments are diagnosable.
      operationId: deploys.diagnose
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          description: The organization's id (UUID) or slug — either form is accepted.
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: The project's id (UUID) or slug — either form is accepted.
        - name: deployId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The diagnosis — freshly produced or served from the cache.
          content:
            application/json:
              schema:
                type: object
                properties:
                  diagnosis:
                    type: object
                    description: >-
                      Structured failure diagnosis produced by the platform
                      agent.
                    properties:
                      summary:
                        type: string
                        description: >-
                          1-2 sentence plain-language explanation of what went
                          wrong.
                      probableCause:
                        type: string
                      suggestedFix:
                        type: object
                        properties:
                          kind:
                            type: string
                            enum:
                              - env
                              - code
                              - config
                              - retry
                          title:
                            type: string
                          detail:
                            type: string
                          commands:
                            type: array
                            items:
                              type: string
                            description: Optional shell commands to apply the fix.
                        required:
                          - kind
                          - title
                          - detail
                      confidence:
                        type: string
                        enum:
                          - low
                          - medium
                          - high
                    required:
                      - summary
                      - probableCause
                      - suggestedFix
                      - confidence
                  cached:
                    type: boolean
                    description: True when a previously stored diagnosis was returned.
                required:
                  - diagnosis
                  - cached
        '402':
          description: Organization billing is not active.
        '404':
          description: No such deployment in this project.
        '409':
          description: The deployment did not fail, so there is nothing to diagnose.
        '502':
          description: The platform agent could not analyze this deploy — try again.
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````