> ## 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 a persisted company Source



## OpenAPI

````yaml /api-reference/openapi.json get /v2/sheets/sources/{sourceId}
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/sheets/sources/{sourceId}:
    get:
      tags:
        - sheets
      summary: Get a persisted company Source
      operationId: sheetsGetSource
      parameters:
        - name: sourceId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SheetSourceOutput'
components:
  schemas:
    SheetSourceOutput:
      type: object
      properties:
        id:
          type: string
        workbookId:
          type: string
        name:
          type: string
        kind:
          type: string
          enum:
            - receita_companies
        config:
          $ref: '#/components/schemas/SheetSourceConfigOutput'
        position:
          type: number
        importedCount:
          type: number
          description: >-
            Verified rows imported through currently linked destinations; not
            estimated matches or current table row count.
      required:
        - id
        - workbookId
        - name
        - kind
        - config
        - position
        - importedCount
    SheetSourceConfigOutput:
      type: object
      properties:
        query:
          type: string
        filters:
          $ref: '#/components/schemas/CompanyDiscoveryFiltersInput'
        resultLimit:
          type: number
      required:
        - resultLimit
    CompanyDiscoveryFiltersInput:
      type: object
      properties:
        root:
          $ref: '#/components/schemas/CompanyDiscoveryFilterGroupInput'
        matchMode:
          type: string
          enum:
            - all
            - any
          default: all
        mainCnae:
          description: 'CNAE principal: códigos com sete dígitos.'
          allOf:
            - $ref: '#/components/schemas/CompanyDiscoverySetInput'
        secondaryCnae:
          description: 'Qualquer CNAE secundário selecionado: códigos com sete dígitos.'
          allOf:
            - $ref: '#/components/schemas/CompanyDiscoverySetInput'
        companySize:
          description: 'Porte cadastral original da Receita: 00, 01, 03 ou 05.'
          allOf:
            - $ref: '#/components/schemas/CompanyDiscoverySetInput'
        states:
          $ref: '#/components/schemas/CompanyDiscoverySetInput'
        cities:
          $ref: '#/components/schemas/CompanyDiscoveryCitiesInput'
        legalNature:
          description: 'Natureza jurídica: código com quatro dígitos.'
          allOf:
            - $ref: '#/components/schemas/CompanyDiscoverySetInput'
        registrationStatus:
          description: 'Situação cadastral: 01, 02, 03, 04 ou 08.'
          allOf:
            - $ref: '#/components/schemas/CompanyDiscoverySetInput'
        capital:
          $ref: '#/components/schemas/CompanyDiscoveryCapitalInput'
        headquarters:
          type: boolean
    CompanyDiscoveryFilterGroupInput:
      type: object
      properties:
        id:
          type: string
          maxLength: 100
        matchMode:
          type: string
          enum:
            - all
            - any
          default: all
        disabled:
          type: boolean
        order:
          maxItems: 100
          type: array
          items:
            type: string
        rules:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/CompanyDiscoveryFilterRuleInput'
        groups:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/CompanyDiscoveryFilterGroupInput'
      required:
        - id
    CompanyDiscoverySetInput:
      type: object
      properties:
        operator:
          type: string
          enum:
            - is
            - is_not
            - is_empty
            - is_not_empty
            - greater_than
            - less_than
        include:
          maxItems: 100
          type: array
          items:
            type: string
        exclude:
          maxItems: 100
          type: array
          items:
            type: string
    CompanyDiscoveryCitiesInput:
      type: object
      properties:
        include:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/CompanyDiscoveryCityInput'
        exclude:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/CompanyDiscoveryCityInput'
    CompanyDiscoveryCapitalInput:
      type: object
      properties:
        include:
          $ref: '#/components/schemas/CompanyDiscoveryCapitalRangeInput'
        exclude:
          $ref: '#/components/schemas/CompanyDiscoveryCapitalRangeInput'
    CompanyDiscoveryFilterRuleInput:
      type: object
      properties:
        id:
          type: string
          maxLength: 100
        field:
          type: string
          enum:
            - mainCnae
            - secondaryCnae
            - companySize
            - states
            - cities
            - legalNature
            - registrationStatus
            - capital
            - headquarters
        disabled:
          type: boolean
        operator:
          type: string
          enum:
            - is
            - is_not
            - is_empty
            - is_not_empty
            - greater_than
            - less_than
        values:
          maxItems: 100
          type: array
          items:
            type: string
        cities:
          maxItems: 100
          type: array
          items:
            $ref: '#/components/schemas/CompanyDiscoveryCityInput'
        range:
          $ref: '#/components/schemas/CompanyDiscoveryCapitalRangeInput'
        booleanValue:
          type: boolean
      required:
        - id
        - field
    CompanyDiscoveryCityInput:
      type: object
      properties:
        state:
          type: string
          pattern: >-
            ^(AC|AL|AP|AM|BA|CE|DF|ES|GO|MA|MT|MS|MG|PA|PB|PR|PE|PI|RJ|RN|RS|RO|RR|SC|SP|SE|TO)$
        city:
          type: string
          maxLength: 100
      required:
        - state
        - city
    CompanyDiscoveryCapitalRangeInput:
      type: object
      properties:
        min:
          type: string
          description: Capital social em reais inteiros, sem centavos.
          pattern: ^[0-9]{1,19}$
        max:
          type: string
          description: Capital social em reais inteiros, sem centavos.
          pattern: ^[0-9]{1,19}$
  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

````