> ## 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 history



## OpenAPI

````yaml /api-reference/openapi.json get /v2/entities/{id}/history
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}/history:
    get:
      tags:
        - entities
      summary: Get entity history
      operationId: entities_get_history
      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/EntityHistoryOutput'
components:
  schemas:
    EntityHistoryOutput:
      type: object
      properties:
        object:
          type: string
          description: Object type identifier
          default: list
        results:
          type: array
          description: Array of results for current page
          items:
            oneOf:
              - $ref: '#/components/schemas/EntityHistoryCompanyRecordOutput'
              - $ref: '#/components/schemas/EntityHistoryPersonRecordOutput'
            discriminator:
              propertyName: object
              mapping:
                company:
                  $ref: '#/components/schemas/EntityHistoryCompanyRecordOutput'
                person:
                  $ref: '#/components/schemas/EntityHistoryPersonRecordOutput'
        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
    EntityHistoryCompanyRecordOutput:
      type: object
      properties:
        sourceDataset:
          type: string
          example: quod
        observedAt:
          type: string
          example: '2026-05-08T12:30:00.000Z'
        object:
          type: string
          enum:
            - company
          example: company
        currentName:
          type: string
          nullable: true
          example: BIGDATACORP S.A.
        age:
          type: number
          nullable: true
          example: 18
        totalChanges:
          type: number
          nullable: true
          example: 12
        nameTotalChanges:
          type: number
          nullable: true
          example: 2
        taxRegimeTotalChanges:
          type: number
          nullable: true
          example: 3
        taxIdStatusTotalChanges:
          type: number
          nullable: true
          example: 1
        headquarterTotalChanges:
          type: number
          nullable: true
          example: 0
        cnaeTotalChanges:
          type: number
          nullable: true
          example: 6
        capitalTotalChanges:
          type: number
          nullable: true
          example: 3
        lastDateChanged:
          type: string
          nullable: true
          example: '2023-04-01T00:00:00Z'
        lastNameChanged:
          type: string
          nullable: true
          example: '2022-02-01T00:00:00Z'
        lastLegalNatureChanged:
          type: string
          nullable: true
          example: '2020-07-01T00:00:00Z'
        nameHistory:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryCompanyNameEntryOutput'
        taxRegimeHistory:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryCompanyTaxRegimeEntryOutput'
        taxIdStatusHistory:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryCompanyTaxIdStatusEntryOutput'
        cnaeHistory:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryCompanyCnaeEntryOutput'
        capitalHistory:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryCompanyCapitalEntryOutput'
      required:
        - sourceDataset
        - observedAt
        - object
        - nameHistory
        - taxRegimeHistory
        - taxIdStatusHistory
        - cnaeHistory
        - capitalHistory
    EntityHistoryPersonRecordOutput:
      type: object
      properties:
        sourceDataset:
          type: string
          example: quod
        observedAt:
          type: string
          example: '2026-05-08T12:30:00.000Z'
        object:
          type: string
          enum:
            - person
          example: person
        currentName:
          type: string
          nullable: true
          example: MARCO AURELIO DA SILVA
        currentStatus:
          type: string
          nullable: true
          example: REGULAR
        currentGender:
          type: string
          nullable: true
          example: M
        birthDate:
          type: string
          nullable: true
          example: '1996-02-13T00:00:00Z'
        age:
          type: number
          nullable: true
          example: 29
        taxIdNumber:
          type: string
          nullable: true
          example: '15500000713'
        hasObitIndication:
          type: boolean
          nullable: true
          example: false
        nameChangesTotal:
          type: number
          nullable: true
          example: 0
        statusChangesTotal:
          type: number
          nullable: true
          example: 0
        firstNameChangeDate:
          type: string
          nullable: true
          example: '2014-02-13T00:00:00Z'
        lastNameChangeDate:
          type: string
          nullable: true
          example: '2014-02-13T00:00:00Z'
        firstStatusChangeDate:
          type: string
          nullable: true
          example: '2014-02-13T00:00:00Z'
        lastStatusChangeDate:
          type: string
          nullable: true
          example: '2014-02-13T00:00:00Z'
        nameChanges:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryNameChangeOutput'
        statusChanges:
          type: array
          items:
            $ref: '#/components/schemas/EntityHistoryStatusChangeOutput'
      required:
        - sourceDataset
        - observedAt
        - object
        - nameChanges
        - statusChanges
    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
    EntityHistoryCompanyNameEntryOutput:
      type: object
      properties:
        changeDate:
          type: string
          nullable: true
          example: '2020-07-01T00:00:00Z'
        name:
          type: string
          nullable: true
          example: BIGDATACORP S.A.
        officialName:
          type: string
          nullable: true
          example: BIGDATACORP S.A.
        tradeName:
          type: string
          nullable: true
          example: BIGDATACORP
    EntityHistoryCompanyTaxRegimeEntryOutput:
      type: object
      properties:
        changeDate:
          type: string
          nullable: true
          example: '2022-02-01T00:00:00Z'
        taxRegime:
          type: string
          nullable: true
          example: LUCRO REAL
    EntityHistoryCompanyTaxIdStatusEntryOutput:
      type: object
      properties:
        changeDate:
          type: string
          nullable: true
          example: '2020-07-01T00:00:00Z'
        taxIdStatus:
          type: string
          nullable: true
          example: ATIVA
    EntityHistoryCompanyCnaeEntryOutput:
      type: object
      properties:
        changeDate:
          type: string
          nullable: true
          example: '2023-04-01T00:00:00Z'
        code:
          type: string
          nullable: true
          example: '6201501'
        activity:
          type: string
          nullable: true
          example: DESENVOLVIMENTO DE PROGRAMAS DE COMPUTADOR SOB ENCOMENDA
        docNumber:
          type: string
          nullable: true
          example: ''
        economicActivityDivision:
          type: string
          nullable: true
          example: ATIVIDADES DOS SERVICOS DE TECNOLOGIA DA INFORMACAO
        economicActivityGroup:
          type: string
          nullable: true
          example: ATIVIDADES DOS SERVICOS DE TECNOLOGIA DA INFORMACAO
        isMainEconomicActivity:
          type: boolean
          nullable: true
          example: true
    EntityHistoryCompanyCapitalEntryOutput:
      type: object
      properties:
        changeDate:
          type: string
          nullable: true
          example: '2024-11-01T00:00:00Z'
        capital:
          type: string
          nullable: true
          example: '8385000.00'
    EntityHistoryNameChangeOutput:
      type: object
      properties:
        changedDate:
          type: string
          nullable: true
          example: '2014-02-13T00:00:00Z'
        name:
          type: string
          nullable: true
          example: MARCO AURELIO DA SILVA
        gender:
          type: string
          nullable: true
          example: M
    EntityHistoryStatusChangeOutput:
      type: object
      properties:
        changedDate:
          type: string
          nullable: true
          example: '2014-02-13T00:00:00Z'
        status:
          type: string
          nullable: true
          example: REGULAR
    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

````