> ## 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 and query pages

> List pages with optional filtering using Stripe-like query syntax.

**Filter Syntax:**
- Exact match: `field:"value"`
- Wildcards: `field:"prefix*"`, `field:"*suffix"`, `field:"*contains*"`
- Numeric: `field>100`, `field>=100`, `field<100`, `field<=100`
- Null check: `field:null`
- Negation: `-field:"value"`
- Boolean: `field1:"a" AND field2:"b"`, `field1:"a" OR field2:"b"`

**Examples:**
- `agent.agent_id:"agt_abc"` - Filter by agent
- `targets.company.document:"12345678000199"` - Filter by target company document
- `runSessionId:null` - Pages sem sessão de execução associada



## OpenAPI

````yaml /api-reference/openapi.json get /v2/pages
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/pages:
    get:
      tags:
        - pages
      summary: List and query pages
      description: >-
        List pages with optional filtering using Stripe-like query syntax.


        **Filter Syntax:**

        - Exact match: `field:"value"`

        - Wildcards: `field:"prefix*"`, `field:"*suffix"`, `field:"*contains*"`

        - Numeric: `field>100`, `field>=100`, `field<100`, `field<=100`

        - Null check: `field:null`

        - Negation: `-field:"value"`

        - Boolean: `field1:"a" AND field2:"b"`, `field1:"a" OR field2:"b"`


        **Examples:**

        - `agent.agent_id:"agt_abc"` - Filter by agent

        - `targets.company.document:"12345678000199"` - Filter by target company
        document

        - `runSessionId:null` - Pages sem sessão de execução associada
      operationId: page_find_all
      parameters:
        - name: expand
          required: false
          in: query
          description: >-
            Comma-separated fields to expand. Supports field selection, e.g.
            "targets.company", "targets.company[icon,tradeName]",
            "runSessionId.status", "runSessionId.userId" or "url".
          schema:
            example: createdBy
            type: string
        - name: page_size
          required: false
          in: query
          description: Number of items per page (default 100)
          schema:
            minimum: 1
            maximum: 100
            default: 100
            example: 100
            type: number
        - name: start_cursor
          required: false
          in: query
          description: Cursor for pagination
          schema:
            example: >-
              eyJjcmVhdGVkX3RpbWUiOiIyMDI0LTExLTE1VDEwOjAwOjAwLjAwMFoiLCJpZCI6InBhZ2VfYWJjMTIzIn0=
            type: string
        - name: filter
          required: false
          in: query
          description: Stripe-like search query
          schema:
            example: agent.type:"agent_id"
            type: string
        - name: sort
          required: false
          in: query
          description: >-
            Sort field and direction, e.g. "created_at:asc" or "created_at:desc"
            (default)
          schema:
            example: created_at:desc
            type: string
      responses:
        '200':
          description: List of pages
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: list
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Page'
                  next_cursor:
                    type: string
                    nullable: true
                  has_more:
                    type: boolean
                  type:
                    type: string
                required:
                  - object
                  - results
                  - has_more
components:
  schemas:
    Page:
      type: object
      properties:
        object:
          type: string
          example: page
          description: Object type
          title: Object
          x-locale-pt-br-title: Objeto
        id:
          type: string
          example: p_abc123
          description: Unique identifier
          title: ID
          x-locale-pt-br-title: ID
        createdAt:
          format: date-time
          type: string
          example: '2024-01-15T10:30:00.000Z'
          description: Creation timestamp
          title: Created at
          x-locale-pt-br-title: Criado em
        updatedAt:
          format: date-time
          type: string
          example: '2024-01-15T14:45:00.000Z'
          description: Last update timestamp
          title: Updated at
          x-locale-pt-br-title: Atualizado em
        createdBy:
          type: object
          example:
            object: user
            id: u_abc123
            apiKeyId: bsk_abc123
          description: Principal who created this object
          properties:
            object:
              type: string
              enum:
                - user
                - service_account
              example: user
            id:
              type: string
              example: u_abc123
            apiKeyId:
              type: string
              example: bsk_abc123
          title: Created by
          x-locale-pt-br-title: Criado por
        updatedBy:
          type: object
          example:
            object: user
            id: u_abc123
            apiKeyId: bsk_abc123
          description: Principal who last updated this object
          properties:
            object:
              type: string
              enum:
                - user
                - service_account
                - webhook
                - stream
              example: user
            id:
              type: string
              example: u_abc123
            apiKeyId:
              type: string
              example: bsk_abc123
          title: Updated by
          x-locale-pt-br-title: Atualizado por
        kind:
          type: string
          enum:
            - report
            - deal
          description: Object kind (report | deal).
        title:
          type: string
          description: Page title
          nullable: true
        icon:
          description: Page icon
          nullable: true
          allOf:
            - $ref: '#/components/schemas/IconOutput'
        agent:
          description: Agent reference
          oneOf:
            - $ref: '#/components/schemas/AgentRefNone'
            - $ref: '#/components/schemas/AgentRefId'
        assignee:
          type: array
          description: Page assignees. Supports users and agents.
          items:
            oneOf:
              - $ref: '#/components/schemas/AssigneeUserRef'
              - $ref: '#/components/schemas/AssigneeAgentRef'
        agentFileId:
          type: string
          description: Source PPTX file ID for the full deck used by this page agent
          nullable: true
        targets:
          type: array
          description: Page targets
          items:
            oneOf:
              - $ref: '#/components/schemas/TargetCompanyContext'
              - $ref: '#/components/schemas/TargetPersonContext'
        permissions:
          $ref: '#/components/schemas/PagePermissionsOutput'
        files:
          type: array
          items:
            $ref: '#/components/schemas/PageFileRefOutput'
        content:
          description: >-
            Page-level content. Uses the same schema as block.content and
            renders before child blocks.
          oneOf:
            - $ref: '#/components/schemas/ParagraphPayload'
            - $ref: '#/components/schemas/HeadingPayload'
            - $ref: '#/components/schemas/CalloutPayload'
            - $ref: '#/components/schemas/QuotePayload'
            - $ref: '#/components/schemas/BulletedListItemPayload'
            - $ref: '#/components/schemas/NumberedListItemPayload'
            - $ref: '#/components/schemas/ToDoPayload'
            - $ref: '#/components/schemas/TogglePayload'
            - $ref: '#/components/schemas/AgentPayload'
            - $ref: '#/components/schemas/CodePayload'
            - $ref: '#/components/schemas/MarkdownPayload'
            - $ref: '#/components/schemas/DividerPayload'
            - $ref: '#/components/schemas/ColumnPayload'
            - $ref: '#/components/schemas/ColumnListPayload'
            - $ref: '#/components/schemas/TabPayload'
            - $ref: '#/components/schemas/TabsPayload'
            - $ref: '#/components/schemas/FlexPayload'
            - $ref: '#/components/schemas/BreadcrumbPayload'
            - $ref: '#/components/schemas/TableOfContentsPayload'
            - $ref: '#/components/schemas/SyncedBlockPayload'
            - $ref: '#/components/schemas/TablePayload'
            - $ref: '#/components/schemas/TableRowPayload'
            - $ref: '#/components/schemas/ImagePayload'
            - $ref: '#/components/schemas/VideoPayload'
            - $ref: '#/components/schemas/AudioPayload'
            - $ref: '#/components/schemas/FilePayload'
            - $ref: '#/components/schemas/PDFPayload'
            - $ref: '#/components/schemas/BookmarkPayload'
            - $ref: '#/components/schemas/EmbedPayload'
            - $ref: '#/components/schemas/LinkPreviewPayload'
            - $ref: '#/components/schemas/EquationPayload'
            - $ref: '#/components/schemas/MapPayload'
            - $ref: '#/components/schemas/ChildPagePayload'
            - $ref: '#/components/schemas/ChildDatabasePayload'
            - $ref: '#/components/schemas/InlineDatabasePayload'
            - $ref: '#/components/schemas/PieChartPayload'
            - $ref: '#/components/schemas/BarChartPayload'
            - $ref: '#/components/schemas/LineChartPayload'
            - $ref: '#/components/schemas/AreaChartPayload'
            - $ref: '#/components/schemas/HeatmapPayload'
            - $ref: '#/components/schemas/GraphVisualizationPayload'
            - $ref: '#/components/schemas/DataViewPayload'
            - $ref: '#/components/schemas/MentionPayload'
            - $ref: '#/components/schemas/SlideContentPayload'
          nullable: true
        parent:
          description: Parent relationship (Notion-compatible).
          oneOf:
            - $ref: '#/components/schemas/PageParentOutput'
            - $ref: '#/components/schemas/OrgParentOutput'
            - $ref: '#/components/schemas/BlockParentOutput'
            - $ref: '#/components/schemas/CompanyParentOutput'
          nullable: true
        pipelines:
          type: object
          description: >-
            Board placements keyed by pipeline id (`{ stage, position }`). Empty
            when not on any board.
          additionalProperties:
            $ref: '#/components/schemas/PagePipelinePlacementOutput'
        properties:
          type: object
          description: >-
            Custom properties (scalar values) keyed by property name.
            Filter/group via `properties.<name>`.
          additionalProperties: true
        relations:
          type: object
          description: >-
            Relation values keyed by relation name (target key or array). Filter
            via `relations.<name>`.
          additionalProperties: true
        summary:
          type: string
          nullable: true
        usage:
          description: Token usage summary for the page
          allOf:
            - $ref: '#/components/schemas/PageUsageOutput'
        runSessionId:
          description: >-
            Associated page run session reference. Use
            expand=runSessionId.status or expand=runSessionId.userId to include
            run metadata.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PageRunSessionRefOutput'
        url:
          type: string
          description: >-
            Absolute app URL for the page. Included only when requested with
            expand=url.
          nullable: true
      required:
        - object
        - id
        - createdAt
        - updatedAt
        - kind
        - title
        - agent
        - assignee
        - targets
        - permissions
        - files
        - pipelines
        - properties
        - relations
        - summary
    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
    AgentRefNone:
      type: object
      properties:
        type:
          type: string
          enum:
            - none
      required:
        - type
    AgentRefId:
      type: object
      properties:
        type:
          type: string
          enum:
            - agent_id
        agent_id:
          type: string
        name:
          type: string
          description: Agent name
          nullable: true
      required:
        - type
        - agent_id
    AssigneeUserRef:
      type: object
      properties:
        type:
          type: string
          enum:
            - user_id
        user_id:
          type: string
      required:
        - type
        - user_id
    AssigneeAgentRef:
      type: object
      properties:
        type:
          type: string
          enum:
            - agent_id
        agent_id:
          type: string
      required:
        - type
        - agent_id
    TargetCompanyContext:
      type: object
      properties:
        type:
          type: string
          enum:
            - company
        company:
          $ref: '#/components/schemas/CompanyDocumentRef'
      required:
        - type
        - company
    TargetPersonContext:
      type: object
      properties:
        type:
          type: string
          enum:
            - person
        person:
          $ref: '#/components/schemas/PersonDocumentRef'
      required:
        - type
        - person
    PagePermissionsOutput:
      type: object
      properties:
        allow:
          type: array
          items:
            type: string
        deny:
          type: array
          items:
            type: string
        ask:
          type: array
          items:
            type: string
      required:
        - allow
        - deny
        - ask
    PageFileRefOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - file_upload
        name:
          type: string
        file_upload:
          $ref: '#/components/schemas/FileUploadRef'
      required:
        - type
        - name
        - file_upload
    ParagraphPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        color:
          type: string
      required:
        - rich_text
    HeadingPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        color:
          type: string
        icon:
          type: string
        is_toggleable:
          type: boolean
      required:
        - rich_text
    CalloutPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        icon:
          type: object
        color:
          type: string
      required:
        - rich_text
    QuotePayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        color:
          type: string
      required:
        - rich_text
    BulletedListItemPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        color:
          type: string
        badges:
          type: array
          items:
            $ref: '#/components/schemas/Badge'
      required:
        - rich_text
    NumberedListItemPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        color:
          type: string
        badges:
          type: array
          items:
            $ref: '#/components/schemas/Badge'
      required:
        - rich_text
    ToDoPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        checked:
          type: boolean
        color:
          type: string
      required:
        - rich_text
        - checked
    TogglePayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        color:
          type: string
      required:
        - rich_text
    AgentPayload:
      type: object
      properties:
        rich_text:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
      required:
        - rich_text
    CodePayload:
      type: object
      properties:
        code:
          type: string
        language:
          type: string
          enum:
            - mermaid
            - markdown
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
      required:
        - code
        - language
    MarkdownPayload:
      type: object
      properties:
        markdown:
          type: string
        format:
          type: string
          enum:
            - markdown
            - mdx
        outputExample:
          type: string
          description: Example output format for markdown blocks
      required:
        - markdown
    DividerPayload:
      type: object
      properties: {}
    ColumnPayload:
      type: object
      properties:
        width_ratio:
          type: number
    ColumnListPayload:
      type: object
      properties: {}
    TabPayload:
      type: object
      properties:
        id:
          type: string
        label:
          type: string
      required:
        - id
        - label
    TabsPayload:
      type: object
      properties:
        defaultTab:
          type: string
    FlexPayload:
      type: object
      properties:
        gap:
          type: string
          enum:
            - sm
            - md
            - lg
        minChildWidth:
          type: string
    BreadcrumbPayload:
      type: object
      properties: {}
    TableOfContentsPayload:
      type: object
      properties:
        color:
          type: string
    SyncedBlockPayload:
      type: object
      properties:
        synced_from:
          type: object
    TablePayload:
      type: object
      properties:
        table_width:
          type: number
        has_column_header:
          type: boolean
        has_row_header:
          type: boolean
        full_width:
          type: boolean
      required:
        - table_width
        - has_column_header
        - has_row_header
    TableRowPayload:
      type: object
      properties:
        cells:
          type: array
          items:
            type: array
            items:
              $ref: '#/components/schemas/RichTextContent'
      required:
        - cells
    ImagePayload:
      type: object
      properties:
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        type:
          type: string
          enum:
            - external
            - file
        external:
          $ref: '#/components/schemas/ExternalUrl'
        file:
          $ref: '#/components/schemas/FileUrl'
        alt_text:
          type: string
      required:
        - type
    VideoPayload:
      type: object
      properties:
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        type:
          type: string
          enum:
            - external
            - file
        external:
          $ref: '#/components/schemas/ExternalUrl'
        file:
          $ref: '#/components/schemas/FileUrl'
      required:
        - type
    AudioPayload:
      type: object
      properties:
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        type:
          type: string
          enum:
            - external
            - file
        external:
          type: object
        file:
          type: object
      required:
        - type
    FilePayload:
      type: object
      properties:
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        type:
          type: string
          enum:
            - external
            - file
            - file_upload
        external:
          $ref: '#/components/schemas/ExternalUrl'
        file:
          $ref: '#/components/schemas/FileUrl'
        file_upload:
          $ref: '#/components/schemas/FileRef'
        name:
          type: string
      required:
        - type
    PDFPayload:
      type: object
      properties:
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        type:
          type: string
          enum:
            - external
            - file
        external:
          $ref: '#/components/schemas/ExternalUrl'
        file:
          $ref: '#/components/schemas/FileUrl'
      required:
        - type
    BookmarkPayload:
      type: object
      properties:
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        url:
          type: string
        title:
          type: string
        description:
          type: string
        icon:
          type: string
        image:
          type: string
      required:
        - url
    EmbedPayload:
      type: object
      properties:
        url:
          type: string
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
      required:
        - url
    LinkPreviewPayload:
      type: object
      properties:
        url:
          type: string
        title:
          type: string
        description:
          type: string
        icon:
          type: string
        image:
          type: string
      required:
        - url
    EquationPayload:
      type: object
      properties:
        expression:
          type: string
      required:
        - expression
    MapPayload:
      type: object
      properties:
        mode:
          type: string
          enum:
            - place
            - directions
            - search
            - view
            - streetview
        location:
          type: string
        origin:
          type: string
        destination:
          type: string
        waypoints:
          type: array
          items:
            type: string
        center:
          type: string
        zoom:
          type: number
        mapType:
          type: string
          enum:
            - roadmap
            - satellite
        width:
          type: string
        height:
          type: string
        apiKey:
          type: string
        language:
          type: string
        region:
          type: string
        travelMode:
          type: string
          enum:
            - driving
            - walking
            - bicycling
            - transit
        avoid:
          type: array
          items:
            type: string
        units:
          type: string
          enum:
            - metric
            - imperial
        pano:
          type: string
        heading:
          type: number
        pitch:
          type: number
        fov:
          type: number
        radius:
          type: number
        source:
          type: string
          enum:
            - default
            - outdoor
        staticImage:
          type: string
    ChildPagePayload:
      type: object
      properties:
        title:
          type: string
      required:
        - title
    ChildDatabasePayload:
      type: object
      properties:
        title:
          type: string
        context_type:
          type: string
        view:
          $ref: '#/components/schemas/ChildDatabaseView'
        filter:
          type: object
      required:
        - title
        - context_type
    InlineDatabasePayload:
      type: object
      properties:
        entries:
          type: array
          items:
            type: object
            additionalProperties: true
        views:
          type: array
          items:
            $ref: '#/components/schemas/DatabaseBlockViewConfig'
        defaultView:
          type: string
        database:
          type: object
        showToolbar:
          type: boolean
        showViewTabs:
          type: boolean
        showChartTitles:
          type: boolean
      required:
        - entries
        - views
    PieChartPayload:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ChartDataPoint'
        config:
          $ref: '#/components/schemas/ChartConfig'
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
        variant:
          type: string
          enum:
            - pie
            - donut
        innerRadius:
          type: number
      required:
        - data
    BarChartPayload:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ChartDataPoint'
        orientation:
          type: string
          enum:
            - vertical
            - horizontal
        stacked:
          type: boolean
        config:
          $ref: '#/components/schemas/ChartConfig'
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
      required:
        - data
    LineChartPayload:
      type: object
      properties:
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/ChartDataset'
        curved:
          type: boolean
        showDots:
          type: boolean
        config:
          $ref: '#/components/schemas/ChartConfig'
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
      required:
        - datasets
    AreaChartPayload:
      type: object
      properties:
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/ChartDataset'
        stacked:
          type: boolean
        fillOpacity:
          type: number
        config:
          $ref: '#/components/schemas/ChartConfig'
        caption:
          type: array
          items:
            $ref: '#/components/schemas/RichTextContent'
      required:
        - datasets
    HeatmapPayload:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/HeatmapDataPoint'
        title:
          type: string
        colorScheme:
          type: string
          enum:
            - red
            - green
            - blue
            - purple
        yearsToShow:
          type: number
      required:
        - data
    GraphVisualizationPayload:
      type: object
      properties:
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/GraphNode'
        edges:
          type: array
          items:
            $ref: '#/components/schemas/GraphEdge'
        layout:
          type: string
          enum:
            - force-directed
            - hierarchical
            - radial
        height:
          type: number
      required:
        - nodes
        - edges
    DataViewPayload:
      type: object
      properties:
        target_type:
          type: string
          enum:
            - data_source
            - page
            - relation
        target_ids:
          type: array
          items:
            type: string
      required:
        - target_type
        - target_ids
    MentionPayload:
      type: object
      properties:
        type:
          type: string
          enum:
            - user
            - page
            - database
            - date
            - link_preview
            - file
        user:
          $ref: '#/components/schemas/MentionUser'
        page:
          $ref: '#/components/schemas/MentionPage'
        database:
          $ref: '#/components/schemas/MentionDatabase'
        date:
          $ref: '#/components/schemas/MentionDate'
        file:
          $ref: '#/components/schemas/MentionFile'
      required:
        - type
    SlideContentPayload:
      type: object
      properties:
        slide:
          description: >-
            Slide payload. Page slides created from agent may store only agent
            values.
          oneOf:
            - $ref: '#/components/schemas/SlidePayload'
            - type: object
              additionalProperties: true
      required:
        - slide
    PageParentOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - page_id
        page_id:
          type: string
      required:
        - type
        - page_id
    OrgParentOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - org
        org:
          type: number
          enum:
            - true
      required:
        - type
        - org
    BlockParentOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - block_id
        block_id:
          type: string
      required:
        - type
        - block_id
    CompanyParentOutput:
      type: object
      properties:
        type:
          type: string
          enum:
            - company_id
        company_id:
          type: string
      required:
        - type
        - company_id
    PagePipelinePlacementOutput:
      type: object
      properties:
        stage:
          type: string
          description: Column (stage) id within the pipeline
        position:
          type: number
          description: Fractional ordering position within the column
        enteredAt:
          type: string
          description: ISO timestamp for when the card entered this stage
      required:
        - stage
        - position
    PageUsageOutput:
      type: object
      properties:
        input:
          type: number
        output:
          type: number
        total:
          type: number
        cacheReadInputTokens:
          type: number
          description: Claude prompt-cache read input tokens.
        cacheCreationInputTokens:
          type: number
          description: Claude prompt-cache creation input tokens.
        cacheCreationEphemeral1hInputTokens:
          type: number
          description: Claude prompt-cache creation tokens with 1h TTL.
        cacheCreationEphemeral5mInputTokens:
          type: number
          description: Claude prompt-cache creation tokens with 5m TTL.
        totalInputTokens:
          type: number
          description: Claude total input tokens including cache read and cache creation.
        durationSeconds:
          type: number
          description: Claude session elapsed duration in seconds.
          nullable: true
        activeSeconds:
          type: number
          description: Claude session active running time in seconds.
          nullable: true
        claudeUsage:
          type: object
          description: Raw Claude session usage snapshot.
          additionalProperties: true
          nullable: true
        claudeStats:
          type: object
          description: Raw Claude session stats snapshot.
          additionalProperties: true
          nullable: true
      required:
        - input
        - output
        - total
    PageRunSessionRefOutput:
      type: object
      properties:
        object:
          type: string
          enum:
            - session
        id:
          type: string
        status:
          type: string
          enum:
            - provisioning
            - provisioning_failed
            - rescheduling
            - running
            - idle
            - terminated
            - archived
        userId:
          type: string
          description: User ID that owns the running session
      required:
        - object
        - id
    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
    CompanyDocumentRef:
      type: object
      properties:
        id:
          type: string
          example: cmp_abc123
        document:
          type: string
          example: '12345678000190'
        tradeName:
          type: object
          description: Trade name (expanded)
          example: Acme Corp
        legalName:
          type: object
          description: Legal name (expanded)
          example: Acme Ltda
        icon:
          description: Company icon (expanded)
          allOf:
            - $ref: '#/components/schemas/IconOutput'
      required:
        - id
        - document
    PersonDocumentRef:
      type: object
      properties:
        document:
          type: string
          example: '12345678000190'
      required:
        - document
    FileUploadRef:
      type: object
      properties:
        id:
          type: string
      required:
        - id
    RichTextContent:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        text:
          $ref: '#/components/schemas/RichTextText'
        annotations:
          $ref: '#/components/schemas/RichTextAnnotations'
        plain_text:
          type: string
        href:
          type: string
      required:
        - type
    Badge:
      type: object
      properties:
        label:
          type: string
        color:
          type: string
      required:
        - label
    ExternalUrl:
      type: object
      properties:
        url:
          type: string
      required:
        - url
    FileUrl:
      type: object
      properties:
        url:
          type: string
        expiryTime:
          type: string
      required:
        - url
    FileRef:
      type: object
      properties:
        id:
          type: string
      required:
        - id
    ChildDatabaseView:
      type: object
      properties:
        visible_properties:
          type: array
          items:
            type: string
        sorts:
          type: array
          items:
            type: string
    DatabaseBlockViewConfig:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        type:
          type: string
          enum:
            - table
            - chart
        columns:
          type: array
          items:
            $ref: '#/components/schemas/DatabaseBlockColumnDef'
        height:
          type: number
        chartConfig:
          type: object
        filters:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
        sorts:
          type: array
          items:
            $ref: '#/components/schemas/Sort'
        group:
          $ref: '#/components/schemas/Group'
        initialFilters:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
        initialSorts:
          type: array
          items:
            $ref: '#/components/schemas/Sort'
        initialGroup:
          $ref: '#/components/schemas/Group'
      required:
        - id
        - title
        - type
    ChartDataPoint:
      type: object
      properties:
        label:
          type: string
        value:
          type: number
        color:
          type: string
        meta:
          type: object
      required:
        - label
        - value
    ChartConfig:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        showLegend:
          type: boolean
        showTooltip:
          type: boolean
        showLabels:
          type: boolean
        colors:
          type: array
          items:
            type: string
        valueFormatter:
          type: string
          enum:
            - number
            - currency
            - percent
            - decimal
        currency:
          type: string
        decimals:
          type: number
        height:
          type: number
        responsive:
          type: boolean
    ChartDataset:
      type: object
      properties:
        label:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/TimeSeriesDataPoint'
        color:
          type: string
        meta:
          type: object
      required:
        - label
        - data
    HeatmapDataPoint:
      type: object
      properties:
        year:
          type: number
        month:
          type: number
        count:
          type: number
        entries:
          type: array
          items:
            $ref: '#/components/schemas/HeatmapEntryData'
      required:
        - year
        - month
        - count
    GraphNode:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        label:
          type: string
        size:
          type: number
        color:
          type: string
      required:
        - id
        - type
        - label
    GraphEdge:
      type: object
      properties:
        source:
          type: string
        target:
          type: string
        type:
          type: string
        style:
          type: string
          enum:
            - solid
            - dashed
        width:
          type: number
      required:
        - source
        - target
    MentionUser:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        avatar_url:
          type: string
      required:
        - id
        - name
    MentionPage:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
      required:
        - id
    MentionDatabase:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
      required:
        - id
    MentionDate:
      type: object
      properties:
        start:
          type: string
        end:
          type: string
        time_zone:
          type: string
      required:
        - start
    MentionFile:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        excerpt:
          type: string
      required:
        - id
        - title
    SlidePayload:
      type: object
      properties:
        agentId:
          type: string
          description: Agent ID (agt_*) for the source presentation
        agentVersion:
          type: string
          description: Agent version name used to create this slide
        agentSlideNumber:
          type: number
          description: >-
            Slide number in the agent (1-indexed, persistent ID that never
            changes even when slides are reordered)
        layoutName:
          type: string
          description: Layout name if detected
        notes:
          type: string
          description: Notes content
        source:
          description: Source files from agent analysis
          allOf:
            - $ref: '#/components/schemas/SlideSourceFiles'
        slideFileId:
          type: string
          description: File ID for the processed slide (PPTX)
        elements:
          description: Elements on this slide
          type: array
          items:
            $ref: '#/components/schemas/SlideElement'
        structuredOutput:
          description: Structured output schema in OpenAI json_schema format
          allOf:
            - $ref: '#/components/schemas/OpenAIJsonSchemaFormat'
        output:
          type: object
          description: Output values for this slide
          additionalProperties: true
        version:
          type: string
          description: Version timestamp for grouping slides from same analysis run
        canDuplicate:
          type: boolean
          description: Whether the agent can create multiple instances of this slide
      required:
        - agentId
        - agentSlideNumber
        - source
        - elements
    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
    RichTextText:
      type: object
      properties:
        content:
          type: string
        link:
          $ref: '#/components/schemas/RichTextLink'
      required:
        - content
    RichTextAnnotations:
      type: object
      properties:
        bold:
          type: boolean
        italic:
          type: boolean
        strikethrough:
          type: boolean
        underline:
          type: boolean
        code:
          type: boolean
        color:
          type: string
        trend:
          type: string
          enum:
            - up
            - down
            - stable
            - down_good
            - up_bad
            - none
    DatabaseBlockColumnDef:
      type: object
      properties:
        field:
          type: string
        label:
          type: string
        width:
          type: string
        sortable:
          type: boolean
        filterable:
          type: boolean
        type:
          type: string
          enum:
            - text
            - number
            - date
            - boolean
            - badge
      required:
        - field
        - label
    Filter:
      type: object
      properties:
        id:
          type: string
        field:
          type: string
        operator:
          type: string
        value:
          type: object
        fieldType:
          type: string
          enum:
            - text
            - number
            - date
            - boolean
            - select
            - multi_select
            - status
      required:
        - id
        - field
        - operator
        - value
        - fieldType
    Sort:
      type: object
      properties:
        id:
          type: string
        field:
          type: string
        direction:
          type: string
          enum:
            - asc
            - desc
        priority:
          type: number
      required:
        - id
        - field
        - direction
        - priority
    Group:
      type: object
      properties:
        field:
          type: object
          nullable: true
        collapsedGroups:
          type: array
          items:
            type: string
        showCounts:
          type: boolean
      required:
        - field
    TimeSeriesDataPoint:
      type: object
      properties:
        x:
          oneOf:
            - type: string
            - type: number
        'y':
          type: number
      required:
        - x
        - 'y'
    HeatmapEntryData:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        date:
          type: string
    SlideSourceFiles:
      type: object
      properties:
        agentFileId:
          type: string
          description: File ID for single-slide PPTX agent
      required:
        - agentFileId
    SlideElement:
      type: object
      properties:
        id:
          type: string
          description: Unique element identifier
        type:
          type: string
          description: Element type
          enum:
            - text
            - table
            - chart
            - image
            - shape
            - placeholder
        name:
          type: string
          description: Display name
        description:
          type: string
          description: User-provided description
        ignored:
          type: boolean
          description: If true, element is not modified during export
        position:
          description: Position and size on the slide
          allOf:
            - $ref: '#/components/schemas/SlideElementPosition'
        placeholderType:
          type: string
          description: Original placeholder type
        zIndex:
          type: number
          description: Z-order index on the slide
        textContent:
          type: string
          description: Original text content
        variableName:
          type: string
          description: Variable name for text substitution
        formatting:
          description: Text formatting info
          allOf:
            - $ref: '#/components/schemas/SlideTextFormatting'
        tableSchema:
          description: Table schema
          allOf:
            - $ref: '#/components/schemas/SlideTableSchema'
        sampleData:
          type: array
          description: Sample data from agent
          items:
            type: object
        chartSchema:
          description: Chart configuration
          allOf:
            - $ref: '#/components/schemas/SlideChartSchema'
        imageKey:
          type: string
          description: S3 key for the original image
        originalFilename:
          type: string
          description: Original image filename
        isDynamic:
          type: boolean
          description: Whether this is a placeholder for dynamic image
        shapeType:
          type: string
          description: Shape type
        fillColor:
          type: string
          description: Fill color
        hasText:
          type: boolean
          description: Whether shape contains text
      required:
        - id
        - type
        - name
        - ignored
        - position
    OpenAIJsonSchemaFormat:
      type: object
      properties:
        type:
          type: string
          enum:
            - json_schema
        name:
          type: string
          description: Schema name used by OpenAI Structured Outputs
        description:
          type: string
          description: Optional schema description used by the model
        strict:
          type: boolean
          description: Whether strict schema adherence is enabled
        schema:
          type: object
          description: JSON Schema object
          additionalProperties: true
      required:
        - type
        - name
        - schema
    RichTextLink:
      type: object
      properties:
        url:
          type: string
      required:
        - url
    SlideElementPosition:
      type: object
      properties:
        x:
          type: number
          description: Left position in EMUs
        'y':
          type: number
          description: Top position in EMUs
        width:
          type: number
          description: Width in EMUs
        height:
          type: number
          description: Height in EMUs
      required:
        - x
        - 'y'
        - width
        - height
    SlideTextFormatting:
      type: object
      properties:
        fontFamily:
          type: string
        fontSize:
          type: number
        bold:
          type: boolean
        italic:
          type: boolean
        alignment:
          type: string
          enum:
            - left
            - center
            - right
            - justify
    SlideTableSchema:
      type: object
      properties:
        columns:
          description: Column definitions
          type: array
          items:
            $ref: '#/components/schemas/SlideTableColumn'
        rowsVariable:
          type: string
          description: Variable name for dynamic row data
        hasHeader:
          type: boolean
          description: Whether header row should be preserved
        originalRowCount:
          type: number
          description: Number of rows in original agent
      required:
        - columns
        - hasHeader
        - originalRowCount
    SlideChartSchema:
      type: object
      properties:
        chartType:
          type: string
          description: Type of chart
          enum:
            - bar
            - column
            - line
            - pie
            - doughnut
            - area
            - scatter
            - radar
        title:
          type: string
          description: Chart title
        series:
          description: Series definitions
          type: array
          items:
            $ref: '#/components/schemas/SlideChartSeries'
        categoriesVariable:
          type: string
          description: Variable name for category labels
        originalCategories:
          description: Original category labels
          type: array
          items:
            type: string
        axes:
          description: Axis configurations
          allOf:
            - $ref: '#/components/schemas/SlideChartAxes'
      required:
        - chartType
        - series
    SlideTableColumn:
      type: object
      properties:
        index:
          type: number
          description: Column index (0-based)
        name:
          type: string
          description: Column header text
        type:
          type: string
          description: Inferred data type
          enum:
            - string
            - number
            - date
            - currency
            - percentage
        width:
          type: number
          description: Width in EMUs
        variableName:
          type: string
          description: Variable name for this column
      required:
        - index
        - name
        - type
    SlideChartSeries:
      type: object
      properties:
        index:
          type: number
          description: Series index
        name:
          type: string
          description: Series name/label
        variableName:
          type: string
          description: Variable name for series data
        originalData:
          description: Original data values
          type: array
          items:
            type: number
        color:
          type: string
          description: Series color
      required:
        - index
        - name
    SlideChartAxes:
      type: object
      properties:
        xAxis:
          $ref: '#/components/schemas/SlideChartAxisConfig'
        yAxis:
          $ref: '#/components/schemas/SlideChartAxisConfig'
    SlideChartAxisConfig:
      type: object
      properties:
        title:
          type: string
          description: Axis title
        min:
          type: number
          description: Minimum value
        max:
          type: number
          description: Maximum value
        format:
          type: string
          description: Number format
  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

````