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

# List created entities, queries and pages



## OpenAPI

````yaml /api-reference/openapi.json get /v2/activities
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/activities:
    get:
      tags:
        - activities
      summary: List created entities, queries and pages
      operationId: activities_list
      parameters:
        - name: expand
          required: false
          in: query
          description: Comma-separated fields to expand. Supports "org".
          schema:
            example: org
            type: string
        - name: page_size
          required: false
          in: query
          description: Number of items to return per page
          schema:
            minimum: 1
            maximum: 100
            default: 50
            example: 50
            type: number
        - name: start_cursor
          required: false
          in: query
          description: >-
            Opaque cursor for pagination. Use the next_cursor from previous
            response.
          schema:
            example: >-
              eyJjcmVhdGVkX3RpbWUiOiIyMDI0LTExLTE1VDEwOjAwOjAwLjAwMFoiLCJpZCI6InBhZ2VfYWJjMTIzIn0=
            type: string
        - name: user
          required: false
          in: query
          description: Filter by creator user ID
          schema:
            type: string
        - name: search
          required: false
          in: query
          description: Search by entity document or entity name
          schema:
            type: string
        - name: type
          required: false
          in: query
          description: Filter by activity type
          schema:
            type: string
            enum:
              - all
              - entity
              - query
              - page
        - name: date_from
          required: false
          in: query
          description: Filter by creation date from (YYYY-MM-DD)
          schema:
            type: string
        - name: date_to
          required: false
          in: query
          description: Filter by creation date to (YYYY-MM-DD)
          schema:
            type: string
        - name: group_by
          required: false
          in: query
          description: >-
            Group activities by entity. "document" yields one row per
            creator/day/document (page_size counts groups). "company" aggregates
            one feed item per entity across all creators/dates, embedding
            userIds and recent consultas.
          schema:
            example: document
            type: string
            enum:
              - document
              - company
      responses:
        '200':
          description: Paginated activities feed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivitiesListOutput'
components:
  schemas:
    ActivitiesListOutput:
      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/ActivityItemOutput'
        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)
      required:
        - object
        - results
        - has_more
    ActivityItemOutput:
      type: object
      properties:
        object:
          type: string
          enum:
            - activity
        id:
          type: string
        type:
          type: string
          enum:
            - entity
            - query
            - page
        sourceId:
          type: string
        orgId:
          type: string
        org:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActivityOrgOutput'
        title:
          type: string
        detail:
          type: string
        document:
          type: string
          nullable: true
        pageCompanyDocument:
          type: string
          nullable: true
        groupCount:
          type: number
          nullable: true
          description: Number of activities in this group when the list is grouped.
        params:
          type: object
          additionalProperties:
            type: string
          nullable: true
        target:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActivityTargetOutput'
        userIds:
          nullable: true
          description: >-
            Distinct creator user IDs in the group, ordered by recency. Set when
            group_by=company.
          type: array
          items:
            type: string
        consultas:
          nullable: true
          description: Recent consultas embedded in the group. Set when group_by=company.
          type: array
          items:
            $ref: '#/components/schemas/ActivityConsultaOutput'
        createdAt:
          type: string
          format: date-time
        createdBy:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActivityCreatedByOutput'
      required:
        - object
        - id
        - type
        - sourceId
        - orgId
        - title
        - detail
        - createdAt
    ActivityOrgOutput:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
      required:
        - id
        - name
        - slug
    ActivityTargetOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - company
            - person
        document:
          type: string
        name:
          type: string
        icon:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/IconOutput'
        sector:
          type: string
          nullable: true
          description: Main CNAE description (company sector).
        registrationStatus:
          type: string
          nullable: true
          enum:
            - nula
            - ativa
            - suspensa
            - inapta
            - baixada
          description: Receita Federal registration status (company only).
        addressCity:
          type: string
          nullable: true
        addressState:
          type: string
          nullable: true
        riskBand:
          type: string
          nullable: true
          description: >-
            Canonical credit risk band derived from the latest Serasa/Quod/Boa
            Vista bureau query (e.g. "Baixo risco").
      required:
        - type
        - document
        - name
    ActivityConsultaOutput:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - entity
            - query
            - page
        title:
          type: string
        detail:
          type: string
        status:
          type: string
          nullable: true
          enum:
            - ok
            - warn
            - alert
            - info
        agentName:
          type: string
          nullable: true
          description: Agent display name when the consulta is a page (type=page).
        icon:
          nullable: true
          description: Page icon when the consulta is a page (type=page).
          allOf:
            - $ref: '#/components/schemas/IconOutput'
        isWorkflowTask:
          type: boolean
          nullable: true
          description: Whether this query consulta is a workflow task run.
        createdAt:
          type: string
          format: date-time
        createdBy:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActivityCreatedByOutput'
      required:
        - id
        - type
        - title
        - detail
        - createdAt
    ActivityCreatedByOutput:
      type: object
      properties:
        object:
          type: string
          enum:
            - user
            - service_account
        id:
          type: string
      required:
        - object
        - id
    IconOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - emoji
            - external
            - file_upload
            - domain
            - file
            - lucide
            - dicebear
            - brand
        emoji:
          type: string
          example: page_icon
        external:
          $ref: '#/components/schemas/ExternalFileOutput'
        file_upload:
          $ref: '#/components/schemas/FileUploadOutput'
        domain:
          type: string
          example: acme.com
        file:
          $ref: '#/components/schemas/InternalFileOutput'
        lucide:
          type: string
          example: file-text
        brand:
          type: string
          example: github
          description: Simple Icons brand slug (logo and color resolved automatically)
        dicebear:
          $ref: '#/components/schemas/DicebearIconPayloadOutput'
        background:
          type: string
          enum:
            - blue
            - red
            - pattern-red
            - pattern-blue
            - pattern-red-1
            - pattern-red-2
            - pattern-red-3
            - pattern-blue-1
            - pattern-blue-2
            - pattern-blue-3
        empty:
          type: boolean
          example: true
        updatedBy:
          type: string
          example: dataset:empresas
    ExternalFileOutput:
      type: object
      properties:
        url:
          type: string
          example: https://example.com/image.jpg
      required:
        - url
    FileUploadOutput:
      type: object
      properties:
        id:
          type: string
          example: fu_abc123
      required:
        - id
    InternalFileOutput:
      type: object
      properties:
        url:
          type: string
          example: https://s3.amazonaws.com/...
        expiryTime:
          type: string
          example: '2024-01-15T10:30:00.000Z'
      required:
        - url
        - expiryTime
    DicebearIconPayloadOutput:
      type: object
      properties:
        style:
          type: string
          enum:
            - notionists-neutral
        seed:
          type: string
          example: 0256de50-f90c-49a8-81f0-3988b2b89d8d
        backgroundColor:
          type: string
          example: b6e3f4,b6e3f4
          description: Hex color(s), comma-separated for gradients
        options:
          $ref: '#/components/schemas/DicebearIconOptionsOutput'
      required:
        - style
        - seed
        - backgroundColor
    DicebearIconOptionsOutput:
      type: object
      properties:
        brows:
          type: string
        eyes:
          type: string
        glasses:
          type: string
        lips:
          type: string
        nose:
          type: string
        flip:
          type: boolean
        rotate:
          type: number
        scale:
          type: number
        radius:
          type: number
        size:
          type: number
        backgroundType:
          type: string
          enum:
            - solid
            - gradientLinear
        backgroundRotation:
          type: array
          items:
            type: number
        translateX:
          type: number
        translateY:
          type: number
        clip:
          type: boolean
        randomizeIds:
          type: boolean
  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

````