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

# Consultar Status da Diligência

> Retorna o estado atual do processamento de uma diligência



## OpenAPI

````yaml GET /diligences/{id}/status
openapi: 3.0.3
info:
  title: DiHub API
  description: API para acessar as funcionalidades da plataforma DiHub
  version: 1.0.0
  contact:
    name: Suporte DiHub
    email: claudiolima@dihub.com.br
servers:
  - url: https://api.dihub.com.br
    description: Produção
  - url: https://homolog.api.dihubapp.com
    description: Homologação
security: []
tags:
  - name: Créditos
    description: Gestão de saldo de créditos
  - name: Diligências
    description: Emissão de diligências e gestão de certidões
paths:
  /diligences/{id}/status:
    get:
      tags:
        - Diligências
      summary: Check diligence status
      description: >-
        Returns the current status of a diligence, including subject info,
        progress (finished/total certificates), and whether it includes credit
        analysis
      operationId: getDiligenceStatus
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Diligence ID
      responses:
        '200':
          description: Diligence status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiligenceStatusResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: Diligence not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                message: Diligence not found
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DiligenceStatusResponse:
      type: object
      properties:
        id:
          type: string
          description: Diligence ID
        subject:
          type: object
          properties:
            name:
              type: string
            document:
              type: string
              description: Obfuscated document number
        state:
          type: string
          description: State (UF) or combination e.g. MG/SP
        comarca:
          type: string
          description: District/court name
        status:
          type: object
          properties:
            label:
              type: string
              enum:
                - Concluída
                - Em andamento
                - Falha
            finishedCertificates:
              type: integer
            totalCertificates:
              type: integer
        emissionDate:
          type: string
          format: date-time
        haveAnalysisOfCredit:
          type: boolean
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Mensagem de erro
          example: Validation Error
        details:
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                  message:
                    type: string
            - type: object
  responses:
    UnauthorizedError:
      description: Credenciais de autenticação ausentes ou inválidas
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Unauthorized
    InternalServerError:
      description: Erro interno do servidor
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            message: Internal Server Error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Token
      description: Chave de API para autenticação. Envie o token no header X-Api-Token.

````