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

# Get entity government debt source snapshots



## OpenAPI

````yaml /api-reference/openapi.json get /v2/entities/{id}/government-debtors
openapi: 3.1.0
info:
  title: Base39 API
  description: Base39 API
  version: 1.0.0
  contact:
    name: Base39 Team
    url: https://base39.com.br
    email: suporte@base39.com.br
  termsOfService: https://base39.com.br/termos
  license:
    name: Proprietary
    url: https://base39.com.br/termos
servers:
  - url: http://localhost:3000
    description: Local
  - url: https://api.dev.base39.cloud
    description: Development
  - url: https://api.base39.com.br
    description: Production
security:
  - OAuth2: []
tags:
  - name: pages
    description: Profiles and reports pages
  - name: pipelines
    description: Pipeline boards (kanban) of pages
  - name: blocks
    description: Blocks operations
  - name: search
    description: Search across content
  - name: targets
    description: Lookup targets via datasets
  - name: CognitoTriggers
    description: Cognito triggers
paths:
  /v2/entities/{id}/government-debtors:
    get:
      tags:
        - entities
      summary: Get entity government debt source snapshots
      operationId: entities_get_government_debtors
      parameters:
        - name: id
          required: true
          in: path
          description: CPF, CNPJ, or company id (cmp_*)
          schema:
            type: string
        - name: page_size
          required: false
          in: query
          description: Maximum number of domain snapshots to return
          schema:
            type: number
        - name: asOf
          required: false
          in: query
          description: Data de referência (YYYY-MM-DD)
          schema:
            type: string
        - name: fields
          required: false
          in: query
          description: >-
            Comma-separated optional response fields. Supports "summary.short",
            "summary.long", and "summary.mdx". Without summary.* the
            metadata.summary field is omitted.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntityGovernmentDebtorsOutput'
components:
  schemas:
    EntityGovernmentDebtorsOutput:
      type: object
      properties:
        object:
          type: string
          description: Object type identifier
          default: list
        results:
          description: Array of results for current page
          type: array
          items:
            $ref: '#/components/schemas/EntityGovernmentDebtorRecordOutput'
        next_cursor:
          type: string
          description: Opaque cursor for next page. null if no more results.
          nullable: true
        has_more:
          type: boolean
          description: Whether more results exist beyond this page
        type:
          type: string
          description: Type of results (Notion-compatible)
        metadata:
          $ref: '#/components/schemas/EntityDomainMetadataOutput'
      required:
        - object
        - results
        - has_more
        - metadata
    EntityGovernmentDebtorRecordOutput:
      type: object
      properties:
        sourceDataset:
          type: string
          example: quod
        observedAt:
          type: string
          example: '2026-05-08T12:30:00.000Z'
        debtorName:
          type: string
          nullable: true
          example: MOZ***************LHO
        totalDebtValue:
          type: number
          nullable: true
          example: 73001830
        totalDebts:
          type: number
          nullable: true
          example: 76
        totalDebtValuePerOrigin:
          type: object
          additionalProperties:
            type: number
          example:
            SIDA: 72420340
            PREVIDENCIA: 581496.2
        totalDebtsPerOrigin:
          type: object
          additionalProperties:
            type: number
          example:
            SIDA: 52
            PREVIDENCIA: 24
        debts:
          type: array
          items:
            $ref: '#/components/schemas/EntityGovernmentDebtItemOutput'
      required:
        - sourceDataset
        - observedAt
        - totalDebtValuePerOrigin
        - totalDebtsPerOrigin
        - debts
    EntityDomainMetadataOutput:
      type: object
      properties:
        status:
          type: string
          enum:
            - NOT_QUERIED
            - QUERY_SUCCEEDED
            - QUERY_OUTDATED
            - QUERY_FAILED
            - QUERY_PARTIALLY_SUCCEEDED
        summary:
          description: >-
            Rendered domain summary markdown or MDX when requested via
            ?fields=summary.short, summary.long, and/or summary.mdx. Single
            format → string. Multiple formats → object { short, long, mdx }.
          oneOf:
            - type: string
            - type: object
              properties:
                short:
                  type: string
                long:
                  type: string
                mdx:
                  type: string
        provenance:
          $ref: '#/components/schemas/EntityDomainProvenanceOutput'
      required:
        - status
        - provenance
    EntityGovernmentDebtItemOutput:
      type: object
      properties:
        source:
          type: string
          nullable: true
          example: PGFN
        debtOrigin:
          type: string
          nullable: true
          example: SIDA
        consolidatedValue:
          type: number
          nullable: true
          example: 3427721.8
        debtorType:
          type: string
          nullable: true
          example: Principal
        responsibleUnity:
          type: string
          nullable: true
          example: ACRE
        responsibleUnityUF:
          type: string
          nullable: true
          example: AC
        registrationNumber:
          type: string
          nullable: true
          example: 221*******930
        registrationSituationType:
          type: string
          nullable: true
          example: Em cobrança
        registrationSituation:
          type: string
          nullable: true
          example: ATIVA AJUIZADA
        filedIndicator:
          type: boolean
          nullable: true
          example: true
        registrationDate:
          type: string
          nullable: true
          example: '2013-12-13T00:00:00Z'
        creationDate:
          type: string
          nullable: true
          example: '2023-07-13T15:21:39.342Z'
        lastUpdateDate:
          type: string
          nullable: true
          example: '2025-07-20T10:06:39.501Z'
    EntityDomainProvenanceOutput:
      type: object
      properties:
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/EntityDatasetProvenanceOutput'
      required:
        - datasets
    EntityDatasetProvenanceOutput:
      type: object
      properties:
        queryId:
          type: string
          nullable: true
        datasetSlug:
          type: string
        requirement:
          type: string
          enum:
            - required
            - optional
        visible:
          type: boolean
        onRefresh:
          type: boolean
        sourcePriority:
          type: number
        observedAt:
          type: string
          nullable: true
        recordedAt:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - NOT_QUERIED
            - QUERY_SUCCEEDED
            - QUERY_OUTDATED
            - QUERY_FAILED
            - QUERY_PARTIALLY_SUCCEEDED
        errorCode:
          type: string
          enum:
            - upstream_error
            - upstream_unauthorized
            - upstream_not_found
            - upstream_rate_limit
            - upstream_invalid_request
            - upstream_unavailable
            - upstream_timeout
            - upstream_invalid_response
            - mock_response_missing
            - provider_execution_failed
            - query_persistence_failed
            - workflow_failed
          nullable: true
      required:
        - datasetSlug
        - requirement
        - visible
        - onRefresh
        - sourcePriority
        - status
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://id.local.base39.cloud/oauth2/authorize
          tokenUrl: https://id.local.base39.cloud/oauth2/token
          scopes:
            profile: Read user profile
            email: Read user email
            openid: OpenID authentication
      description: OAuth2 Authorization Code flow

````