> ## 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 bankruptcy restrictions



## OpenAPI

````yaml /api-reference/openapi.json get /v2/entities/{id}/bankruptcy
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}/bankruptcy:
    get:
      tags:
        - entities
      summary: Get entity bankruptcy restrictions
      operationId: entities_get_bankruptcy
      parameters:
        - name: id
          required: true
          in: path
          description: CPF, CNPJ, or company id (cmp_*)
          schema:
            type: string
        - 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/EntityRestrictionRecordsOutput'
components:
  schemas:
    EntityRestrictionRecordsOutput:
      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/CompanyRestrictionRecordsOutput'
        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
    CompanyRestrictionRecordsOutput:
      type: object
      properties:
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRestrictionDatasetOutput'
        summaryRow:
          $ref: '#/components/schemas/CompanyRestrictionSummaryRowOutput'
        section:
          $ref: '#/components/schemas/CompanyRestrictionRecordSectionOutput'
      required:
        - datasets
        - summaryRow
        - section
    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
    CompanyRestrictionDatasetOutput:
      type: object
      properties:
        slug:
          type: string
        name:
          type: string
          nullable: true
        queryId:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          nullable: true
        cacheStatus:
          type: string
          nullable: true
        cost:
          type: number
          nullable: true
        recordCount:
          type: number
        hasData:
          type: boolean
        description:
          type: string
          nullable: true
        score:
          type: number
          nullable: true
        riskLabel:
          type: string
          nullable: true
        kpis:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRestrictionDatasetKpiOutput'
      required:
        - slug
        - recordCount
        - hasData
        - kpis
    CompanyRestrictionSummaryRowOutput:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        cells:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRestrictionSummaryCellOutput'
      required:
        - key
        - label
        - cells
    CompanyRestrictionRecordSectionOutput:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        records:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRestrictionProtestOutput'
      required:
        - key
        - label
        - records
    EntityDomainProvenanceOutput:
      type: object
      properties:
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/EntityDatasetProvenanceOutput'
      required:
        - datasets
    CompanyRestrictionDatasetKpiOutput:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        amount:
          type: number
          nullable: true
        count:
          type: number
          nullable: true
      required:
        - key
        - label
    CompanyRestrictionSummaryCellOutput:
      type: object
      properties:
        datasetSlug:
          type: string
        applies:
          type: boolean
        confirmed:
          type: boolean
        count:
          type: number
          nullable: true
        amount:
          type: number
          nullable: true
        description:
          type: string
          nullable: true
      required:
        - datasetSlug
        - applies
        - confirmed
    CompanyRestrictionProtestOutput:
      type: object
      properties:
        key:
          type: string
        category:
          type: string
        date:
          type: string
          nullable: true
        dueDate:
          type: string
          nullable: true
        value:
          type: number
          nullable: true
        creditor:
          type: string
          nullable: true
        institution:
          type: string
          nullable: true
        contract:
          type: string
          nullable: true
        modality:
          type: string
          nullable: true
        document:
          type: string
          nullable: true
        notary:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        origin:
          type: string
          nullable: true
        maturity:
          type: string
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRestrictionSourceOutput'
        sourceRecords:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRestrictionSourceRecordOutput'
      required:
        - key
        - category
        - sources
        - sourceRecords
    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
    CompanyRestrictionSourceOutput:
      type: object
      properties:
        slug:
          type: string
        label:
          type: string
        queryId:
          type: string
          nullable: true
      required:
        - slug
        - label
    CompanyRestrictionSourceRecordOutput:
      type: object
      properties:
        key:
          type: string
        category:
          type: string
        date:
          type: string
          nullable: true
        dueDate:
          type: string
          nullable: true
        value:
          type: number
          nullable: true
        creditor:
          type: string
          nullable: true
        institution:
          type: string
          nullable: true
        contract:
          type: string
          nullable: true
        modality:
          type: string
          nullable: true
        document:
          type: string
          nullable: true
        notary:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        origin:
          type: string
          nullable: true
        maturity:
          type: string
          nullable: true
        source:
          $ref: '#/components/schemas/CompanyRestrictionSourceOutput'
      required:
        - key
        - category
        - source
  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

````