openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
  description: >-
    Public API for accessing agents, flows, and analytics.


    ## Authentication


    The Public API supports two API key types. Pass the key as a Bearer token:


    ```

    Authorization: Bearer <YOUR_API_KEY>

    ```


    ### Account API key (GENERAL)


    Account-level key that acts on behalf of the entire account. Required for
    account-level endpoints unless noted otherwise.


    ### User API key (USER)


    User-level key tied to a specific user. Required for write operations and
    user-owned resources. **Also accepted on all account-level endpoints.**


    Each operation documents which key type(s) it accepts in its **Security**
    section.
  license:
    name: Proprietary
    url: https://www.getfrontline.ai/terms-and-conditions
servers:
  - url: https://prod-api.getfrontline.ai
tags:
  - name: Account
    description: Inspect the identity attached to the current API key
  - name: Agent Builder
    description: View and manage your AI agents across your account
  - name: Flows
    description: View and manage flows associated with your agents
  - name: Agents
    description: 'Agent runtime data: conversations and transcripts'
  - name: Agent Playbooks
    description: Manage reusable instruction sets assigned to agents
  - name: Workflows
    description: View and manage your workflows across your account
  - name: Billing
    description: View billing plan details, credits, and renewal information
  - name: Flow Variables
    description: Manage variables scoped to an agent's flow
  - name: Workflow Variables
    description: Manage variables scoped to an automation workflow
  - name: Intents
    description: Manage agent intents and training phrases
  - name: AI Models
    description: Discover available AI models for agent configuration
  - name: Users
    description: List account users to resolve IDs for relations and assignment
  - name: User Tasks
    description: >-
      User tasks — the account 'To-dos' inbox: create, list, update, complete,
      and delete tasks, optionally linked to an object record. Distinct from
      object-row tasks (Object tasks) and from Max tasks.
  - name: Custom Tools
    description: >-
      Manage custom tools — reusable HTTP/API-call integrations the account
      creates and assigns to agents, flows, and workflows. Distinct from
      built-in system tools and connected-integration (MCP) tools.
  - name: Incoming Webhooks
    description: Inbound HTTPS endpoints that external systems can post events to
  - name: Knowledge Bases
    description: >-
      Manage knowledge bases, their sources (URLs, website crawls), search, and
      agent assignment
  - name: Account Integrations
    description: >-
      View account-scoped (Studio) connected integrations, discover connectable
      toolkits, and configure which tools each integration exposes to agents,
      flows, and workflows. These are used for workflows and agents, separate
      from Max integrations.
  - name: Agent Channels
    description: >-
      View connected channel integrations (WhatsApp, Instagram, Messenger) and
      bind numbers/accounts/pages to agents
  - name: Integration Resources
    description: >-
      Resolve resource IDs (spreadsheets, docs, drive folders, Asana projects,
      Salesforce SObjects, Gmail labels, Outlook folders/calendars) needed to
      configure event triggers. Requires a USER API key.
  - name: Guidance
    description: >-
      Builder reference data sourced live from backend constants: valid icons,
      colors, and formats for objects/tables/fields, plus the workflow/flow
      node-type catalog. Use these instead of hard-coding allowlists.
  - name: Channels
    description: >-
      Communication channels connected to this account (WhatsApp, Instagram,
      Messenger)
  - name: Integrations
    description: >-
      OAuth/API connected accounts for toolkits like Google Sheets, Gmail, and
      Slack
  - name: Objects
    description: Manage CRM objects (standard and custom)
  - name: Object fields
    description: Manage columns on an object
  - name: Object options
    description: Manage tag/select options on object fields
  - name: Object record types
    description: Categorize records inside an object
  - name: Object views
    description: Saved view configurations on an object
  - name: Object relations
    description: Link and unlink records across objects
  - name: Object rows
    description: Read and write object records
  - name: Object aggregations
    description: Per-view aggregations on objects
  - name: Object activities
    description: Manual activities (notes, calls, meetings, emails) attached to object rows
  - name: Object tasks
    description: Tasks attached to object rows
  - name: Object files
    description: Files attached to object rows
  - name: Object export
    description: Export object data as XLSX or CSV
  - name: Tables
    description: Manage spreadsheet-style tables
  - name: Table fields
    description: Manage columns on a table
  - name: Table options
    description: Manage tag/select options on table fields
  - name: Table rows
    description: Read and write table rows
  - name: Table aggregations
    description: Per-view aggregations on tables
  - name: Table activities
    description: Manual activities (notes, calls, meetings, emails) attached to table rows
  - name: Table tasks
    description: Tasks attached to table rows
  - name: Table files
    description: Files attached to table rows
  - name: Table export
    description: Export table data as XLSX or CSV
x-tagGroups:
  - name: Agent Builder
    tags:
      - Agent Builder
      - Flows
      - Flow Variables
      - Intents
      - Agents
      - Agent Playbooks
  - name: Workflows
    tags:
      - Workflows
      - Workflow Variables
  - name: Objects
    tags:
      - Objects
      - Object fields
      - Object options
      - Object record types
      - Object views
      - Object relations
      - Object rows
      - Object aggregations
      - Object activities
      - Object tasks
      - Object files
      - Object export
  - name: Tables
    tags:
      - Tables
      - Table fields
      - Table options
      - Table rows
      - Table aggregations
      - Table activities
      - Table tasks
      - Table files
      - Table export
  - name: Channels
    tags:
      - Channels
  - name: Integrations
    tags:
      - Custom Tools
      - Incoming Webhooks
      - Account Integrations
      - Agent Channels
      - Integration Resources
  - name: Knowledge
    tags:
      - Knowledge Bases
  - name: Core
    tags:
      - Account
      - AI Models
      - Billing
      - Users
      - User Tasks
      - Guidance
components:
  securitySchemes:
    accountApiKey:
      type: http
      scheme: bearer
      bearerFormat: Account API Key
      description: >-
        Account-level API key (GENERAL). Authenticates on behalf of the entire
        account. Use for read-only and analytics endpoints marked as
        account-level in this documentation.
    userApiKey:
      type: http
      scheme: bearer
      bearerFormat: User API Key
      description: >-
        User-level API key (USER). Authenticates on behalf of a specific user.
        Required for write operations and user-owned resources. Also accepted on
        all account-level endpoints.
  schemas:
    PublicChannelAssistant:
      type: object
      nullable: true
      properties:
        id:
          type: string
          example: example
        name:
          type: string
          example: example
      required:
        - id
        - name
    PublicWhatsAppPhoneNumber:
      type: object
      properties:
        phoneNumberId:
          type: string
          description: >-
            Meta WhatsApp Business phone number ID. Use in SEND_WHATSAPP_MESSAGE
            nodes.
          example: '1132681309928224'
        displayPhoneNumber:
          type: string
          nullable: true
          example: example
        assistantId:
          type: string
          nullable: true
          example: example
        assistant:
          $ref: '#/components/schemas/PublicChannelAssistant'
        canSendMessages:
          type: boolean
          description: >-
            True when assistantId is assigned. Only these numbers work in Send
            WhatsApp Message nodes.
          example: false
      required:
        - phoneNumberId
        - canSendMessages
    PublicInstagramAccount:
      type: object
      properties:
        id:
          type: number
          example: 1
        instagramUserId:
          type: string
          example: example
        username:
          type: string
          nullable: true
          example: example
        assistantId:
          type: string
          nullable: true
          example: example
        assistant:
          $ref: '#/components/schemas/PublicChannelAssistant'
      required:
        - id
        - instagramUserId
    PublicMessengerPage:
      type: object
      properties:
        id:
          type: number
          example: 1
        pageId:
          type: string
          example: example
        pageName:
          type: string
          nullable: true
          example: example
        assistantId:
          type: string
          nullable: true
          example: example
        assistant:
          $ref: '#/components/schemas/PublicChannelAssistant'
      required:
        - id
        - pageId
    PublicChannelsOutput:
      type: object
      properties:
        whatsapp:
          type: object
          properties:
            connected:
              type: boolean
              example: false
            phoneNumbers:
              type: array
              items:
                $ref: '#/components/schemas/PublicWhatsAppPhoneNumber'
          required:
            - connected
            - phoneNumbers
          description: WhatsApp Business numbers connected to this account.
        instagram:
          type: object
          properties:
            connected:
              type: boolean
              example: false
            accounts:
              type: array
              items:
                $ref: '#/components/schemas/PublicInstagramAccount'
          required:
            - connected
            - accounts
          description: Instagram accounts connected to this account.
        messenger:
          type: object
          properties:
            connected:
              type: boolean
              example: false
            pages:
              type: array
              items:
                $ref: '#/components/schemas/PublicMessengerPage'
          required:
            - connected
            - pages
          description: Messenger pages connected to this account.
      required:
        - whatsapp
        - instagram
        - messenger
    PublicWhatsAppTemplateParameters:
      type: object
      properties:
        HEADER:
          type: array
          items:
            type: string
            example: example
        BODY:
          type: array
          items:
            type: string
            example: example
        FOOTER:
          type: array
          items:
            type: string
            example: example
        BUTTONS:
          type: array
          items:
            type: string
            example: example
        BUTTONS_URL:
          type: array
          items:
            type: string
            example: example
    PublicWhatsAppTemplate:
      type: object
      properties:
        id:
          type: string
          example: example
        name:
          type: string
          description: Template name to use in SEND_WHATSAPP_MESSAGE nodes.
          example: hello_world
        language:
          type: string
          example: example
        status:
          type: string
          example: example
        category:
          type: string
          example: example
        components:
          type: array
          items:
            type: object
            additionalProperties: {}
        parameters:
          $ref: '#/components/schemas/PublicWhatsAppTemplateParameters'
      required:
        - name
    PublicWhatsAppTemplatesOutput:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicWhatsAppTemplate'
      required:
        - results
    PublicConnectedAccount:
      type: object
      properties:
        id:
          type: number
          description: >-
            Connected account ID. Use as connectedAccountId in agent settings,
            flows, and workflows.
          example: 1
        toolkit:
          type: string
          example: googlesheets
        alias:
          type: string
          nullable: true
          example: example
        visibility:
          type: string
          enum:
            - PRIVATE
            - SHARED
          example: PRIVATE
        isConnected:
          type: boolean
          example: false
        isExpired:
          type: boolean
          example: false
        connectedEmail:
          type: string
          nullable: true
          example: example
        connectedAt:
          type: string
          nullable: true
          example: example
        availableToolsCount:
          type: number
          nullable: true
          example: 1
        enabledToolsCount:
          type: number
          nullable: true
          example: 1
        createdAt:
          type: string
          nullable: true
          example: example
        updatedAt:
          type: string
          nullable: true
          example: example
      required:
        - id
        - toolkit
        - visibility
        - isConnected
        - isExpired
        - createdAt
        - updatedAt
    PublicIntegrationsListResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicConnectedAccount'
      required:
        - results
    PublicTriggerConfigField:
      type: object
      properties:
        name:
          type: string
          description: Key to send inside triggerConfig on the TRIGGER node.
          example: folder_id
        type:
          type: string
          example: string
        description:
          type: string
          example: example
        required:
          type: boolean
          description: When true, the trigger cannot be created without this config field.
          example: false
        userConfigurable:
          type: boolean
          description: >-
            When false the value is managed by the platform and is ignored if
            you send it.
          example: false
        resourceType:
          type: string
          nullable: true
          enum:
            - gmail_labels
            - googlesheets_spreadsheets
            - googlesheets_sheets
            - googledocs_documents
            - googledrive_folders
            - googledrive_shared_drives
            - onedrive_folders
            - asana_workspaces
            - asana_projects
            - salesforce_sobjects
            - salesforce_sobject_fields
            - outlook_folders
            - outlook_calendars
          description: >-
            Picker that lists valid values for this field. Call GET
            /public/v1/integrations/trigger-resources with this resourceType.
            Null when the value is free text.
          example: googledrive_folders
      required:
        - name
        - type
        - description
        - required
        - userConfigurable
        - resourceType
    PublicTriggerType:
      type: object
      properties:
        slug:
          type: string
          description: Send as data.triggerSlug on a COMPOSIO_TRIGGER node.
          example: GOOGLEDRIVE_FILE_CREATED_TRIGGER
        toolkit:
          type: string
          enum:
            - GMAIL
            - GOOGLECALENDAR
            - SLACK
            - CALENDLY
            - GOOGLEDOCS
            - GOOGLESHEETS
            - NOTION
            - GOOGLEDRIVE
            - GRANOLA_MCP
            - GOOGLEMEET
            - ZOOM
            - GAMMA
            - STRIPE
            - POSTHOG
            - LINKEDIN
            - FACEBOOK
            - GOOGLE_ANALYTICS
            - GOOGLE_SEARCH_CONSOLE
            - MAILCHIMP
            - SEMRUSH
            - GOOGLEADS
            - INSTAGRAM
            - ADYNTEL
            - GOOGLETASKS
            - LINEAR
            - JIRA
            - ASANA
            - SHARE_POINT
            - ONE_DRIVE
            - EXCEL
            - TIKTOK
            - TWITTER
            - YOUTUBE
            - GOOGLE_MAPS
            - METAADS
            - SHOPIFY
            - AIRTABLE
            - MONDAY
            - TRELLO
            - GOOGLESLIDES
            - BUILTWITH
            - HUBSPOT
            - PIPEDRIVE
            - ATTIO
            - ZENDESK
            - SALESFORCE
            - SALESFORCE_SERVICE_CLOUD
            - INTERCOM
            - WEBFLOW
            - FIGMA
            - APOLLO
            - OUTLOOK
            - FRESHDESK
            - ZOHO_DESK
            - ZOHO_INVOICE
            - ZOHO
            - BREX
          description: Send as data.triggerToolkit on a COMPOSIO_TRIGGER node.
          example: GOOGLEDRIVE
        name:
          type: string
          example: File Created
        description:
          type: string
          example: example
        deliveryType:
          type: string
          enum:
            - POLL
            - WEBHOOK
          description: >-
            POLL triggers are checked on an interval; WEBHOOK triggers are
            pushed.
          example: POLL
        configFields:
          type: array
          items:
            $ref: '#/components/schemas/PublicTriggerConfigField'
      required:
        - slug
        - toolkit
        - name
        - description
        - deliveryType
        - configFields
    PublicTriggerTypesListResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicTriggerType'
      required:
        - results
    PublicTriggerResource:
      type: object
      properties:
        id:
          type: string
          description: Value to send in triggerConfig for the matching field.
          example: example
        name:
          type: string
          example: example
      required:
        - id
        - name
    PublicTriggerResourcesListResponse:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - gmail_labels
            - googlesheets_spreadsheets
            - googlesheets_sheets
            - googledocs_documents
            - googledrive_folders
            - googledrive_shared_drives
            - onedrive_folders
            - asana_workspaces
            - asana_projects
            - salesforce_sobjects
            - salesforce_sobject_fields
            - outlook_folders
            - outlook_calendars
          example: gmail_labels
        parent:
          type: string
          nullable: true
          example: example
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicTriggerResource'
        total:
          type: number
          example: 1
      required:
        - resourceType
        - parent
        - results
        - total
    ErrorBody:
      type: object
      properties:
        code:
          type: string
          enum:
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - internal_error
            - cli_outdated
          example: unauthorized
        message:
          type: string
          example: Detailed error message
        details:
          type: object
          description: >-
            Optional structured details. Validation errors include `{ issues:
            [...] }`.
          example:
            issues:
              - path:
                  - name
                message: String must contain at least 1 character(s)
                code: too_small
      required:
        - code
        - message
    Error:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - false
          example: false
        error:
          $ref: '#/components/schemas/ErrorBody'
      required:
        - ok
        - error
    PublicIntegration:
      type: object
      properties:
        id:
          type: number
          example: 1
        toolkit:
          type: string
          example: example
        alias:
          type: string
          nullable: true
          example: example
        visibility:
          type: string
          enum:
            - PRIVATE
            - SHARED
          example: PRIVATE
        isConnected:
          type: boolean
          example: false
        isExpired:
          type: boolean
          default: false
          example: false
        connectedEmail:
          type: string
          nullable: true
          example: example
        connectedAt:
          type: string
          nullable: true
          example: example
        composioConnectedAccountId:
          type: string
          nullable: true
          example: example
        allowedToolSlugs:
          type: array
          nullable: true
          items:
            type: string
            example: example
        availableToolsCount:
          type: number
          nullable: true
          example: 1
        enabledToolsCount:
          type: number
          nullable: true
          example: 1
        accountId:
          type: number
          nullable: true
          example: 1
        createdByUserId:
          type: number
          nullable: true
          example: 1
        createdByUser:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            firstName:
              type: string
              example: example
            lastName:
              type: string
              example: example
            email:
              type: string
              example: example
            avatar:
              type: string
              nullable: true
              example: example
          required:
            - id
            - firstName
            - lastName
            - email
            - avatar
        createdAt:
          type: string
          nullable: true
          example: example
        updatedAt:
          type: string
          nullable: true
          example: example
      required:
        - id
        - toolkit
        - visibility
        - isConnected
        - createdAt
        - updatedAt
    PublicIntegrationList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicIntegration'
      required:
        - results
    PublicIntegrationToolkit:
      type: object
      properties:
        toolkit:
          type: string
          example: GMAIL
        name:
          type: string
          example: Gmail
        description:
          type: string
          nullable: true
          example: Send and read email via Gmail
        authScheme:
          type: string
          example: OAUTH2
        toolCount:
          type: number
          example: 12
        tools:
          type: array
          items:
            type: string
            example: example
          example:
            - GMAIL_SEND_EMAIL
      required:
        - toolkit
        - name
        - authScheme
        - toolCount
        - tools
    PublicIntegrationToolkitList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicIntegrationToolkit'
      required:
        - results
    PublicIntegrationUpdateInput:
      type: object
      properties:
        alias:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          example: example
        visibility:
          type: string
          enum:
            - PRIVATE
            - SHARED
          example: PRIVATE
    PublicIntegrationTools:
      type: object
      properties:
        enabledTools:
          type: array
          items:
            type: object
            properties:
              slug:
                type: string
                example: example
              name:
                type: string
                example: example
              description:
                type: string
                example: example
              enabled:
                type: boolean
                example: false
              hasRequiredScopes:
                type: boolean
                example: false
            required:
              - slug
              - name
              - description
              - enabled
              - hasRequiredScopes
        availableTools:
          type: array
          items:
            type: object
            properties:
              slug:
                type: string
                example: example
              name:
                type: string
                example: example
              description:
                type: string
                example: example
              enabled:
                type: boolean
                example: false
              hasRequiredScopes:
                type: boolean
                example: false
            required:
              - slug
              - name
              - description
              - enabled
              - hasRequiredScopes
      required:
        - enabledTools
        - availableTools
    PublicIntegrationSetToolsInput:
      type: object
      properties:
        slugs:
          type: array
          items:
            type: string
            minLength: 1
            example: example
          minItems: 1
      required:
        - slugs
    PublicVisualOptions:
      type: object
      properties:
        iconKeys:
          type: array
          items:
            type: string
            example: example
          description: >-
            Valid icon keys for the `icon`/`emoji` field on objects and record
            types (the IconPicker set).
          example:
            - home
            - users
            - briefcase
            - rocket
        iconColors:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                example: blue
              value:
                type: string
                example: '#60a5fa'
            required:
              - name
              - value
          description: Valid colors for an object/record-type/field `iconColor`.
        optionColors:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                example: blue
              value:
                type: string
                example: '#60a5fa'
            required:
              - name
              - value
          description: >-
            Valid preset colors for tag/select option `color` (note: a different
            palette from iconColor).
        tagModes:
          type: array
          items:
            type: string
            example: example
          example:
            - singleSelect
            - multiSelect
        relationModes:
          type: array
          items:
            type: string
            example: example
          example:
            - single
            - multi
      required:
        - iconKeys
        - iconColors
        - optionColors
        - tagModes
        - relationModes
    PublicFieldGuidance:
      type: object
      properties:
        guidance:
          type: string
          description: >-
            Markdown reference covering every field/column type, its metadata
            shape, and best practices — generated from the same constants the
            create/update schemas validate against.
          example: example
      required:
        - guidance
    PublicNodeTypeList:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                example: TOOLS_AI
              validInFlow:
                type: boolean
                description: Usable in an agent flow (WorkflowType.FLOW).
                example: true
              validInAutomation:
                type: boolean
                description: Usable in an automation workflow (WorkflowType.AUTOMATION).
                example: true
              allowsMultipleOutgoingHandles:
                type: boolean
                description: May fan out to more than one outgoing edge.
                example: true
            required:
              - type
              - validInFlow
              - validInAutomation
              - allowsMultipleOutgoingHandles
      required:
        - results
    PublicNodeGuidance:
      type: object
      properties:
        nodeType:
          type: string
          example: TOOLS_AI
        guidance:
          type: string
          description: >-
            Markdown guidance for configuring this node type. Empty when no
            guidance is published for the type.
          example: example
      required:
        - nodeType
        - guidance
    Me:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - true
          example: true
        data:
          type: object
          properties:
            account:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  example: 1234
                name:
                  type: string
                  example: Acme Inc.
                namespace:
                  type: string
                  example: acme
              required:
                - id
                - name
                - namespace
            user:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  example: 56
                email:
                  type: string
                  example: you@acme.com
              required:
                - id
                - email
              description: Null for GENERAL API keys; populated for USER keys.
          required:
            - account
            - user
      required:
        - ok
        - data
    IncomingWebhookCreateOutput:
      type: object
      properties:
        id:
          type: string
          example: clx123incomingwebhook
        name:
          type: string
          example: External CRM event
        description:
          type: string
          nullable: true
          example: Receives events from the external CRM
        url:
          type: string
          example: https://hooks.example.com/webhook/clx123incomingwebhook
        isActive:
          type: boolean
          example: true
        useAuthentication:
          type: boolean
          example: true
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        accessToken:
          type: string
          nullable: true
          example: 64-character-access-token
      required:
        - id
        - name
        - url
        - isActive
        - useAuthentication
        - createdAt
        - updatedAt
    PublicIncomingWebhookCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: External CRM event
        description:
          type: string
          nullable: true
          example: Receives events from the external CRM
        isActive:
          type: boolean
          default: true
          example: true
        useAuthentication:
          type: boolean
          default: true
          example: true
      required:
        - name
    PublicIncomingWebhook:
      type: object
      properties:
        id:
          type: string
          example: clx123incomingwebhook
        name:
          type: string
          example: External CRM event
        description:
          type: string
          nullable: true
          example: Receives events from the external CRM
        url:
          type: string
          example: https://hooks.example.com/webhook/clx123incomingwebhook
        isActive:
          type: boolean
          example: true
        useAuthentication:
          type: boolean
          example: true
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        accessToken:
          type: string
          nullable: true
          example: 64-character-access-token
      required:
        - id
        - name
        - url
        - isActive
        - useAuthentication
        - createdAt
        - updatedAt
    PublicIncomingWebhookUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: External CRM event
        description:
          type: string
          nullable: true
          example: Receives events from the external CRM
        isActive:
          type: boolean
          example: true
        useAuthentication:
          type: boolean
          example: true
    PublicIncomingWebhookEvent:
      type: object
      properties:
        id:
          type: string
          example: clx987event
        status:
          type: string
          enum:
            - RECEIVED
            - PROCESSING
            - COMPLETED
            - FAILED
            - TIMEOUT
          example: COMPLETED
        payload:
          nullable: true
          description: Raw JSON payload received
          type: object
        payloadSize:
          type: number
          nullable: true
          example: 512
        ipAddress:
          type: string
          nullable: true
          example: 203.0.113.10
        userAgent:
          type: string
          nullable: true
          example: curl/8.4.0
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
      required:
        - id
        - status
        - createdAt
        - updatedAt
    PublicIncomingWebhookEventList:
      type: object
      properties:
        count:
          type: number
          example: 1
        pageSize:
          type: number
          example: 1
        pageNum:
          type: number
          example: 1
        totalPages:
          type: number
          example: 1
        cursor:
          type: number
          example: 1
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicIncomingWebhookEvent'
        paginationType:
          type: string
          enum:
            - offset
            - cursor
          default: offset
          example: offset
        nextCursor:
          anyOf:
            - type: string
              example: example
            - type: number
              example: 1
            - nullable: true
              type: object
      required:
        - pageSize
        - results
    PublicIncomingWebhookEventDetail:
      allOf:
        - $ref: '#/components/schemas/PublicIncomingWebhookEvent'
        - type: object
          properties:
            automations:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                    example: 42
                  name:
                    type: string
                    example: Notify sales channel
                  status:
                    type: string
                    nullable: true
                    example: ACTIVE
                required:
                  - id
                  - name
    AiModel:
      type: object
      properties:
        id:
          type: number
          example: 1
        name:
          type: string
          example: example
        description:
          type: string
          nullable: true
          example: example
        creditsPerMessage:
          type: number
          example: 1
        isDefault:
          type: boolean
          example: false
        order:
          type: number
          example: 1
        analyticsColor:
          type: string
          nullable: true
          example: example
        externalId:
          type: string
          nullable: true
          example: example
        aiVendor:
          type: string
          example: example
        reasoningModel:
          type: boolean
          example: false
        type:
          type: string
          enum:
            - TEXT
            - TRANSCRIPTION
            - FILE_ANALYSIS
          example: TEXT
      required:
        - id
        - name
    CustomTool:
      type: object
      properties:
        id:
          type: number
          example: 123
        name:
          type: string
          example: Fetch contact
        description:
          type: string
          example: Fetches a contact from the external CRM
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        status:
          type: string
          nullable: true
          enum:
            - PAUSED
            - ACTIVE
            - DELETED
          example: ACTIVE
        method:
          type: string
          nullable: true
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          example: GET
        url:
          type: string
          nullable: true
          example: https://api.example.com/contacts/123
        body:
          type: string
          nullable: true
          example: example
        arguments:
          type: array
          nullable: true
          items:
            type: object
            properties:
              name:
                type: string
                example: example
              description:
                type: string
                nullable: true
                example: example
              dataType:
                type: string
                enum:
                  - STRING
                  - NUMBER
                  - DECIMAL
                  - BOOLEAN
                example: STRING
              required:
                type: boolean
                nullable: true
                example: false
              defaultValue:
                type: string
                nullable: true
                example: example
            required:
              - name
              - dataType
        headers:
          type: array
          nullable: true
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                example: Authorization
              value:
                type: string
                example: Bearer {apiKey}
            required:
              - key
              - value
        queryParams:
          type: array
          nullable: true
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                example: limit
              value:
                type: string
                example: '10'
            required:
              - key
              - value
        type:
          type: string
          enum:
            - API_CALL
            - WHATSAPP_TEMPLATE_MESSAGE
          example: API_CALL
      required:
        - id
        - name
        - description
        - createdAt
        - updatedAt
        - type
    Variable:
      type: object
      properties:
        id:
          type: number
          example: 123
        name:
          type: string
          example: customer_name
        description:
          type: string
          nullable: true
          example: example
        status:
          type: string
          enum:
            - ACTIVE
            - DELETED
          example: ACTIVE
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        assistantId:
          type: string
          nullable: true
          example: example
        automationId:
          type: number
          nullable: true
          example: 1
        pattern:
          type: string
          nullable: true
          example: example
        defaultValue:
          type: string
          nullable: true
          example: example
        isDefault:
          type: boolean
          example: false
      required:
        - id
        - name
        - status
        - createdAt
        - updatedAt
        - isDefault
    PublicFlowVariableCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: customer_name
        description:
          type: string
          nullable: true
          example: Customer name captured during the conversation
        pattern:
          type: string
          nullable: true
          example: ^[A-Za-z ]+$
      required:
        - name
    VariableCheckName:
      type: object
      properties:
        exists:
          type: boolean
          example: false
      required:
        - exists
    PublicVariableUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: customer_name
        description:
          type: string
          nullable: true
          example: Customer name captured during the conversation
        pattern:
          type: string
          nullable: true
          example: ^[A-Za-z ]+$
      required:
        - name
    PublicWorkflowVariableCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: customer_name
        description:
          type: string
          nullable: true
          example: Customer name captured during the conversation
        pattern:
          type: string
          nullable: true
          example: ^[A-Za-z ]+$
      required:
        - name
    Intent:
      type: object
      properties:
        id:
          type: number
          example: 10
        name:
          type: string
          example: Cancel order
        description:
          type: string
          nullable: true
          example: example
        createdAt:
          type: string
          nullable: true
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          nullable: true
          example: '2024-01-01T12:00:00Z'
        status:
          type: string
          enum:
            - ACTIVE
            - DELETED
          example: ACTIVE
        assistantId:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        phrases:
          type: array
          items:
            type: object
            properties:
              id:
                type: number
                example: 1
              phrase:
                type: string
                example: cancel my order
            required:
              - id
              - phrase
        flowId:
          type: number
          nullable: true
          example: 1
      required:
        - id
        - name
        - createdAt
        - updatedAt
        - status
        - assistantId
    PublicIntentCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Cancel order
        description:
          type: string
          nullable: true
          example: User wants to cancel
        phrases:
          type: array
          items:
            type: string
            example: example
          minItems: 1
          example:
            - cancel my order
      required:
        - name
        - phrases
    PublicIntentGeneratePhrasesOutput:
      type: object
      properties:
        phrases:
          type: array
          items:
            type: string
            example: example
          example:
            - I want to cancel my order
      required:
        - phrases
    PublicIntentGeneratePhrasesInput:
      type: object
      properties:
        name:
          type: string
          example: Cancel order
        samples:
          type: array
          items:
            type: string
            example: example
          example:
            - cancel my order
            - stop the order
        amount:
          type: integer
          minimum: 1
          maximum: 50
          example: 10
      required:
        - name
        - samples
        - amount
    PublicIntentUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Cancel order
        description:
          type: string
          nullable: true
          example: User wants to cancel
        phrases:
          type: array
          items:
            type: object
            properties:
              id:
                type: number
                nullable: true
                example: 1
              phrase:
                type: string
                example: cancel my order
            required:
              - phrase
          minItems: 1
      required:
        - name
        - phrases
    PublicToolCreateInput:
      type: object
      properties:
        type:
          type: string
          enum:
            - API_CALL
          default: API_CALL
          example: API_CALL
        name:
          type: string
          minLength: 1
          maxLength: 256
          example: Fetch contact
        description:
          type: string
          maxLength: 1000
          example: Fetches a contact from the external CRM
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          example: GET
        url:
          type: string
          format: uri
          example: https://api.example.com/contacts/123
        body:
          type: string
          description: >-
            Raw request body template (typically a JSON string). Interpolate
            argument values with single braces, e.g. {contactName} (not double
            braces).
          example: '{"name":"{contactName}"}'
        arguments:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                example: contactId
              description:
                type: string
                minLength: 1
                example: The contact ID to fetch
              dataType:
                type: string
                enum:
                  - STRING
                  - NUMBER
                  - DECIMAL
                  - BOOLEAN
                description: >-
                  Argument type. Use STRING, NUMBER (covers decimals), or
                  BOOLEAN. DECIMAL is accepted but not shown in the app UI —
                  prefer NUMBER.
                example: STRING
              required:
                type: boolean
                default: true
                description: >-
                  Whether the caller must provide this argument. Defaults to
                  true.
                example: true
              defaultValue:
                type: string
                description: >-
                  Fallback value (as a string, coerced to dataType) used when
                  the argument is omitted.
                example: normal
            required:
              - name
              - dataType
        headers:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                example: Authorization
              value:
                type: string
                example: Bearer {apiKey}
            required:
              - key
              - value
        queryParams:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                example: limit
              value:
                type: string
                example: '10'
            required:
              - key
              - value
      required:
        - name
        - description
        - method
        - url
    PublicToolTestOutput:
      type: object
      properties:
        status:
          type: number
          example: 200
        headers:
          type: object
          additionalProperties:
            type: string
            example: example
          example:
            content-type: application/json
        data:
          nullable: true
          type: object
        duration:
          type: number
          description: Request duration in milliseconds
          example: 245
        contentLength:
          type: number
          nullable: true
          example: 128
      required:
        - status
        - headers
        - duration
    PublicToolTestInput:
      type: object
      properties:
        values:
          type: object
          additionalProperties: {}
          default: {}
          description: >-
            Argument values keyed by argument name. Every declared tool argument
            must be present.
          example:
            contactId: '42'
    PublicToolUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
          example: Fetch contact
        description:
          type: string
          maxLength: 1000
          example: Fetches a contact from the external CRM
        status:
          type: string
          enum:
            - ACTIVE
            - PAUSED
          example: ACTIVE
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          example: GET
        url:
          type: string
          format: uri
          example: https://api.example.com/contacts/123
        body:
          type: string
          description: >-
            Raw request body template (typically a JSON string). Interpolate
            argument values with single braces, e.g. {contactName} (not double
            braces).
          example: '{"name":"{contactName}"}'
        arguments:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                example: contactId
              description:
                type: string
                minLength: 1
                example: The contact ID to fetch
              dataType:
                type: string
                enum:
                  - STRING
                  - NUMBER
                  - DECIMAL
                  - BOOLEAN
                description: >-
                  Argument type. Use STRING, NUMBER (covers decimals), or
                  BOOLEAN. DECIMAL is accepted but not shown in the app UI —
                  prefer NUMBER.
                example: STRING
              required:
                type: boolean
                default: true
                description: >-
                  Whether the caller must provide this argument. Defaults to
                  true.
                example: true
              defaultValue:
                type: string
                description: >-
                  Fallback value (as a string, coerced to dataType) used when
                  the argument is omitted.
                example: normal
            required:
              - name
              - dataType
        headers:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                example: Authorization
              value:
                type: string
                example: Bearer {apiKey}
            required:
              - key
              - value
        queryParams:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                example: limit
              value:
                type: string
                example: '10'
            required:
              - key
              - value
    Agent:
      type: object
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          example: Support Bot
        description:
          type: string
          nullable: true
          example: Main customer support agent
        status:
          type: string
          enum:
            - NONE
            - ACTIVE
            - INACTIVE
            - TRAINING
            - TRAIN_ERROR
          example: ACTIVE
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
      required:
        - id
        - name
        - description
        - status
        - createdAt
        - updatedAt
    AgentTheme:
      type: object
      nullable: true
      properties:
        id:
          type: number
          example: 1
        assistantId:
          type: string
          example: example
        avatar:
          type: string
          nullable: true
          example: example
        bubbleImage:
          type: string
          nullable: true
          example: example
        title:
          type: string
          example: example
        initialMessage:
          type: string
          example: example
        placeholder:
          type: string
          example: example
        bubbleColor:
          type: string
          example: example
        userMessageColor:
          type: string
          example: example
        agentMessageColor:
          type: string
          nullable: true
          example: example
        bubbleAlignment:
          type: string
          enum:
            - RIGHT
            - LEFT
          example: RIGHT
        progressIndicator:
          type: string
          enum:
            - STATIC
            - DYNAMIC
          example: STATIC
        verticalPositionInPixels:
          type: number
          example: 1
        removePowerBy:
          type: boolean
          example: false
        updatedAt:
          type: string
          example: example
      required:
        - id
        - avatar
        - bubbleImage
        - title
        - initialMessage
        - placeholder
        - bubbleColor
        - userMessageColor
        - agentMessageColor
        - bubbleAlignment
        - progressIndicator
        - verticalPositionInPixels
    AgentSetting:
      type: object
      nullable: true
      properties:
        id:
          type: number
          example: 1
        aiModelId:
          type: number
          nullable: true
          example: 1
        aiModel:
          allOf:
            - $ref: '#/components/schemas/AiModel'
          nullable: true
          type: object
        model:
          type: string
          nullable: true
          example: example
        aiType:
          type: string
          enum:
            - ASSISTANT
            - AGENT
          example: ASSISTANT
        temperature:
          type: number
          example: 1
        instructions:
          type: string
          nullable: true
          example: example
        agentRole:
          type: string
          enum:
            - NONE
            - CUSTOM
            - CUSTOMER_SUPPORT
            - SALES_REPRESENTATIVE
            - COLLECTIONS
            - RECRUITING_AGENT
            - HR_MANAGER
            - PRODUCT_COPILOT
            - AI_ASSISTANT
            - ANALYST
            - POST_SALES
          example: NONE
        toneOfVoice:
          type: string
          enum:
            - NONE
            - CUSTOM
            - FRIENDLY
            - NEUTRAL
            - MATTER_OF_FACT
            - PROFESSIONAL
            - HUMOROUS
            - WITTY
            - GEN_Z
          example: NONE
        answerLength:
          type: string
          enum:
            - NONE
            - CUSTOM
            - DYNAMIC
            - CONCISE
            - STANDARD
            - THOROUGH
          example: NONE
        maxIterations:
          type: number
          example: 1
        agentType:
          type: string
          enum:
            - BASIC
            - ADVANCED
          example: BASIC
        customTools:
          type: array
          nullable: true
          items:
            type: object
            properties:
              id:
                type: number
                example: 1
              name:
                type: string
                example: example
              description:
                type: string
                nullable: true
                example: example
              status:
                type: string
                nullable: true
                example: example
              type:
                type: string
                nullable: true
                example: example
            required:
              - id
              - name
        systemToolsConfig:
          nullable: true
          type: object
        selectedRecordTypes:
          type: array
          nullable: true
          items:
            type: object
            properties:
              recordTypeId:
                type: number
                example: 1
              read:
                type: boolean
                example: false
              create:
                type: boolean
                example: false
              update:
                type: boolean
                example: false
              delete:
                type: boolean
                example: false
              createActivity:
                type: boolean
                example: false
            required:
              - recordTypeId
        agentConnectedAccounts:
          type: array
          nullable: true
          items:
            type: object
            properties:
              connectedAccountId:
                type: number
                example: 1
              useAllTools:
                type: boolean
                example: false
              selectedToolSlugs:
                type: array
                nullable: true
                items:
                  type: string
                  example: example
              connectedAccount:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  toolkit:
                    type: string
                    example: example
                  alias:
                    type: string
                    nullable: true
                    example: example
                  connectedEmail:
                    type: string
                    nullable: true
                    example: example
                  isConnected:
                    type: boolean
                    example: false
                required:
                  - id
                  - toolkit
                  - alias
                  - connectedEmail
                  - isConnected
            required:
              - connectedAccountId
              - useAllTools
        agentPlaybooks:
          type: array
          nullable: true
          items:
            type: object
            properties:
              playbookId:
                type: number
                example: 1
              assignedAt:
                type: string
                example: example
              playbook:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  name:
                    type: string
                    example: example
                  description:
                    type: string
                    nullable: true
                    example: example
                required:
                  - id
                  - name
            required:
              - playbookId
      required:
        - id
    AgentDetail:
      allOf:
        - $ref: '#/components/schemas/Agent'
        - type: object
          properties:
            isOffline:
              type: boolean
              example: false
            ownerId:
              type: number
              example: 1
            accountId:
              type: number
              example: 1
            theme:
              $ref: '#/components/schemas/AgentTheme'
            agentSetting:
              $ref: '#/components/schemas/AgentSetting'
            channel:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  example: 1
                channelLiveChat:
                  type: object
                  nullable: true
                  properties:
                    splitMessages:
                      type: boolean
                      example: false
                    splitCharacterLimit:
                      type: integer
                      example: 1
                    closeAfter:
                      type: number
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    conversationClose:
                      type: string
                      enum:
                        - NEVER
                        - AUTOMATICALLY
                        - DYNAMICALLY
                      example: NEVER
                    collectFeedback:
                      type: boolean
                      example: false
                    feedbackVisibility:
                      type: string
                      enum:
                        - ON_HOVER
                        - ALWAYS_VISIBLE
                      example: ON_HOVER
                    feedbackText:
                      type: string
                      nullable: true
                      example: example
                    collectFeedbackReason:
                      type: boolean
                      example: false
                    includeOtherReason:
                      type: boolean
                      example: false
                    openFeedbackText:
                      type: string
                      nullable: true
                      example: example
                    feedbackReasons:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          id:
                            type: number
                            example: 1
                          reason:
                            type: string
                            example: example
                          order:
                            type: number
                            example: 1
                        required:
                          - id
                          - reason
                          - order
                    enableDocumentProcessing:
                      type: boolean
                      example: false
                    enableImageProcessing:
                      type: boolean
                      example: false
                    enableIdle:
                      type: boolean
                      example: false
                    idleSettings:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: number
                          nullable: true
                          example: 1
                        after:
                          type: number
                          nullable: true
                          example: 1
                        timeUnit:
                          type: string
                          nullable: true
                          enum:
                            - MINUTES
                            - HOURS
                          example: MINUTES
                        resetsLimit:
                          type: number
                          nullable: true
                          example: 1
                      required:
                        - after
                        - timeUnit
                        - resetsLimit
                    id:
                      type: number
                      example: 1
                  required:
                    - splitMessages
                    - splitCharacterLimit
                    - closeAfter
                    - timeUnit
                    - conversationClose
                    - collectFeedback
                    - feedbackVisibility
                    - feedbackText
                    - collectFeedbackReason
                    - includeOtherReason
                    - openFeedbackText
                    - enableIdle
                    - id
                channelWhatsapp:
                  type: object
                  nullable: true
                  properties:
                    splitMessages:
                      type: boolean
                      example: false
                    splitCharacterLimit:
                      type: integer
                      example: 1
                    closeAfter:
                      type: number
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    conversationClose:
                      type: string
                      nullable: true
                      enum:
                        - NEVER
                        - AUTOMATICALLY
                        - DYNAMICALLY
                      example: NEVER
                    enableDocumentProcessing:
                      type: boolean
                      example: false
                    enableImageProcessing:
                      type: boolean
                      example: false
                    debounce:
                      type: boolean
                      example: false
                    debounceTime:
                      type: integer
                      minimum: 0
                      example: 0
                    enableIdle:
                      type: boolean
                      example: false
                    idleSettings:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: number
                          nullable: true
                          example: 1
                        after:
                          type: number
                          nullable: true
                          example: 1
                        timeUnit:
                          type: string
                          nullable: true
                          enum:
                            - MINUTES
                            - HOURS
                          example: MINUTES
                        resetsLimit:
                          type: number
                          nullable: true
                          example: 1
                      required:
                        - after
                        - timeUnit
                        - resetsLimit
                    conversationInterruptTimeout:
                      type: integer
                      minimum: 0
                      example: 0
                    conversationInterruptTimeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    sendCloseMessage:
                      type: boolean
                      example: false
                    closeMessageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                      example: STATIC
                    closeMessage:
                      type: string
                      nullable: true
                      example: example
                    closeInstruction:
                      type: string
                      nullable: true
                      example: example
                    autoReplyOnUninterrupt:
                      type: boolean
                      example: false
                    id:
                      type: number
                      example: 1
                  required:
                    - splitMessages
                    - splitCharacterLimit
                    - enableIdle
                    - sendCloseMessage
                    - closeMessageType
                    - id
                channelInstagram:
                  type: object
                  nullable: true
                  properties:
                    splitMessages:
                      type: boolean
                      example: false
                    splitCharacterLimit:
                      type: integer
                      example: 1
                    closeAfter:
                      type: number
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    conversationClose:
                      type: string
                      nullable: true
                      enum:
                        - NEVER
                        - AUTOMATICALLY
                        - DYNAMICALLY
                      example: NEVER
                    enableImageProcessing:
                      type: boolean
                      example: false
                    enableIdle:
                      type: boolean
                      example: false
                    idleSettings:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: number
                          nullable: true
                          example: 1
                        after:
                          type: number
                          nullable: true
                          example: 1
                        timeUnit:
                          type: string
                          nullable: true
                          enum:
                            - MINUTES
                            - HOURS
                          example: MINUTES
                        resetsLimit:
                          type: number
                          nullable: true
                          example: 1
                      required:
                        - after
                        - timeUnit
                        - resetsLimit
                    conversationInterruptTimeout:
                      type: integer
                      minimum: 0
                      example: 0
                    conversationInterruptTimeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    sendCloseMessage:
                      type: boolean
                      example: false
                    closeMessageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                      example: STATIC
                    closeMessage:
                      type: string
                      nullable: true
                      example: example
                    closeInstruction:
                      type: string
                      nullable: true
                      example: example
                    autoReplyOnUninterrupt:
                      type: boolean
                      example: false
                    id:
                      type: number
                      example: 1
                  required:
                    - splitMessages
                    - splitCharacterLimit
                    - enableIdle
                    - sendCloseMessage
                    - closeMessageType
                    - id
                channelMessenger:
                  type: object
                  nullable: true
                  properties:
                    splitMessages:
                      type: boolean
                      example: false
                    splitCharacterLimit:
                      type: integer
                      example: 1
                    closeAfter:
                      type: number
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    conversationClose:
                      type: string
                      nullable: true
                      enum:
                        - NEVER
                        - AUTOMATICALLY
                        - DYNAMICALLY
                      example: NEVER
                    enableImageProcessing:
                      type: boolean
                      example: false
                    enableIdle:
                      type: boolean
                      example: false
                    idleSettings:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: number
                          nullable: true
                          example: 1
                        after:
                          type: number
                          nullable: true
                          example: 1
                        timeUnit:
                          type: string
                          nullable: true
                          enum:
                            - MINUTES
                            - HOURS
                          example: MINUTES
                        resetsLimit:
                          type: number
                          nullable: true
                          example: 1
                      required:
                        - after
                        - timeUnit
                        - resetsLimit
                    conversationInterruptTimeout:
                      type: integer
                      minimum: 0
                      example: 0
                    conversationInterruptTimeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    autoReplyOnUninterrupt:
                      type: boolean
                      example: false
                    sendCloseMessage:
                      type: boolean
                      example: false
                    closeMessageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                      example: STATIC
                    closeMessage:
                      type: string
                      nullable: true
                      example: example
                    closeInstruction:
                      type: string
                      nullable: true
                      example: example
                    id:
                      type: number
                      example: 1
                  required:
                    - splitMessages
                    - splitCharacterLimit
                    - enableIdle
                    - sendCloseMessage
                    - closeMessageType
                    - id
              required:
                - id
          required:
            - isOffline
            - accountId
    PublicAgentCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Support Agent
      required:
        - name
    PublicAgentUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
          example: Support Agent
      required:
        - name
    PublicAgentSettingUpdateInput:
      type: object
      properties:
        aiModelId:
          type: number
          nullable: true
          example: 1
        temperature:
          type: number
          minimum: 0
          maximum: 1
          example: 0
        instructions:
          type: string
          nullable: true
          example: example
        maxIterations:
          type: number
          minimum: 3
          maximum: 30
          default: 10
          example: 3
        agentType:
          type: string
          enum:
            - BASIC
            - ADVANCED
          default: BASIC
          example: BASIC
        customToolIds:
          type: array
          nullable: true
          items:
            type: number
            example: 1
        connectedAccountConfigs:
          type: array
          nullable: true
          items:
            type: object
            properties:
              connectedAccountId:
                type: number
                example: 1
              useAllTools:
                type: boolean
                default: true
                example: false
              selectedToolSlugs:
                type: array
                nullable: true
                items:
                  type: string
                  example: example
            required:
              - connectedAccountId
        systemToolsConfig:
          type: object
          nullable: true
          properties:
            webSearchEnabled:
              type: boolean
              default: false
              example: false
            urlScrapeEnabled:
              type: boolean
              default: false
              example: false
            linkedinSearchEnabled:
              type: boolean
              default: false
              example: false
        selectedRecordTypes:
          type: array
          nullable: true
          items:
            type: object
            properties:
              recordTypeId:
                type: number
                example: 1
              read:
                type: boolean
                example: false
              create:
                type: boolean
                example: false
              update:
                type: boolean
                example: false
              delete:
                type: boolean
                example: false
              createActivity:
                type: boolean
                example: false
            required:
              - recordTypeId
      required:
        - aiModelId
        - temperature
        - instructions
    PublicAgentThemeUpdateOutput:
      type: object
      properties:
        id:
          type: number
          example: 1
        assistantId:
          type: string
          example: example
        avatar:
          type: string
          nullable: true
          example: example
        bubbleImage:
          type: string
          nullable: true
          example: example
        title:
          type: string
          example: example
        initialMessage:
          type: string
          example: example
        placeholder:
          type: string
          example: example
        bubbleColor:
          type: string
          example: example
        userMessageColor:
          type: string
          example: example
        agentMessageColor:
          type: string
          nullable: true
          example: example
        bubbleAlignment:
          type: string
          enum:
            - RIGHT
            - LEFT
          example: RIGHT
        progressIndicator:
          type: string
          enum:
            - STATIC
            - DYNAMIC
          example: STATIC
        verticalPositionInPixels:
          type: number
          example: 1
        updatedAt:
          type: string
          example: example
      required:
        - id
        - assistantId
        - avatar
        - bubbleImage
        - title
        - initialMessage
        - placeholder
        - bubbleColor
        - userMessageColor
        - agentMessageColor
        - bubbleAlignment
        - progressIndicator
        - verticalPositionInPixels
        - updatedAt
    PublicAgentThemeUpdateInput:
      type: object
      properties:
        avatar:
          type: string
          nullable: true
          example: example
        bubbleImage:
          type: string
          nullable: true
          example: example
        title:
          type: string
          example: example
        initialMessage:
          type: string
          example: example
        placeholder:
          type: string
          example: example
        bubbleColor:
          type: string
          example: example
        userMessageColor:
          type: string
          example: example
        agentMessageColor:
          type: string
          nullable: true
          example: example
        bubbleAlignment:
          type: string
          enum:
            - RIGHT
            - LEFT
          example: RIGHT
        progressIndicator:
          type: string
          enum:
            - STATIC
            - DYNAMIC
          example: STATIC
        verticalPositionInPixels:
          type: number
          example: 1
      required:
        - avatar
        - bubbleImage
        - title
        - initialMessage
        - placeholder
        - bubbleColor
        - userMessageColor
        - agentMessageColor
        - bubbleAlignment
        - progressIndicator
        - verticalPositionInPixels
    PublicAgentDeploymentStatusInput:
      type: object
      properties:
        isOffline:
          type: boolean
          example: false
      required:
        - isOffline
    AgentChannelSettings:
      type: object
      properties:
        liveChat:
          type: object
          properties:
            splitMessages:
              type: boolean
              example: false
            splitCharacterLimit:
              type: integer
              example: 1
            closeAfter:
              type: number
              nullable: true
              example: 1
            timeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            conversationClose:
              type: string
              enum:
                - NEVER
                - AUTOMATICALLY
                - DYNAMICALLY
              example: NEVER
            collectFeedback:
              type: boolean
              example: false
            feedbackVisibility:
              type: string
              enum:
                - ON_HOVER
                - ALWAYS_VISIBLE
              example: ON_HOVER
            feedbackText:
              type: string
              nullable: true
              example: example
            collectFeedbackReason:
              type: boolean
              example: false
            includeOtherReason:
              type: boolean
              example: false
            openFeedbackText:
              type: string
              nullable: true
              example: example
            feedbackReasons:
              type: array
              nullable: true
              items:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  reason:
                    type: string
                    example: example
                  order:
                    type: number
                    example: 1
                required:
                  - id
                  - reason
                  - order
            enableDocumentProcessing:
              type: boolean
              example: false
            enableImageProcessing:
              type: boolean
              example: false
            enableIdle:
              type: boolean
              example: false
            idleSettings:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  nullable: true
                  example: 1
                after:
                  type: number
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                resetsLimit:
                  type: number
                  nullable: true
                  example: 1
              required:
                - after
                - timeUnit
                - resetsLimit
          required:
            - splitMessages
            - splitCharacterLimit
            - closeAfter
            - timeUnit
            - conversationClose
            - collectFeedback
            - feedbackVisibility
            - feedbackText
            - collectFeedbackReason
            - includeOtherReason
            - openFeedbackText
            - enableIdle
        whatsApp:
          type: object
          properties:
            splitMessages:
              type: boolean
              example: false
            splitCharacterLimit:
              type: integer
              example: 1
            closeAfter:
              type: number
              nullable: true
              example: 1
            timeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            conversationClose:
              type: string
              nullable: true
              enum:
                - NEVER
                - AUTOMATICALLY
                - DYNAMICALLY
              example: NEVER
            enableDocumentProcessing:
              type: boolean
              example: false
            enableImageProcessing:
              type: boolean
              example: false
            debounce:
              type: boolean
              example: false
            debounceTime:
              type: integer
              minimum: 0
              example: 0
            enableIdle:
              type: boolean
              example: false
            idleSettings:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  nullable: true
                  example: 1
                after:
                  type: number
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                resetsLimit:
                  type: number
                  nullable: true
                  example: 1
              required:
                - after
                - timeUnit
                - resetsLimit
            conversationInterruptTimeout:
              type: integer
              minimum: 0
              example: 0
            conversationInterruptTimeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            sendCloseMessage:
              type: boolean
              example: false
            closeMessageType:
              type: string
              enum:
                - STATIC
                - DYNAMIC
              example: STATIC
            closeMessage:
              type: string
              nullable: true
              example: example
            closeInstruction:
              type: string
              nullable: true
              example: example
            autoReplyOnUninterrupt:
              type: boolean
              example: false
          required:
            - splitMessages
            - splitCharacterLimit
            - enableIdle
            - sendCloseMessage
            - closeMessageType
        instagram:
          type: object
          properties:
            splitMessages:
              type: boolean
              example: false
            splitCharacterLimit:
              type: integer
              example: 1
            closeAfter:
              type: number
              nullable: true
              example: 1
            timeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            conversationClose:
              type: string
              nullable: true
              enum:
                - NEVER
                - AUTOMATICALLY
                - DYNAMICALLY
              example: NEVER
            enableImageProcessing:
              type: boolean
              example: false
            enableIdle:
              type: boolean
              example: false
            idleSettings:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  nullable: true
                  example: 1
                after:
                  type: number
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                resetsLimit:
                  type: number
                  nullable: true
                  example: 1
              required:
                - after
                - timeUnit
                - resetsLimit
            conversationInterruptTimeout:
              type: integer
              minimum: 0
              example: 0
            conversationInterruptTimeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            sendCloseMessage:
              type: boolean
              example: false
            closeMessageType:
              type: string
              enum:
                - STATIC
                - DYNAMIC
              example: STATIC
            closeMessage:
              type: string
              nullable: true
              example: example
            closeInstruction:
              type: string
              nullable: true
              example: example
            autoReplyOnUninterrupt:
              type: boolean
              example: false
          required:
            - splitMessages
            - splitCharacterLimit
            - enableIdle
            - sendCloseMessage
            - closeMessageType
        messenger:
          type: object
          properties:
            splitMessages:
              type: boolean
              example: false
            splitCharacterLimit:
              type: integer
              example: 1
            closeAfter:
              type: number
              nullable: true
              example: 1
            timeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            conversationClose:
              type: string
              nullable: true
              enum:
                - NEVER
                - AUTOMATICALLY
                - DYNAMICALLY
              example: NEVER
            enableImageProcessing:
              type: boolean
              example: false
            enableIdle:
              type: boolean
              example: false
            idleSettings:
              type: object
              nullable: true
              properties:
                id:
                  type: number
                  nullable: true
                  example: 1
                after:
                  type: number
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                resetsLimit:
                  type: number
                  nullable: true
                  example: 1
              required:
                - after
                - timeUnit
                - resetsLimit
            conversationInterruptTimeout:
              type: integer
              minimum: 0
              example: 0
            conversationInterruptTimeUnit:
              type: string
              nullable: true
              enum:
                - MINUTES
                - HOURS
              example: MINUTES
            autoReplyOnUninterrupt:
              type: boolean
              example: false
            sendCloseMessage:
              type: boolean
              example: false
            closeMessageType:
              type: string
              enum:
                - STATIC
                - DYNAMIC
              example: STATIC
            closeMessage:
              type: string
              nullable: true
              example: example
            closeInstruction:
              type: string
              nullable: true
              example: example
          required:
            - splitMessages
            - splitCharacterLimit
            - enableIdle
            - sendCloseMessage
            - closeMessageType
      required:
        - liveChat
        - whatsApp
        - instagram
        - messenger
    Flow:
      type: object
      properties:
        id:
          type: number
          example: 101
        name:
          type: string
          example: Order Retrieval
        description:
          type: string
          nullable: true
          example: Extracts order info from DB
        status:
          type: string
          enum:
            - ACTIVE
            - SUSPENDED
            - DELETED
            - DRAFT
          example: ACTIVE
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        runCount:
          type: number
          example: 450
      required:
        - id
        - name
        - description
        - status
        - createdAt
        - updatedAt
        - runCount
    DynamicTablesQueryCondition:
      type: object
      properties:
        path:
          type: string
          description: Field path in format [Field] or [Relation].[Field]
          example: '[Status]'
        operator:
          type: string
          example: equals
        value:
          nullable: true
          type: object
        valueType:
          nullable: true
          type: object
      required:
        - path
        - operator
    DynamicTablesQueryGroup:
      type: object
      properties:
        operator:
          type: string
          enum:
            - and
            - or
          example: and
        conditions:
          type: array
          items:
            nullable: true
            type: object
          description: Nested filter conditions or AND/OR groups
      required:
        - operator
        - conditions
    DynamicTablesQuery:
      anyOf:
        - $ref: '#/components/schemas/DynamicTablesQueryCondition'
        - $ref: '#/components/schemas/DynamicTablesQueryGroup'
        - nullable: true
          type: object
    PublicFlowNode:
      type: object
      properties:
        nodeId:
          type: string
          pattern: >-
            node[_-][0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}
          example: node_550e8400-e29b-41d4-a716-446655440000
        alias:
          type: string
          nullable: true
          example: Start
        name:
          type: string
          example: Start
        position:
          type: object
          properties:
            positionX:
              type: number
              example: 1
            positionY:
              type: number
              example: 1
          required:
            - positionX
            - positionY
        type:
          type: string
          enum:
            - START
            - TRIGGER_INTENT
            - SAY_AI
            - RESPONSE_AI
            - TOOLS_AI
            - API
            - CONDITIONAL_ROUTING
            - DYNAMIC_TABLES
          example: START
        data:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TRIGGER_INTENT
                  example: TRIGGER_INTENT
                agenticRouting:
                  type: string
                  nullable: true
                  example: example
                intentIds:
                  type: array
                  nullable: true
                  items:
                    type: number
                    example: 1
                intents:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      description:
                        type: string
                        nullable: true
                        example: example
                      createdAt:
                        type: string
                        nullable: true
                        example: example
                      updatedAt:
                        type: string
                        nullable: true
                        example: example
                      status:
                        type: string
                        enum:
                          - ACTIVE
                          - DELETED
                        example: ACTIVE
                      assistantId:
                        type: string
                        example: example
                      phrases:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            phrase:
                              type: string
                              example: example
                          required:
                            - id
                            - phrase
                      flowId:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - id
                      - name
                      - createdAt
                      - updatedAt
                      - status
                      - assistantId
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SAY_AI
                  example: SAY_AI
                message:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  default: 0.7
                  example: 1
                prompt:
                  type: string
                  nullable: true
                  example: example
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                model:
                  type: string
                  nullable: true
                  example: example
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                sayWithAi:
                  type: boolean
                  example: false
              required:
                - type
                - sayWithAi
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - RESPONSE_AI
                  example: RESPONSE_AI
                assistantId:
                  type: string
                  format: uuid
                  description: >-
                    Owning assistant UUID. Validated against the account on
                    save.
                  example: 550e8400-e29b-41d4-a716-446655440000
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  example: 1
                captureVariables:
                  type: array
                  items:
                    nullable: true
                    type: object
                exitNodeWhen:
                  type: string
                  enum:
                    - ALL_VARIABLES
                    - FLOW_TRIGGERED
                    - ANY_VARIABLES
                  example: ALL_VARIABLES
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
              required:
                - type
                - assistantId
                - model
                - aiVendor
                - instructions
                - temperature
                - captureVariables
                - exitNodeWhen
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TOOLS_AI
                  example: TOOLS_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                customToolIds:
                  type: array
                  nullable: true
                  items:
                    type: number
                    example: 1
                maxIterations:
                  type: number
                  minimum: 1
                  maximum: 30
                  default: 10
                  example: 1
                agentType:
                  type: string
                  enum:
                    - BASIC
                    - ADVANCED
                  default: BASIC
                  example: BASIC
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    type: object
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                selectedRecordTypes:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      recordTypeId:
                        type: number
                        example: 1
                      read:
                        type: boolean
                        example: false
                      create:
                        type: boolean
                        example: false
                      update:
                        type: boolean
                        example: false
                      delete:
                        type: boolean
                        example: false
                      createActivity:
                        type: boolean
                        example: false
                    required:
                      - recordTypeId
                systemToolsConfig:
                  type: object
                  nullable: true
                  properties:
                    webSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                    urlScrapeEnabled:
                      type: boolean
                      default: false
                      example: false
                    linkedinSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                connectedAccountConfigs:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      connectedAccountId:
                        type: number
                        example: 1
                      useAllTools:
                        type: boolean
                        default: true
                        example: false
                      selectedToolSlugs:
                        type: array
                        nullable: true
                        items:
                          type: string
                          example: example
                    required:
                      - connectedAccountId
                playbookIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - conditions
                - instructions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - API
                  example: API
                url:
                  type: string
                  format: uri
                  example: https://api.example.com/hook
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - DELETE
                    - PATCH
                  example: GET
                headers:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                body:
                  type: string
                  nullable: true
                  example: example
                response:
                  type: string
                  nullable: true
                  example: example
                parameters:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                variables:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                      fullResponse:
                        type: boolean
                        default: false
                        example: false
                    required:
                      - key
                      - value
              required:
                - type
                - url
                - method
                - headers
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - CONDITIONAL_ROUTING
                  example: CONDITIONAL_ROUTING
                routingType:
                  type: string
                  enum:
                    - CONDITIONAL_AI
                    - DYNAMIC
                  example: CONDITIONAL_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - routingType
                - conditions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - DYNAMIC_TABLES
                  example: DYNAMIC_TABLES
                tableId:
                  type: number
                  nullable: true
                  example: 1
                recordTypeId:
                  type: number
                  nullable: true
                  example: 1
                targetRecordTypeId:
                  type: number
                  nullable: true
                  description: >-
                    Destination record type id. Required when actionType is
                    CHANGE_RECORD_TYPE.
                  example: 12
                actionType:
                  type: string
                  nullable: true
                  enum:
                    - CREATE
                    - UPDATE
                    - DELETE
                    - SEARCH
                    - SEARCH_BY_ID
                    - CHANGE_RECORD_TYPE
                  description: >-
                    Operation to run. Required-field rules per action: CREATE →
                    rowData; UPDATE → rowId + rowData; DELETE / SEARCH_BY_ID →
                    rowId; CHANGE_RECORD_TYPE → rowId + targetRecordTypeId.
                  example: CREATE
                rowData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                inputModeByField:
                  type: object
                  nullable: true
                  additionalProperties:
                    type: string
                    enum:
                      - INPUT
                      - VARIABLE
                      - EMPTY
                    example: INPUT
                rowId:
                  type: string
                  nullable: true
                  example: example
                search:
                  type: string
                  nullable: true
                  example: example
                pageNum:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageSize:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageNumMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                pageSizeMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - asc
                          - desc
                        example: asc
                    required:
                      - path
                      - type
                query:
                  $ref: '#/components/schemas/DynamicTablesQuery'
              required:
                - type
            - nullable: true
              type: object
        workflowId:
          type: string
          example: example
        handles:
          type: array
          items:
            type: object
            properties:
              handleId:
                type: string
                example: example
              sourceEdge:
                type: object
                properties:
                  from:
                    type: string
                    example: example
                  fromHandleId:
                    type: string
                    example: example
                  to:
                    type: string
                    example: example
                  toHandleId:
                    type: string
                    example: example
                required:
                  - from
                  - fromHandleId
                  - to
                  - toHandleId
              text:
                type: string
                example: example
            required:
              - handleId
              - sourceEdge
              - text
        targetEdges:
          type: array
          items:
            type: object
            properties:
              from:
                type: string
                example: example
              fromHandleId:
                type: string
                example: example
              to:
                type: string
                example: example
              toHandleId:
                type: string
                example: example
            required:
              - from
              - fromHandleId
              - to
              - toHandleId
        createdAt:
          type: string
          nullable: true
          example: example
        updatedAt:
          type: string
          nullable: true
          example: example
      required:
        - nodeId
        - position
        - type
    FlowDetail:
      allOf:
        - $ref: '#/components/schemas/Flow'
        - type: object
          properties:
            assistantId:
              type: string
              example: 550e8400-e29b-41d4-a716-446655440000
            isDefault:
              type: boolean
              example: false
            liveSnapshotId:
              type: string
              nullable: true
              example: 64f1c2e6a75f2d4a9a2f1234
            draftSnapshotId:
              type: string
              nullable: true
              example: 64f1c2e6a75f2d4a9a2f1234
            nodes:
              type: array
              items:
                $ref: '#/components/schemas/PublicFlowNode'
          required:
            - assistantId
            - isDefault
            - liveSnapshotId
            - draftSnapshotId
    PublicFlowCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Order Routing
        description:
          type: string
          nullable: true
          example: Routes order conversations
      required:
        - name
    PublicFlowUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Order Routing
        description:
          type: string
          nullable: true
          example: Routes order conversations
        status:
          type: string
          enum:
            - ACTIVE
            - SUSPENDED
            - DELETED
            - DRAFT
          example: ACTIVE
      required:
        - name
    FlowGraph:
      type: object
      properties:
        id:
          type: string
          example: example
        assistantId:
          type: string
          nullable: true
          example: example
        accountId:
          type: number
          nullable: true
          example: 1
        entityId:
          type: number
          example: 1
        type:
          type: string
          enum:
            - FLOW
            - AUTOMATION
          example: FLOW
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/PublicFlowNode'
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          nullable: true
          example: example
        executed:
          type: boolean
          default: false
          example: false
        breakingChangeAt:
          type: string
          nullable: true
          example: example
        breakingChangeReason:
          type: string
          nullable: true
          example: example
      required:
        - entityId
        - type
        - nodes
        - createdAt
    PublicFlowNodeCreated:
      allOf:
        - $ref: '#/components/schemas/PublicFlowNode'
        - type: object
          properties:
            alias:
              type: string
              example: Say
          required:
            - alias
    PublicFlowNodeCreateInput:
      type: object
      properties:
        node:
          type: object
          properties:
            name:
              type: string
              example: Start
            position:
              type: object
              properties:
                positionX:
                  type: number
                  example: 1
                positionY:
                  type: number
                  example: 1
              required:
                - positionX
                - positionY
            type:
              type: string
              enum:
                - START
                - TRIGGER_INTENT
                - SAY_AI
                - RESPONSE_AI
                - TOOLS_AI
                - API
                - CONDITIONAL_ROUTING
                - DYNAMIC_TABLES
              example: START
            data:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - TRIGGER_INTENT
                      example: TRIGGER_INTENT
                    agenticRouting:
                      type: string
                      nullable: true
                      example: example
                    intentIds:
                      type: array
                      nullable: true
                      items:
                        type: number
                        example: 1
                    intents:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          id:
                            type: number
                            example: 1
                          name:
                            type: string
                            example: example
                          description:
                            type: string
                            nullable: true
                            example: example
                          createdAt:
                            type: string
                            nullable: true
                            example: example
                          updatedAt:
                            type: string
                            nullable: true
                            example: example
                          status:
                            type: string
                            enum:
                              - ACTIVE
                              - DELETED
                            example: ACTIVE
                          assistantId:
                            type: string
                            example: example
                          phrases:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: number
                                  example: 1
                                phrase:
                                  type: string
                                  example: example
                              required:
                                - id
                                - phrase
                          flowId:
                            type: number
                            nullable: true
                            example: 1
                        required:
                          - id
                          - name
                          - createdAt
                          - updatedAt
                          - status
                          - assistantId
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - SAY_AI
                      example: SAY_AI
                    message:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      default: 0.7
                      example: 1
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    model:
                      type: string
                      nullable: true
                      example: example
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    sayWithAi:
                      type: boolean
                      example: false
                  required:
                    - type
                    - sayWithAi
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - RESPONSE_AI
                      example: RESPONSE_AI
                    assistantId:
                      type: string
                      format: uuid
                      description: >-
                        Owning assistant UUID. Validated against the account on
                        save.
                      example: 550e8400-e29b-41d4-a716-446655440000
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    model:
                      type: string
                      example: example
                    aiVendor:
                      type: string
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    instructions:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      example: 1
                    captureVariables:
                      type: array
                      items:
                        nullable: true
                        type: object
                    exitNodeWhen:
                      type: string
                      enum:
                        - ALL_VARIABLES
                        - FLOW_TRIGGERED
                        - ANY_VARIABLES
                      example: ALL_VARIABLES
                    knowledgeBaseMode:
                      type: string
                      enum:
                        - DEFAULT
                        - CUSTOM
                        - DISABLED
                      default: DEFAULT
                      example: DEFAULT
                    knowledgeBaseIds:
                      type: array
                      nullable: true
                      items:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                  required:
                    - type
                    - assistantId
                    - model
                    - aiVendor
                    - instructions
                    - temperature
                    - captureVariables
                    - exitNodeWhen
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - TOOLS_AI
                      example: TOOLS_AI
                    conditions:
                      type: array
                      items:
                        type: object
                        properties:
                          handleId:
                            type: string
                            example: example
                          expression:
                            type: string
                            example: example
                        required:
                          - handleId
                          - expression
                    temperature:
                      type: number
                      example: 1
                    model:
                      type: string
                      example: example
                    aiVendor:
                      type: string
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    instructions:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    customToolIds:
                      type: array
                      nullable: true
                      items:
                        type: number
                        example: 1
                    maxIterations:
                      type: number
                      minimum: 1
                      maximum: 30
                      default: 10
                      example: 1
                    agentType:
                      type: string
                      enum:
                        - BASIC
                        - ADVANCED
                      default: BASIC
                      example: BASIC
                    captureVariables:
                      type: array
                      nullable: true
                      items:
                        nullable: true
                        type: object
                    knowledgeBaseMode:
                      type: string
                      enum:
                        - DEFAULT
                        - CUSTOM
                        - DISABLED
                      default: DEFAULT
                      example: DEFAULT
                    knowledgeBaseIds:
                      type: array
                      nullable: true
                      items:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                    selectedRecordTypes:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          recordTypeId:
                            type: number
                            example: 1
                          read:
                            type: boolean
                            example: false
                          create:
                            type: boolean
                            example: false
                          update:
                            type: boolean
                            example: false
                          delete:
                            type: boolean
                            example: false
                          createActivity:
                            type: boolean
                            example: false
                        required:
                          - recordTypeId
                    systemToolsConfig:
                      type: object
                      nullable: true
                      properties:
                        webSearchEnabled:
                          type: boolean
                          default: false
                          example: false
                        urlScrapeEnabled:
                          type: boolean
                          default: false
                          example: false
                        linkedinSearchEnabled:
                          type: boolean
                          default: false
                          example: false
                    connectedAccountConfigs:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          connectedAccountId:
                            type: number
                            example: 1
                          useAllTools:
                            type: boolean
                            default: true
                            example: false
                          selectedToolSlugs:
                            type: array
                            nullable: true
                            items:
                              type: string
                              example: example
                        required:
                          - connectedAccountId
                    playbookIds:
                      type: array
                      nullable: true
                      items:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                    aiModelId:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - type
                    - conditions
                    - instructions
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - API
                      example: API
                    url:
                      type: string
                      format: uri
                      example: https://api.example.com/hook
                    method:
                      type: string
                      enum:
                        - GET
                        - POST
                        - PUT
                        - DELETE
                        - PATCH
                      example: GET
                    headers:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                        required:
                          - key
                          - value
                    body:
                      type: string
                      nullable: true
                      example: example
                    response:
                      type: string
                      nullable: true
                      example: example
                    parameters:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                        required:
                          - key
                          - value
                    variables:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                          fullResponse:
                            type: boolean
                            default: false
                            example: false
                        required:
                          - key
                          - value
                  required:
                    - type
                    - url
                    - method
                    - headers
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - CONDITIONAL_ROUTING
                      example: CONDITIONAL_ROUTING
                    routingType:
                      type: string
                      enum:
                        - CONDITIONAL_AI
                        - DYNAMIC
                      example: CONDITIONAL_AI
                    conditions:
                      type: array
                      items:
                        type: object
                        properties:
                          handleId:
                            type: string
                            example: example
                          expression:
                            type: string
                            example: example
                        required:
                          - handleId
                          - expression
                    temperature:
                      type: number
                      example: 1
                    model:
                      type: string
                      example: example
                    aiVendor:
                      type: string
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    aiModelId:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - type
                    - routingType
                    - conditions
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - DYNAMIC_TABLES
                      example: DYNAMIC_TABLES
                    tableId:
                      type: number
                      nullable: true
                      example: 1
                    recordTypeId:
                      type: number
                      nullable: true
                      example: 1
                    targetRecordTypeId:
                      type: number
                      nullable: true
                      description: >-
                        Destination record type id. Required when actionType is
                        CHANGE_RECORD_TYPE.
                      example: 12
                    actionType:
                      type: string
                      nullable: true
                      enum:
                        - CREATE
                        - UPDATE
                        - DELETE
                        - SEARCH
                        - SEARCH_BY_ID
                        - CHANGE_RECORD_TYPE
                      description: >-
                        Operation to run. Required-field rules per action:
                        CREATE → rowData; UPDATE → rowId + rowData; DELETE /
                        SEARCH_BY_ID → rowId; CHANGE_RECORD_TYPE → rowId +
                        targetRecordTypeId.
                      example: CREATE
                    rowData:
                      type: object
                      nullable: true
                      additionalProperties: {}
                    inputModeByField:
                      type: object
                      nullable: true
                      additionalProperties:
                        type: string
                        enum:
                          - INPUT
                          - VARIABLE
                          - EMPTY
                        example: INPUT
                    rowId:
                      type: string
                      nullable: true
                      example: example
                    search:
                      type: string
                      nullable: true
                      example: example
                    pageNum:
                      anyOf:
                        - type: number
                          example: 1
                        - type: string
                          example: example
                        - nullable: true
                          type: object
                    pageSize:
                      anyOf:
                        - type: number
                          example: 1
                        - type: string
                          example: example
                        - nullable: true
                          type: object
                    pageNumMode:
                      type: string
                      nullable: true
                      enum:
                        - INPUT
                        - VARIABLE
                        - EMPTY
                      example: INPUT
                    pageSizeMode:
                      type: string
                      nullable: true
                      enum:
                        - INPUT
                        - VARIABLE
                        - EMPTY
                      example: INPUT
                    sort:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            example: example
                          type:
                            type: string
                            enum:
                              - asc
                              - desc
                            example: asc
                        required:
                          - path
                          - type
                    query:
                      $ref: '#/components/schemas/DynamicTablesQuery'
                  required:
                    - type
                - nullable: true
                  type: object
          required:
            - position
            - type
      required:
        - node
    PublicFlowNodePatch:
      type: object
      properties:
        alias:
          type: string
          nullable: true
          example: Greeting
        name:
          type: string
          example: Start
        position:
          type: object
          properties:
            positionX:
              type: number
              example: 1
            positionY:
              type: number
              example: 1
          required:
            - positionX
            - positionY
        type:
          type: string
          enum:
            - START
            - TRIGGER_INTENT
            - SAY_AI
            - RESPONSE_AI
            - TOOLS_AI
            - API
            - CONDITIONAL_ROUTING
            - DYNAMIC_TABLES
          example: START
        data:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TRIGGER_INTENT
                  example: TRIGGER_INTENT
                agenticRouting:
                  type: string
                  nullable: true
                  example: example
                intentIds:
                  type: array
                  nullable: true
                  items:
                    type: number
                    example: 1
                intents:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      description:
                        type: string
                        nullable: true
                        example: example
                      createdAt:
                        type: string
                        nullable: true
                        example: example
                      updatedAt:
                        type: string
                        nullable: true
                        example: example
                      status:
                        type: string
                        enum:
                          - ACTIVE
                          - DELETED
                        example: ACTIVE
                      assistantId:
                        type: string
                        example: example
                      phrases:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            phrase:
                              type: string
                              example: example
                          required:
                            - id
                            - phrase
                      flowId:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - id
                      - name
                      - createdAt
                      - updatedAt
                      - status
                      - assistantId
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SAY_AI
                  example: SAY_AI
                message:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  default: 0.7
                  example: 1
                prompt:
                  type: string
                  nullable: true
                  example: example
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                model:
                  type: string
                  nullable: true
                  example: example
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                sayWithAi:
                  type: boolean
                  example: false
              required:
                - type
                - sayWithAi
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - RESPONSE_AI
                  example: RESPONSE_AI
                assistantId:
                  type: string
                  format: uuid
                  description: >-
                    Owning assistant UUID. Validated against the account on
                    save.
                  example: 550e8400-e29b-41d4-a716-446655440000
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  example: 1
                captureVariables:
                  type: array
                  items:
                    nullable: true
                    type: object
                exitNodeWhen:
                  type: string
                  enum:
                    - ALL_VARIABLES
                    - FLOW_TRIGGERED
                    - ANY_VARIABLES
                  example: ALL_VARIABLES
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
              required:
                - type
                - assistantId
                - model
                - aiVendor
                - instructions
                - temperature
                - captureVariables
                - exitNodeWhen
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TOOLS_AI
                  example: TOOLS_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                customToolIds:
                  type: array
                  nullable: true
                  items:
                    type: number
                    example: 1
                maxIterations:
                  type: number
                  minimum: 1
                  maximum: 30
                  default: 10
                  example: 1
                agentType:
                  type: string
                  enum:
                    - BASIC
                    - ADVANCED
                  default: BASIC
                  example: BASIC
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    type: object
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                selectedRecordTypes:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      recordTypeId:
                        type: number
                        example: 1
                      read:
                        type: boolean
                        example: false
                      create:
                        type: boolean
                        example: false
                      update:
                        type: boolean
                        example: false
                      delete:
                        type: boolean
                        example: false
                      createActivity:
                        type: boolean
                        example: false
                    required:
                      - recordTypeId
                systemToolsConfig:
                  type: object
                  nullable: true
                  properties:
                    webSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                    urlScrapeEnabled:
                      type: boolean
                      default: false
                      example: false
                    linkedinSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                connectedAccountConfigs:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      connectedAccountId:
                        type: number
                        example: 1
                      useAllTools:
                        type: boolean
                        default: true
                        example: false
                      selectedToolSlugs:
                        type: array
                        nullable: true
                        items:
                          type: string
                          example: example
                    required:
                      - connectedAccountId
                playbookIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - conditions
                - instructions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - API
                  example: API
                url:
                  type: string
                  format: uri
                  example: https://api.example.com/hook
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - DELETE
                    - PATCH
                  example: GET
                headers:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                body:
                  type: string
                  nullable: true
                  example: example
                response:
                  type: string
                  nullable: true
                  example: example
                parameters:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                variables:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                      fullResponse:
                        type: boolean
                        default: false
                        example: false
                    required:
                      - key
                      - value
              required:
                - type
                - url
                - method
                - headers
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - CONDITIONAL_ROUTING
                  example: CONDITIONAL_ROUTING
                routingType:
                  type: string
                  enum:
                    - CONDITIONAL_AI
                    - DYNAMIC
                  example: CONDITIONAL_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - routingType
                - conditions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - DYNAMIC_TABLES
                  example: DYNAMIC_TABLES
                tableId:
                  type: number
                  nullable: true
                  example: 1
                recordTypeId:
                  type: number
                  nullable: true
                  example: 1
                targetRecordTypeId:
                  type: number
                  nullable: true
                  description: >-
                    Destination record type id. Required when actionType is
                    CHANGE_RECORD_TYPE.
                  example: 12
                actionType:
                  type: string
                  nullable: true
                  enum:
                    - CREATE
                    - UPDATE
                    - DELETE
                    - SEARCH
                    - SEARCH_BY_ID
                    - CHANGE_RECORD_TYPE
                  description: >-
                    Operation to run. Required-field rules per action: CREATE →
                    rowData; UPDATE → rowId + rowData; DELETE / SEARCH_BY_ID →
                    rowId; CHANGE_RECORD_TYPE → rowId + targetRecordTypeId.
                  example: CREATE
                rowData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                inputModeByField:
                  type: object
                  nullable: true
                  additionalProperties:
                    type: string
                    enum:
                      - INPUT
                      - VARIABLE
                      - EMPTY
                    example: INPUT
                rowId:
                  type: string
                  nullable: true
                  example: example
                search:
                  type: string
                  nullable: true
                  example: example
                pageNum:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageSize:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageNumMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                pageSizeMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - asc
                          - desc
                        example: asc
                    required:
                      - path
                      - type
                query:
                  $ref: '#/components/schemas/DynamicTablesQuery'
              required:
                - type
            - nullable: true
              type: object
    PublicFlowNodeUpdateInput:
      type: object
      properties:
        node:
          $ref: '#/components/schemas/PublicFlowNodePatch'
      required:
        - node
    PublicFlowEdgeInput:
      type: object
      properties:
        edge:
          type: object
          properties:
            source:
              type: string
              example: trigger_1
            sourceHandle:
              type: string
              example: default
            target:
              type: string
              example: api_1
            targetHandle:
              type: string
              example: default
          required:
            - source
            - sourceHandle
            - target
            - targetHandle
      required:
        - edge
    PublicFlowEdgeDeleteInput:
      type: object
      properties:
        edge:
          type: object
          properties:
            source:
              type: string
              example: trigger_1
            sourceHandle:
              type: string
              example: default
            target:
              type: string
              example: api_1
            targetHandle:
              type: string
              example: default
          required:
            - source
            - sourceHandle
            - target
            - targetHandle
      required:
        - edge
    AgentAnalytics:
      type: object
      properties:
        summary:
          type: object
          properties:
            totalCredits:
              type: number
              example: 500.25
            totalConversations:
              type: number
              example: 150
          required:
            - totalCredits
            - totalConversations
        creditsByDate:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                example: '2024-01-01'
              totalCredits:
                type: number
                example: 25.5
              conversationCount:
                type: number
                example: 10
            required:
              - date
              - totalCredits
              - conversationCount
        conversationsByChannel:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                example: '2024-01-15'
              channel:
                type: string
                example: WHATSAPP
              count:
                type: number
                example: 12
            required:
              - date
              - channel
              - count
      required:
        - summary
        - creditsByDate
        - conversationsByChannel
    Workflow:
      type: object
      properties:
        id:
          type: number
          example: 501
        name:
          type: string
          example: Daily CRM Sync
        description:
          type: string
          nullable: true
          example: Syncs contacts to HubSpot
        status:
          type: string
          enum:
            - ACTIVE
            - DELETED
            - DRAFT
          example: ACTIVE
        triggerType:
          type: string
          nullable: true
          enum:
            - CONVERSATION_ENDED
            - CONTACT_CREATED
            - CONTACT_UPDATED
            - FEEDBACK_CAPTURED
            - INCOMING_WEBHOOK
            - TABLE_ROW_CREATED
            - OBJECT_RECORD_CREATED
            - TABLE_ROW_UPDATED
            - OBJECT_RECORD_UPDATED
            - SCHEDULED_TRIGGER
            - CONVERSATION_IDLE
            - COMPOSIO_TRIGGER
          example: CONVERSATION_ENDED
        createdAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-01T12:00:00Z'
        runsCount:
          type: number
          example: 1200
        runsFailedCount:
          type: number
          example: 5
        lastRunDate:
          type: string
          nullable: true
          example: '2024-01-01T12:00:00Z'
      required:
        - id
        - name
        - description
        - status
        - triggerType
        - createdAt
        - updatedAt
        - runsCount
        - runsFailedCount
        - lastRunDate
    PublicWorkflowNode:
      type: object
      properties:
        nodeId:
          type: string
          pattern: >-
            node[_-][0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}
          example: node_550e8400-e29b-41d4-a716-446655440000
        alias:
          type: string
          nullable: true
          example: Initial trigger
        name:
          type: string
          example: Initial trigger
        position:
          type: object
          properties:
            positionX:
              type: number
              example: 1
            positionY:
              type: number
              example: 1
          required:
            - positionX
            - positionY
        type:
          type: string
          enum:
            - TRIGGER
            - SCHEDULED_TRIGGER
            - WEBHOOK
            - TOOLS_AI
            - API
            - CONDITIONAL_ROUTING
            - AI_CAPTURE
            - DATA_TRANSFORMER
            - DYNAMIC_TABLES
            - ITERATION
            - BREAK
            - AUTOMATION_STATUS
            - SEND_MESSAGE
            - SEND_WHATSAPP_MESSAGE
            - TRANSCRIPTION
            - FILE_ANALYSIS
            - CREATE_RECORD_ACTIVITY
          example: TRIGGER
        data:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TRIGGER
                  example: TRIGGER
                triggerType:
                  type: string
                  nullable: true
                  enum:
                    - CONVERSATION_ENDED
                    - CONTACT_CREATED
                    - CONTACT_UPDATED
                    - FEEDBACK_CAPTURED
                    - INCOMING_WEBHOOK
                    - TABLE_ROW_CREATED
                    - OBJECT_RECORD_CREATED
                    - TABLE_ROW_UPDATED
                    - OBJECT_RECORD_UPDATED
                    - CONVERSATION_IDLE
                    - COMPOSIO_TRIGGER
                  example: CONVERSATION_ENDED
                triggeredBy:
                  type: string
                  nullable: true
                  enum:
                    - BOTH
                    - AGENT
                    - USER
                    - INCOMING_WEBHOOK
                  example: BOTH
                triggeredByAgentIds:
                  type: array
                  items:
                    type: string
                    example: example
                triggerByWebhookIds:
                  type: array
                  items:
                    type: string
                    example: example
                triggeredByTableId:
                  type: number
                  nullable: true
                  example: 1
                triggeredByRecordTypeId:
                  type: number
                  nullable: true
                  example: 1
                connectedAccountTriggerId:
                  type: string
                  nullable: true
                  example: example
                triggerToolkit:
                  type: string
                  nullable: true
                  example: example
                triggerSlug:
                  type: string
                  nullable: true
                  example: example
                triggerConfig:
                  type: object
                  nullable: true
                  additionalProperties: {}
                triggerQueryConfig:
                  type: object
                  nullable: true
                  properties:
                    query:
                      type: object
                      description: >-
                        Dynamic-table query: a single `{ path, operator, value
                        }` condition, or a nested `{ operator: 'and' | 'or',
                        conditions: [...] }` group.
                connectedAccountId:
                  type: number
                  nullable: true
                  example: 1
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SCHEDULED_TRIGGER
                  example: SCHEDULED_TRIGGER
                cronExpression:
                  type: string
                  description: >-
                    Cron expression (default preset). Validated by
                    cron-validate.
                  example: 0 9 * * 1-5
                timezone:
                  type: string
                  description: >-
                    IANA timezone identifier. Validated against the host ICU
                    table.
                  example: America/Argentina/Buenos_Aires
                startTime:
                  type: string
                  nullable: true
                  example: example
                endTime:
                  type: string
                  nullable: true
                  example: example
                startDate:
                  type: string
                  nullable: true
                  example: example
                endDate:
                  type: string
                  nullable: true
                  example: example
                frequency:
                  type: string
                  nullable: true
                  enum:
                    - INTERVALS
                    - DAILY
                    - WEEKLY
                    - MONTHLY
                  example: INTERVALS
              required:
                - type
                - cronExpression
                - timezone
                - startTime
                - endTime
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - WEBHOOK
                  example: WEBHOOK
                includeConversationTranscript:
                  type: boolean
                  default: false
                  example: false
                includeContactInfo:
                  type: boolean
                  default: false
                  example: false
                includeFeedbackCaptured:
                  type: boolean
                  default: false
                  example: false
                includeCapturedVariables:
                  type: boolean
                  default: false
                  example: false
                includeWebhookPayload:
                  type: boolean
                  default: false
                  example: false
                url:
                  type: string
                  nullable: true
                  format: uri
                  example: https://api.example.com/contacts/123
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TOOLS_AI
                  example: TOOLS_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                customToolIds:
                  type: array
                  nullable: true
                  items:
                    type: number
                    example: 1
                maxIterations:
                  type: number
                  minimum: 1
                  maximum: 30
                  default: 10
                  example: 1
                agentType:
                  type: string
                  enum:
                    - BASIC
                    - ADVANCED
                  default: BASIC
                  example: BASIC
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    type: object
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                selectedRecordTypes:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      recordTypeId:
                        type: number
                        example: 1
                      read:
                        type: boolean
                        example: false
                      create:
                        type: boolean
                        example: false
                      update:
                        type: boolean
                        example: false
                      delete:
                        type: boolean
                        example: false
                      createActivity:
                        type: boolean
                        example: false
                    required:
                      - recordTypeId
                systemToolsConfig:
                  type: object
                  nullable: true
                  properties:
                    webSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                    urlScrapeEnabled:
                      type: boolean
                      default: false
                      example: false
                    linkedinSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                connectedAccountConfigs:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      connectedAccountId:
                        type: number
                        example: 1
                      useAllTools:
                        type: boolean
                        default: true
                        example: false
                      selectedToolSlugs:
                        type: array
                        nullable: true
                        items:
                          type: string
                          example: example
                    required:
                      - connectedAccountId
                playbookIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - conditions
                - instructions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - API
                  example: API
                url:
                  type: string
                  format: uri
                  example: https://api.example.com/hook
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - DELETE
                    - PATCH
                  example: GET
                headers:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                body:
                  type: string
                  nullable: true
                  example: example
                response:
                  type: string
                  nullable: true
                  example: example
                parameters:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                variables:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                      fullResponse:
                        type: boolean
                        default: false
                        example: false
                    required:
                      - key
                      - value
              required:
                - type
                - url
                - method
                - headers
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - CONDITIONAL_ROUTING
                  example: CONDITIONAL_ROUTING
                routingType:
                  type: string
                  enum:
                    - CONDITIONAL_AI
                    - DYNAMIC
                  example: CONDITIONAL_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - routingType
                - conditions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - AI_CAPTURE
                  example: AI_CAPTURE
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  example: 1
                captureVariables:
                  type: array
                  items:
                    nullable: true
                    type: object
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
              required:
                - type
                - model
                - aiVendor
                - prompt
                - temperature
                - captureVariables
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - DATA_TRANSFORMER
                  example: DATA_TRANSFORMER
                prompt:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  default: 0.7
                  example: 1
                model:
                  type: string
                  nullable: true
                  example: example
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
                outputJson:
                  type: string
                  nullable: true
                  example: example
                outputMode:
                  type: string
                  nullable: true
                  enum:
                    - JSON
                    - KEY_VALUE
                    - TEXT
                  example: JSON
                keyValuePairs:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
              required:
                - type
                - prompt
                - model
                - aiVendor
                - outputMode
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - DYNAMIC_TABLES
                  example: DYNAMIC_TABLES
                tableId:
                  type: number
                  nullable: true
                  example: 1
                recordTypeId:
                  type: number
                  nullable: true
                  example: 1
                targetRecordTypeId:
                  type: number
                  nullable: true
                  description: >-
                    Destination record type id. Required when actionType is
                    CHANGE_RECORD_TYPE.
                  example: 12
                actionType:
                  type: string
                  nullable: true
                  enum:
                    - CREATE
                    - UPDATE
                    - DELETE
                    - SEARCH
                    - SEARCH_BY_ID
                    - CHANGE_RECORD_TYPE
                  description: >-
                    Operation to run. Required-field rules per action: CREATE →
                    rowData; UPDATE → rowId + rowData; DELETE / SEARCH_BY_ID →
                    rowId; CHANGE_RECORD_TYPE → rowId + targetRecordTypeId.
                  example: CREATE
                rowData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                inputModeByField:
                  type: object
                  nullable: true
                  additionalProperties:
                    type: string
                    enum:
                      - INPUT
                      - VARIABLE
                      - EMPTY
                    example: INPUT
                rowId:
                  type: string
                  nullable: true
                  example: example
                search:
                  type: string
                  nullable: true
                  example: example
                pageNum:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageSize:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageNumMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                pageSizeMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - asc
                          - desc
                        example: asc
                    required:
                      - path
                      - type
                query:
                  $ref: '#/components/schemas/DynamicTablesQuery'
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - ITERATION
                  example: ITERATION
                variableName:
                  type: string
                  default: ''
                  example: example
                variablePath:
                  type: string
                  default: ''
                  example: example
                continueOnError:
                  type: boolean
                  default: false
                  example: false
              required:
                - type
              description: >-
                Loop node. Wire type is ITERATION. Connect edges with
                sourceHandle body (for-each), completed (after all items), and
                empty (null/empty list). At most 50 items per loop invocation;
                if the resolved array has more than 50 items, the automation run
                fails before the loop body starts (no items processed).
                Automations are also limited to 500 node execution steps total.
                Not available in agent flows.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - BREAK
                  example: BREAK
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - AUTOMATION_STATUS
                  example: AUTOMATION_STATUS
                automationId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                automationName:
                  type: string
                  nullable: true
                  example: example
                action:
                  type: string
                  enum:
                    - SET_ACTIVE
                    - SET_DRAFT
                    - TOGGLE
                  default: SET_ACTIVE
                  example: SET_ACTIVE
              required:
                - type
              description: >-
                Changes another automation's status (live/draft/toggle). Does
                not publish draft graph changes.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SEND_MESSAGE
                  example: SEND_MESSAGE
                whatsapp:
                  type: object
                  nullable: true
                  properties:
                    messageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                        - WHATSAPP_TEMPLATE
                      example: STATIC
                    message:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      nullable: true
                      example: 1
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                    template:
                      type: string
                      nullable: true
                      example: example
                    templateVariables:
                      type: object
                      nullable: true
                      properties:
                        body:
                          type: object
                          additionalProperties: {}
                        header:
                          type: object
                          additionalProperties: {}
                        buttons:
                          type: array
                          items:
                            type: object
                            additionalProperties: {}
                    templateData:
                      type: object
                      nullable: true
                      additionalProperties: {}
                  required:
                    - messageType
                instagram:
                  type: object
                  nullable: true
                  properties:
                    messageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                        - WHATSAPP_TEMPLATE
                      example: STATIC
                    message:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      nullable: true
                      example: 1
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                  required:
                    - messageType
                messenger:
                  type: object
                  nullable: true
                  properties:
                    messageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                        - WHATSAPP_TEMPLATE
                      example: STATIC
                    message:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      nullable: true
                      example: 1
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                  required:
                    - messageType
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SEND_WHATSAPP_MESSAGE
                  example: SEND_WHATSAPP_MESSAGE
                recipientMode:
                  type: string
                  nullable: true
                  enum:
                    - PHONE_NUMBER
                    - PEOPLE_RECORD
                  example: PHONE_NUMBER
                peopleRecordTypeId:
                  type: number
                  nullable: true
                  example: 1
                peopleRowId:
                  type: string
                  nullable: true
                  example: example
                personName:
                  type: string
                  nullable: true
                  example: example
                phoneNumber:
                  type: string
                  nullable: true
                  example: example
                phoneNumberId:
                  type: string
                  nullable: true
                  example: example
                template:
                  type: string
                  nullable: true
                  example: example
                templateVariables:
                  type: object
                  nullable: true
                  properties:
                    body:
                      type: object
                      additionalProperties: {}
                    header:
                      type: object
                      additionalProperties: {}
                    buttons:
                      type: array
                      items:
                        type: object
                        additionalProperties: {}
              required:
                - type
              description: >-
                Sends a WhatsApp Business template message. phoneNumberId must
                belong to this account and have an assistantId assigned.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TRANSCRIPTION
                  example: TRANSCRIPTION
                audioUrl:
                  type: string
                  example: example
                language:
                  type: string
                  default: es
                  example: example
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                model:
                  type: string
                  default: gpt-4o-transcribe
                  example: example
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    type: object
                enableDiarization:
                  type: boolean
                  default: false
                  example: false
                captureSegmentsVariable:
                  type: object
                  nullable: true
                  properties:
                    id:
                      type: number
                      example: 1
                    name:
                      type: string
                      example: example
                    description:
                      type: string
                      example: example
                  required:
                    - id
                    - name
              required:
                - type
                - audioUrl
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - FILE_ANALYSIS
                  example: FILE_ANALYSIS
                fileUrl:
                  type: string
                  example: example
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                model:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      description:
                        type: string
                        example: example
                    required:
                      - id
                      - name
                captureOcrVariable:
                  type: object
                  nullable: true
                  properties:
                    id:
                      type: number
                      example: 1
                    name:
                      type: string
                      example: example
                    description:
                      type: string
                      example: example
                  required:
                    - id
                    - name
              required:
                - type
                - fileUrl
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - CREATE_RECORD_ACTIVITY
                  example: CREATE_RECORD_ACTIVITY
                recordTypeId:
                  nullable: true
                  type: object
                rowId:
                  type: string
                  nullable: true
                  example: example
                activityType:
                  type: string
                  nullable: true
                  enum:
                    - NOTE
                    - EMAIL
                    - PHONE_CALL
                    - MEETING
                    - WHATSAPP
                  example: NOTE
                content:
                  type: string
                  nullable: true
                  example: example
              required:
                - type
            - nullable: true
              type: object
        workflowId:
          type: string
          example: example
        handles:
          type: array
          items:
            type: object
            properties:
              handleId:
                type: string
                example: example
              sourceEdge:
                type: object
                properties:
                  from:
                    type: string
                    example: example
                  fromHandleId:
                    type: string
                    example: example
                  to:
                    type: string
                    example: example
                  toHandleId:
                    type: string
                    example: example
                required:
                  - from
                  - fromHandleId
                  - to
                  - toHandleId
              text:
                type: string
                example: example
            required:
              - handleId
              - sourceEdge
              - text
        targetEdges:
          type: array
          items:
            type: object
            properties:
              from:
                type: string
                example: example
              fromHandleId:
                type: string
                example: example
              to:
                type: string
                example: example
              toHandleId:
                type: string
                example: example
            required:
              - from
              - fromHandleId
              - to
              - toHandleId
        createdAt:
          type: string
          nullable: true
          example: example
        updatedAt:
          type: string
          nullable: true
          example: example
      required:
        - nodeId
        - position
        - type
    WorkflowDetail:
      allOf:
        - $ref: '#/components/schemas/Workflow'
        - type: object
          properties:
            liveSnapshotId:
              type: string
              nullable: true
              example: 64f1c2e6a75f2d4a9a2f1234
            draftSnapshotId:
              type: string
              nullable: true
              example: 64f1c2e6a75f2d4a9a2f1234
            nodes:
              type: array
              items:
                $ref: '#/components/schemas/PublicWorkflowNode'
          required:
            - liveSnapshotId
            - draftSnapshotId
    PublicWorkflowCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Daily CRM Sync
        description:
          type: string
          nullable: true
          example: Syncs contacts daily
      required:
        - name
    PublicWorkflowUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: Daily CRM Sync
        description:
          type: string
          nullable: true
          example: Syncs contacts daily
        status:
          type: string
          enum:
            - ACTIVE
            - DELETED
            - DRAFT
          example: ACTIVE
      required:
        - name
    WorkflowGraph:
      type: object
      properties:
        id:
          type: string
          example: example
        assistantId:
          type: string
          nullable: true
          example: example
        accountId:
          type: number
          nullable: true
          example: 1
        entityId:
          type: number
          example: 1
        type:
          type: string
          enum:
            - FLOW
            - AUTOMATION
          example: FLOW
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/PublicWorkflowNode'
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          nullable: true
          example: example
        executed:
          type: boolean
          default: false
          example: false
        breakingChangeAt:
          type: string
          nullable: true
          example: example
        breakingChangeReason:
          type: string
          nullable: true
          example: example
      required:
        - entityId
        - type
        - nodes
        - createdAt
    WorkflowRunResult:
      type: object
      properties:
        automationId:
          type: number
          example: 42
        name:
          type: string
          example: Daily CRM Sync
        status:
          type: string
          enum:
            - ACTIVE
            - DELETED
            - DRAFT
          example: ACTIVE
        enqueued:
          type: boolean
          example: true
      required:
        - automationId
        - name
        - status
        - enqueued
    PublicAgentPlaybookList:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              id:
                type: number
                example: 1
              name:
                type: string
                example: example
              description:
                type: string
                example: example
              isActive:
                type: boolean
                example: false
              instructions:
                type: string
                example: example
              tools:
                type: array
                items:
                  type: string
                  example: example
              accountId:
                type: number
                example: 1
              createdByUserId:
                type: number
                nullable: true
                example: 1
              createdBy:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  firstName:
                    type: string
                    example: example
                  lastName:
                    type: string
                    example: example
                  email:
                    type: string
                    example: example
                  avatar:
                    type: string
                    nullable: true
                    example: example
                required:
                  - id
                  - firstName
                  - lastName
                  - email
                  - avatar
              visibility:
                type: string
                enum:
                  - PRIVATE
                  - ACCOUNT
                example: PRIVATE
              createdAt:
                type: string
                example: example
              updatedAt:
                type: string
                example: example
              playbookConnectedAccounts:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: number
                      example: 1
                    connectedAccountId:
                      type: number
                      example: 1
                    useAllTools:
                      type: boolean
                      example: false
                    selectedToolSlugs:
                      type: array
                      nullable: true
                      items:
                        type: string
                        example: example
                    connectedAccount:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        toolkit:
                          type: string
                          example: example
                        connectedEmail:
                          type: string
                          nullable: true
                          example: example
                        alias:
                          type: string
                          nullable: true
                          example: example
                        isConnected:
                          type: boolean
                          example: false
                      required:
                        - id
                        - toolkit
                        - connectedEmail
                        - alias
                        - isConnected
                  required:
                    - id
                    - connectedAccountId
                    - useAllTools
                    - selectedToolSlugs
              selectedRecordTypes:
                type: array
                nullable: true
                items:
                  type: object
                  properties:
                    recordTypeId:
                      type: number
                      example: 1
                    read:
                      type: boolean
                      example: false
                    create:
                      type: boolean
                      example: false
                    update:
                      type: boolean
                      example: false
                    delete:
                      type: boolean
                      example: false
                    createActivity:
                      type: boolean
                      example: false
                  required:
                    - recordTypeId
              selectedCustomTools:
                type: array
                nullable: true
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      minimum: 0
                      exclusiveMinimum: true
                      example: 1
                    enabled:
                      type: boolean
                      default: true
                      example: false
                  required:
                    - id
            required:
              - id
              - name
              - description
              - isActive
              - instructions
              - tools
              - accountId
              - createdByUserId
              - visibility
              - createdAt
              - updatedAt
        total:
          type: number
          example: 1
        page:
          type: number
          example: 1
        pageSize:
          type: number
          example: 1
        totalPages:
          type: number
          example: 1
      required:
        - results
        - total
        - page
        - pageSize
        - totalPages
    PublicAgentPlaybook:
      type: object
      properties:
        id:
          type: number
          example: 1
        name:
          type: string
          example: example
        description:
          type: string
          example: example
        isActive:
          type: boolean
          example: false
        instructions:
          type: string
          example: example
        tools:
          type: array
          items:
            type: string
            example: example
        accountId:
          type: number
          example: 1
        createdByUserId:
          type: number
          nullable: true
          example: 1
        createdBy:
          type: object
          properties:
            id:
              type: number
              example: 1
            firstName:
              type: string
              example: example
            lastName:
              type: string
              example: example
            email:
              type: string
              example: example
            avatar:
              type: string
              nullable: true
              example: example
          required:
            - id
            - firstName
            - lastName
            - email
            - avatar
        visibility:
          type: string
          enum:
            - PRIVATE
            - ACCOUNT
          example: PRIVATE
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          example: example
        playbookConnectedAccounts:
          type: array
          items:
            type: object
            properties:
              id:
                type: number
                example: 1
              connectedAccountId:
                type: number
                example: 1
              useAllTools:
                type: boolean
                example: false
              selectedToolSlugs:
                type: array
                nullable: true
                items:
                  type: string
                  example: example
              connectedAccount:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  toolkit:
                    type: string
                    example: example
                  connectedEmail:
                    type: string
                    nullable: true
                    example: example
                  alias:
                    type: string
                    nullable: true
                    example: example
                  isConnected:
                    type: boolean
                    example: false
                required:
                  - id
                  - toolkit
                  - connectedEmail
                  - alias
                  - isConnected
            required:
              - id
              - connectedAccountId
              - useAllTools
              - selectedToolSlugs
        selectedRecordTypes:
          type: array
          nullable: true
          items:
            type: object
            properties:
              recordTypeId:
                type: number
                example: 1
              read:
                type: boolean
                example: false
              create:
                type: boolean
                example: false
              update:
                type: boolean
                example: false
              delete:
                type: boolean
                example: false
              createActivity:
                type: boolean
                example: false
            required:
              - recordTypeId
        selectedCustomTools:
          type: array
          nullable: true
          items:
            type: object
            properties:
              id:
                type: integer
                minimum: 0
                exclusiveMinimum: true
                example: 1
              enabled:
                type: boolean
                default: true
                example: false
            required:
              - id
      required:
        - id
        - name
        - description
        - isActive
        - instructions
        - tools
        - accountId
        - createdByUserId
        - visibility
        - createdAt
        - updatedAt
    PublicAgentPlaybookCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          example: example
        description:
          type: string
          minLength: 10
          maxLength: 750
          example: example value
        instructions:
          type: string
          minLength: 10
          maxLength: 10000
          example: example value
        tools:
          type: array
          items:
            type: string
            example: example
          maxItems: 20
          default: []
        visibility:
          type: string
          enum:
            - PRIVATE
            - ACCOUNT
          default: ACCOUNT
          example: PRIVATE
        isActive:
          type: boolean
          default: true
          example: false
        connectedAccountConfigs:
          type: array
          items:
            type: object
            properties:
              connectedAccountId:
                type: number
                example: 1
              useAllTools:
                type: boolean
                default: true
                example: false
              selectedToolSlugs:
                type: array
                nullable: true
                items:
                  type: string
                  example: example
            required:
              - connectedAccountId
        selectedRecordTypes:
          type: array
          items:
            type: object
            properties:
              recordTypeId:
                type: number
                example: 1
              read:
                type: boolean
                example: false
              create:
                type: boolean
                example: false
              update:
                type: boolean
                example: false
              delete:
                type: boolean
                example: false
              createActivity:
                type: boolean
                example: false
            required:
              - recordTypeId
        selectedCustomTools:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                minimum: 0
                exclusiveMinimum: true
                example: 1
              enabled:
                type: boolean
                default: true
                example: false
            required:
              - id
      required:
        - name
        - description
        - instructions
    PublicAgentPlaybookUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          example: example
        description:
          type: string
          minLength: 10
          maxLength: 750
          example: example value
        instructions:
          type: string
          minLength: 10
          maxLength: 10000
          example: example value
        tools:
          type: array
          items:
            type: string
            example: example
          maxItems: 20
        visibility:
          type: string
          enum:
            - PRIVATE
            - ACCOUNT
          example: PRIVATE
        isActive:
          type: boolean
          example: false
        connectedAccountConfigs:
          type: array
          items:
            type: object
            properties:
              connectedAccountId:
                type: number
                example: 1
              useAllTools:
                type: boolean
                default: true
                example: false
              selectedToolSlugs:
                type: array
                nullable: true
                items:
                  type: string
                  example: example
            required:
              - connectedAccountId
        selectedRecordTypes:
          type: array
          items:
            type: object
            properties:
              recordTypeId:
                type: number
                example: 1
              read:
                type: boolean
                example: false
              create:
                type: boolean
                example: false
              update:
                type: boolean
                example: false
              delete:
                type: boolean
                example: false
              createActivity:
                type: boolean
                example: false
            required:
              - recordTypeId
        selectedCustomTools:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                minimum: 0
                exclusiveMinimum: true
                example: 1
              enabled:
                type: boolean
                default: true
                example: false
            required:
              - id
    PublicAgentPlaybookDeleteResult:
      type: object
      properties:
        success:
          type: boolean
          example: true
      required:
        - success
    PublicKnowledgeBase:
      type: object
      properties:
        id:
          type: number
          example: 1
        accountId:
          type: number
          example: 1
        name:
          type: string
          example: example
        description:
          type: string
          nullable: true
          example: example
        namespace:
          type: string
          nullable: true
          example: example
        isShared:
          type: boolean
          example: false
        isDefault:
          type: boolean
          example: false
        vectorStoreId:
          type: string
          nullable: true
          example: example
        createdBy:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            firstName:
              type: string
              example: example
            lastName:
              type: string
              example: example
            email:
              type: string
              format: email
              example: user@example.com
            avatar:
              type: string
              nullable: true
              example: example
          required:
            - id
            - firstName
            - lastName
            - email
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          example: example
      required:
        - id
        - accountId
        - name
        - description
        - namespace
        - isShared
        - isDefault
        - vectorStoreId
        - createdAt
        - updatedAt
    PublicKnowledgeBaseList:
      type: object
      properties:
        count:
          type: number
          example: 1
        pageSize:
          type: number
          example: 1
        pageNum:
          type: number
          example: 1
        totalPages:
          type: number
          example: 1
        cursor:
          type: number
          example: 1
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicKnowledgeBase'
        paginationType:
          type: string
          enum:
            - offset
            - cursor
          default: offset
          example: offset
        nextCursor:
          anyOf:
            - type: string
              example: example
            - type: number
              example: 1
            - nullable: true
              type: object
      required:
        - pageSize
        - results
    PublicKnowledgeBaseCreateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: example
        description:
          type: string
          nullable: true
          example: example
        isShared:
          type: boolean
          default: true
          example: false
      required:
        - name
    PublicKnowledgeBaseUpdateInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          example: example
        description:
          type: string
          nullable: true
          example: example
    PublicKnowledgeSearchResult:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              content:
                type: string
                example: example
              score:
                type: number
                example: 1
              metadata:
                type: object
                nullable: true
                additionalProperties: {}
            required:
              - content
              - score
      required:
        - results
    PublicKnowledgeSearchInput:
      type: object
      properties:
        query:
          type: string
          minLength: 1
          example: refund policy
        limit:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          maximum: 50
          example: 10
      required:
        - query
    PublicKnowledgeSource:
      type: object
      properties:
        id:
          type: number
          example: 1
        externalId:
          type: string
          nullable: true
          example: example
        knowledgeBaseId:
          type: number
          example: 1
        name:
          type: string
          example: example
        description:
          type: string
          nullable: true
          example: example
        url:
          type: string
          nullable: true
          example: example
        sourceType:
          type: string
          enum:
            - UNKNOWN
            - FILE
            - URL
            - ARTICLE
            - QNA
            - WEBPAGE
            - FOLDER
          example: UNKNOWN
        websiteSourceId:
          type: number
          nullable: true
          example: 1
        autoSyncFrequency:
          type: string
          enum:
            - NONE
            - DAILY
            - WEEKLY
            - MONTHLY
          example: NONE
        status:
          type: string
          enum:
            - NONE
            - PROCESSING
            - COMPLETED
            - FAILED
            - DELETING
            - DELETED
            - SYNCING
            - REJECTED
          example: NONE
        charactersCount:
          type: number
          example: 1
        ingestJobRunId:
          type: string
          nullable: true
          example: example
        fileExtensionType:
          type: string
          nullable: true
          enum:
            - UNKNOWN
            - PDF
            - DOC
            - DOCX
            - TXT
            - CSV
            - JSON
            - MD
            - HTML
          example: UNKNOWN
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          example: example
        lastSyncedAt:
          type: string
          nullable: true
          example: example
        folderId:
          type: number
          nullable: true
          example: 1
        parsedTextFileUrl:
          type: string
          nullable: true
          example: example
        parsedText:
          type: string
          nullable: true
          example: example
        websiteSource:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            name:
              type: string
              example: example
            sourceUrl:
              type: string
              example: example
            websiteType:
              type: string
              enum:
                - WEBSITE_CRAWL
                - SITEMAP
              example: WEBSITE_CRAWL
            status:
              type: string
              enum:
                - PROCESSING
                - SYNCING
                - COMPLETED
                - FAILED
                - DELETING
                - DELETED
              example: PROCESSING
            autoSyncFrequency:
              type: string
              enum:
                - NONE
                - DAILY
                - WEEKLY
                - MONTHLY
              example: NONE
            lastSyncedAt:
              type: string
              nullable: true
              example: example
            webPages:
              type: number
              nullable: true
              example: 1
            _count:
              type: object
              nullable: true
              properties:
                webPages:
                  type: number
                  nullable: true
                  example: 1
          required:
            - id
            - name
            - sourceUrl
            - websiteType
            - status
            - autoSyncFrequency
            - lastSyncedAt
        addedByUser:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            firstName:
              type: string
              example: example
            lastName:
              type: string
              example: example
            avatar:
              type: string
              nullable: true
              example: example
          required:
            - id
            - firstName
            - lastName
        scrapeOptions:
          type: object
          nullable: true
          properties:
            includeSelectors:
              type: array
              items:
                type: string
                example: example
            excludeSelectors:
              type: array
              items:
                type: string
                example: example
      required:
        - id
        - externalId
        - knowledgeBaseId
        - name
        - description
        - url
        - sourceType
        - websiteSourceId
        - autoSyncFrequency
        - status
        - charactersCount
        - ingestJobRunId
        - fileExtensionType
        - createdAt
        - updatedAt
        - lastSyncedAt
        - folderId
        - parsedTextFileUrl
        - addedByUser
    PublicKnowledgeSourceList:
      type: object
      properties:
        count:
          type: number
          example: 1
        pageSize:
          type: number
          example: 1
        pageNum:
          type: number
          example: 1
        totalPages:
          type: number
          example: 1
        cursor:
          type: number
          example: 1
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicKnowledgeSource'
        paginationType:
          type: string
          enum:
            - offset
            - cursor
          default: offset
          example: offset
        nextCursor:
          anyOf:
            - type: string
              example: example
            - type: number
              example: 1
            - nullable: true
              type: object
      required:
        - pageSize
        - results
    PublicKnowledgeUrlSourceInput:
      type: object
      properties:
        urls:
          type: array
          items:
            type: string
            format: uri
            example: https://api.example.com/contacts/123
          minItems: 1
          maxItems: 10
        description:
          type: string
          maxLength: 1000
          example: example
        type:
          type: string
          enum:
            - UNKNOWN
            - FILE
            - URL
            - ARTICLE
            - QNA
            - WEBPAGE
            - FOLDER
          default: URL
          example: UNKNOWN
        autoSyncFrequency:
          type: string
          enum:
            - NONE
            - DAILY
            - WEEKLY
            - MONTHLY
          default: NONE
          example: NONE
        scrapeOptions:
          type: object
          properties:
            includeSelectors:
              type: array
              items:
                type: string
                example: example
            excludeSelectors:
              type: array
              items:
                type: string
                example: example
      required:
        - urls
    PublicKnowledgeWebsiteCrawl:
      type: object
      properties:
        id:
          type: number
          example: 1
        name:
          type: string
          example: example
        description:
          type: string
          maxLength: 1000
          example: example
        sourceUrl:
          type: string
          format: uri
          example: https://api.example.com/contacts/123
        websiteType:
          type: string
          enum:
            - WEBSITE_CRAWL
            - SITEMAP
          example: WEBSITE_CRAWL
        maxDepth:
          type: integer
          minimum: 1
          maximum: 10
          example: 1
        maxLinks:
          type: integer
          minimum: 1
          maximum: 1000
          example: 1
        includePaths:
          type: array
          items:
            type: string
            example: example
        excludePaths:
          type: array
          items:
            type: string
            example: example
        scrapeOptions:
          type: object
          nullable: true
          properties:
            includeSelectors:
              type: array
              items:
                type: string
                example: example
            excludeSelectors:
              type: array
              items:
                type: string
                example: example
          default: null
        autoSyncFrequency:
          type: string
          enum:
            - NONE
            - DAILY
            - WEEKLY
            - MONTHLY
          example: NONE
      required:
        - id
        - name
        - sourceUrl
        - websiteType
        - maxLinks
    PublicKnowledgeWebsiteCrawlInput:
      type: object
      properties:
        description:
          type: string
          maxLength: 1000
          example: example
        sourceUrl:
          type: string
          format: uri
          example: https://api.example.com/contacts/123
        websiteType:
          type: string
          enum:
            - WEBSITE_CRAWL
            - SITEMAP
          example: WEBSITE_CRAWL
        maxDepth:
          type: integer
          minimum: 1
          maximum: 5
          example: 1
        maxLinks:
          type: integer
          minimum: 1
          maximum: 1000
          example: 1
        includePaths:
          type: array
          items:
            type: string
            example: example
        excludePaths:
          type: array
          items:
            type: string
            example: example
        scrapeOptions:
          type: object
          properties:
            includeSelectors:
              type: array
              items:
                type: string
                example: example
            excludeSelectors:
              type: array
              items:
                type: string
                example: example
        autoSyncFrequency:
          type: string
          enum:
            - NONE
            - DAILY
            - WEEKLY
            - MONTHLY
          example: NONE
      required:
        - sourceUrl
        - websiteType
        - maxLinks
    PublicKnowledgeSourceResyncResult:
      type: object
      properties:
        itemsQueued:
          type: number
          example: 1
        itemsSkipped:
          type: number
          example: 1
        details:
          type: array
          items:
            type: object
            properties:
              sourceId:
                type: number
                example: 1
              status:
                type: string
                example: example
              error:
                type: string
                nullable: true
                example: example
            required:
              - sourceId
              - status
              - error
      required:
        - itemsQueued
        - itemsSkipped
        - details
    PublicKnowledgeSourceResyncInput:
      type: object
      properties:
        sourceIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          minItems: 1
          maxItems: 50
      required:
        - sourceIds
    PublicKnowledgeSourceRemoveInput:
      type: object
      properties:
        sourceIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          minItems: 1
          maxItems: 100
      required:
        - sourceIds
    PublicKnowledgeWebsiteResyncInput:
      type: object
      properties:
        description:
          type: string
          maxLength: 1000
          example: example
        maxDepth:
          type: integer
          minimum: 1
          maximum: 5
          example: 1
        maxLinks:
          type: integer
          minimum: 1
          maximum: 1000
          example: 1
        includePaths:
          type: array
          items:
            type: string
            example: example
        excludePaths:
          type: array
          items:
            type: string
            example: example
        scrapeOptions:
          type: object
          properties:
            includeSelectors:
              type: array
              items:
                type: string
                example: example
            excludeSelectors:
              type: array
              items:
                type: string
                example: example
        autoSyncFrequency:
          type: string
          enum:
            - NONE
            - DAILY
            - WEEKLY
            - MONTHLY
          example: NONE
    PublicKnowledgeSyncSummary:
      type: object
      properties:
        id:
          type: number
          example: 1
        syncType:
          type: string
          enum:
            - INITIAL_SYNC
            - MANUAL_RESYNC
            - AUTO_RESYNC
          example: INITIAL_SYNC
        status:
          type: string
          enum:
            - PROCESSING
            - SYNCING
            - COMPLETED
            - FAILED
            - DELETING
            - DELETED
          example: PROCESSING
        startedAt:
          type: string
          example: example
        finishedAt:
          type: string
          nullable: true
          example: example
        duration:
          type: number
          nullable: true
          example: 1
        syncedPages:
          type: number
          example: 1
        failedPages:
          type: number
          example: 1
        rejectedPages:
          type: number
          example: 1
        removedPages:
          type: number
          example: 1
        totalPages:
          type: number
          example: 1
        errorMessage:
          type: string
          nullable: true
          example: example
        ingestJobRunId:
          type: string
          nullable: true
          example: example
        websiteSourceId:
          type: number
          example: 1
        knowledgeBaseId:
          type: number
          example: 1
        triggeredByUserId:
          type: number
          nullable: true
          example: 1
        websiteSource:
          type: object
          properties:
            id:
              type: number
              example: 1
            name:
              type: string
              example: example
            sourceUrl:
              type: string
              example: example
            websiteType:
              type: string
              enum:
                - WEBSITE_CRAWL
                - SITEMAP
              example: WEBSITE_CRAWL
          required:
            - id
            - name
            - sourceUrl
            - websiteType
        triggeredByUser:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            firstName:
              type: string
              example: example
            lastName:
              type: string
              example: example
            avatar:
              type: string
              nullable: true
              example: example
          required:
            - id
            - firstName
            - lastName
            - avatar
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          example: example
      required:
        - id
        - syncType
        - status
        - startedAt
        - finishedAt
        - duration
        - syncedPages
        - failedPages
        - rejectedPages
        - removedPages
        - totalPages
        - errorMessage
        - ingestJobRunId
        - websiteSourceId
        - knowledgeBaseId
        - triggeredByUserId
        - websiteSource
        - triggeredByUser
        - createdAt
        - updatedAt
    PublicKnowledgeSyncSummaryList:
      type: object
      properties:
        count:
          type: number
          example: 1
        pageSize:
          type: number
          example: 1
        pageNum:
          type: number
          example: 1
        totalPages:
          type: number
          example: 1
        cursor:
          type: number
          example: 1
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicKnowledgeSyncSummary'
        paginationType:
          type: string
          enum:
            - offset
            - cursor
          default: offset
          example: offset
        nextCursor:
          anyOf:
            - type: string
              example: example
            - type: number
              example: 1
            - nullable: true
              type: object
      required:
        - pageSize
        - results
    PublicKnowledgeBaseAssignment:
      type: object
      properties:
        id:
          type: number
          example: 1
        knowledgeBaseId:
          type: number
          example: 1
        assistantId:
          type: string
          example: example
        maxUserProfileId:
          type: number
          example: 1
        assignedAt:
          type: string
          example: example
        knowledgeBase:
          type: object
          properties:
            id:
              type: number
              example: 1
            name:
              type: string
              example: example
            description:
              type: string
              nullable: true
              example: example
            namespace:
              type: string
              nullable: true
              example: example
            isShared:
              type: boolean
              example: false
            isDefault:
              type: boolean
              example: false
            createdAt:
              type: string
              example: example
            updatedAt:
              type: string
              example: example
          required:
            - id
            - name
            - description
            - namespace
            - isShared
            - isDefault
            - createdAt
            - updatedAt
      required:
        - id
        - knowledgeBaseId
        - assignedAt
        - knowledgeBase
    PublicKnowledgeBaseAssignmentList:
      type: array
      items:
        $ref: '#/components/schemas/PublicKnowledgeBaseAssignment'
    PublicKnowledgeBaseAssignInput:
      type: object
      properties:
        knowledgeBaseIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          example:
            - 12
            - 13
      required:
        - knowledgeBaseIds
    PublicWorkflowNodeCreated:
      allOf:
        - $ref: '#/components/schemas/PublicWorkflowNode'
        - type: object
          properties:
            alias:
              type: string
              example: API Call
          required:
            - alias
    PublicWorkflowNodeCreateInput:
      type: object
      properties:
        node:
          type: object
          properties:
            name:
              type: string
              example: Initial trigger
            position:
              type: object
              properties:
                positionX:
                  type: number
                  example: 1
                positionY:
                  type: number
                  example: 1
              required:
                - positionX
                - positionY
            type:
              type: string
              enum:
                - TRIGGER
                - SCHEDULED_TRIGGER
                - WEBHOOK
                - TOOLS_AI
                - API
                - CONDITIONAL_ROUTING
                - AI_CAPTURE
                - DATA_TRANSFORMER
                - DYNAMIC_TABLES
                - ITERATION
                - BREAK
                - AUTOMATION_STATUS
                - SEND_MESSAGE
                - SEND_WHATSAPP_MESSAGE
                - TRANSCRIPTION
                - FILE_ANALYSIS
                - CREATE_RECORD_ACTIVITY
              example: TRIGGER
            data:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - TRIGGER
                      example: TRIGGER
                    triggerType:
                      type: string
                      nullable: true
                      enum:
                        - CONVERSATION_ENDED
                        - CONTACT_CREATED
                        - CONTACT_UPDATED
                        - FEEDBACK_CAPTURED
                        - INCOMING_WEBHOOK
                        - TABLE_ROW_CREATED
                        - OBJECT_RECORD_CREATED
                        - TABLE_ROW_UPDATED
                        - OBJECT_RECORD_UPDATED
                        - CONVERSATION_IDLE
                        - COMPOSIO_TRIGGER
                      example: CONVERSATION_ENDED
                    triggeredBy:
                      type: string
                      nullable: true
                      enum:
                        - BOTH
                        - AGENT
                        - USER
                        - INCOMING_WEBHOOK
                      example: BOTH
                    triggeredByAgentIds:
                      type: array
                      items:
                        type: string
                        example: example
                    triggerByWebhookIds:
                      type: array
                      items:
                        type: string
                        example: example
                    triggeredByTableId:
                      type: number
                      nullable: true
                      example: 1
                    triggeredByRecordTypeId:
                      type: number
                      nullable: true
                      example: 1
                    connectedAccountTriggerId:
                      type: string
                      nullable: true
                      example: example
                    triggerToolkit:
                      type: string
                      nullable: true
                      example: example
                    triggerSlug:
                      type: string
                      nullable: true
                      example: example
                    triggerConfig:
                      type: object
                      nullable: true
                      additionalProperties: {}
                    triggerQueryConfig:
                      type: object
                      nullable: true
                      properties:
                        query:
                          type: object
                          description: >-
                            Dynamic-table query: a single `{ path, operator,
                            value }` condition, or a nested `{ operator: 'and' |
                            'or', conditions: [...] }` group.
                    connectedAccountId:
                      type: number
                      nullable: true
                      example: 1
                  required:
                    - type
                  additionalProperties: false
                  description: >-
                    Event-based entry point. Conversation triggers
                    (CONVERSATION_ENDED, CONVERSATION_IDLE, FEEDBACK_CAPTURED)
                    only fire for the agents listed in triggeredByAgentIds —
                    leave it empty and the workflow never runs. Get the ids from
                    GET /public/v1/agents.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - SCHEDULED_TRIGGER
                      example: SCHEDULED_TRIGGER
                    cronExpression:
                      type: string
                      description: >-
                        Cron expression (default preset). Validated by
                        cron-validate.
                      example: 0 9 * * 1-5
                    timezone:
                      type: string
                      description: >-
                        IANA timezone identifier. Validated against the host ICU
                        table.
                      example: America/Argentina/Buenos_Aires
                    startTime:
                      type: string
                      nullable: true
                      example: example
                    endTime:
                      type: string
                      nullable: true
                      example: example
                    startDate:
                      type: string
                      nullable: true
                      example: example
                    endDate:
                      type: string
                      nullable: true
                      example: example
                    frequency:
                      type: string
                      nullable: true
                      enum:
                        - INTERVALS
                        - DAILY
                        - WEEKLY
                        - MONTHLY
                      example: INTERVALS
                  required:
                    - type
                    - cronExpression
                    - timezone
                    - startTime
                    - endTime
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - WEBHOOK
                      example: WEBHOOK
                    includeConversationTranscript:
                      type: boolean
                      default: false
                      example: false
                    includeContactInfo:
                      type: boolean
                      default: false
                      example: false
                    includeFeedbackCaptured:
                      type: boolean
                      default: false
                      example: false
                    includeCapturedVariables:
                      type: boolean
                      default: false
                      example: false
                    includeWebhookPayload:
                      type: boolean
                      default: false
                      example: false
                    url:
                      type: string
                      nullable: true
                      format: uri
                      example: https://api.example.com/contacts/123
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - TOOLS_AI
                      example: TOOLS_AI
                    conditions:
                      type: array
                      items:
                        type: object
                        properties:
                          handleId:
                            type: string
                            example: example
                          expression:
                            type: string
                            example: example
                        required:
                          - handleId
                          - expression
                    temperature:
                      type: number
                      example: 1
                    model:
                      type: string
                      example: example
                    aiVendor:
                      type: string
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    instructions:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    customToolIds:
                      type: array
                      nullable: true
                      items:
                        type: number
                        example: 1
                    maxIterations:
                      type: number
                      minimum: 1
                      maximum: 30
                      default: 10
                      example: 1
                    agentType:
                      type: string
                      enum:
                        - BASIC
                        - ADVANCED
                      default: BASIC
                      example: BASIC
                    captureVariables:
                      type: array
                      nullable: true
                      items:
                        nullable: true
                        type: object
                    knowledgeBaseMode:
                      type: string
                      enum:
                        - DEFAULT
                        - CUSTOM
                        - DISABLED
                      default: DEFAULT
                      example: DEFAULT
                    knowledgeBaseIds:
                      type: array
                      nullable: true
                      items:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                    selectedRecordTypes:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          recordTypeId:
                            type: number
                            example: 1
                          read:
                            type: boolean
                            example: false
                          create:
                            type: boolean
                            example: false
                          update:
                            type: boolean
                            example: false
                          delete:
                            type: boolean
                            example: false
                          createActivity:
                            type: boolean
                            example: false
                        required:
                          - recordTypeId
                    systemToolsConfig:
                      type: object
                      nullable: true
                      properties:
                        webSearchEnabled:
                          type: boolean
                          default: false
                          example: false
                        urlScrapeEnabled:
                          type: boolean
                          default: false
                          example: false
                        linkedinSearchEnabled:
                          type: boolean
                          default: false
                          example: false
                    connectedAccountConfigs:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          connectedAccountId:
                            type: number
                            example: 1
                          useAllTools:
                            type: boolean
                            default: true
                            example: false
                          selectedToolSlugs:
                            type: array
                            nullable: true
                            items:
                              type: string
                              example: example
                        required:
                          - connectedAccountId
                    playbookIds:
                      type: array
                      nullable: true
                      items:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                    aiModelId:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - type
                    - conditions
                    - instructions
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - API
                      example: API
                    url:
                      type: string
                      format: uri
                      example: https://api.example.com/hook
                    method:
                      type: string
                      enum:
                        - GET
                        - POST
                        - PUT
                        - DELETE
                        - PATCH
                      example: GET
                    headers:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                        required:
                          - key
                          - value
                    body:
                      type: string
                      nullable: true
                      example: example
                    response:
                      type: string
                      nullable: true
                      example: example
                    parameters:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                        required:
                          - key
                          - value
                    variables:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                          fullResponse:
                            type: boolean
                            default: false
                            example: false
                        required:
                          - key
                          - value
                  required:
                    - type
                    - url
                    - method
                    - headers
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - CONDITIONAL_ROUTING
                      example: CONDITIONAL_ROUTING
                    routingType:
                      type: string
                      enum:
                        - CONDITIONAL_AI
                        - DYNAMIC
                      example: CONDITIONAL_AI
                    conditions:
                      type: array
                      items:
                        type: object
                        properties:
                          handleId:
                            type: string
                            example: example
                          expression:
                            type: string
                            example: example
                        required:
                          - handleId
                          - expression
                    temperature:
                      type: number
                      example: 1
                    model:
                      type: string
                      example: example
                    aiVendor:
                      type: string
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    aiModelId:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - type
                    - routingType
                    - conditions
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - AI_CAPTURE
                      example: AI_CAPTURE
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    model:
                      type: string
                      example: example
                    aiVendor:
                      type: string
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    instructions:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      example: 1
                    captureVariables:
                      type: array
                      items:
                        nullable: true
                        type: object
                    knowledgeBaseMode:
                      type: string
                      enum:
                        - DEFAULT
                        - CUSTOM
                        - DISABLED
                      default: DEFAULT
                      example: DEFAULT
                    knowledgeBaseIds:
                      type: array
                      nullable: true
                      items:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                  required:
                    - type
                    - model
                    - aiVendor
                    - prompt
                    - temperature
                    - captureVariables
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - DATA_TRANSFORMER
                      example: DATA_TRANSFORMER
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      default: 0.7
                      example: 1
                    model:
                      type: string
                      nullable: true
                      example: example
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    aiModelId:
                      type: integer
                      nullable: true
                      example: 1
                    outputJson:
                      type: string
                      nullable: true
                      example: example
                    outputMode:
                      type: string
                      nullable: true
                      enum:
                        - JSON
                        - KEY_VALUE
                        - TEXT
                      example: JSON
                    keyValuePairs:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: example
                          value:
                            type: string
                            example: example
                        required:
                          - key
                          - value
                  required:
                    - type
                    - prompt
                    - model
                    - aiVendor
                    - outputMode
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - DYNAMIC_TABLES
                      example: DYNAMIC_TABLES
                    tableId:
                      type: number
                      nullable: true
                      example: 1
                    recordTypeId:
                      type: number
                      nullable: true
                      example: 1
                    targetRecordTypeId:
                      type: number
                      nullable: true
                      description: >-
                        Destination record type id. Required when actionType is
                        CHANGE_RECORD_TYPE.
                      example: 12
                    actionType:
                      type: string
                      nullable: true
                      enum:
                        - CREATE
                        - UPDATE
                        - DELETE
                        - SEARCH
                        - SEARCH_BY_ID
                        - CHANGE_RECORD_TYPE
                      description: >-
                        Operation to run. Required-field rules per action:
                        CREATE → rowData; UPDATE → rowId + rowData; DELETE /
                        SEARCH_BY_ID → rowId; CHANGE_RECORD_TYPE → rowId +
                        targetRecordTypeId.
                      example: CREATE
                    rowData:
                      type: object
                      nullable: true
                      additionalProperties: {}
                    inputModeByField:
                      type: object
                      nullable: true
                      additionalProperties:
                        type: string
                        enum:
                          - INPUT
                          - VARIABLE
                          - EMPTY
                        example: INPUT
                    rowId:
                      type: string
                      nullable: true
                      example: example
                    search:
                      type: string
                      nullable: true
                      example: example
                    pageNum:
                      anyOf:
                        - type: number
                          example: 1
                        - type: string
                          example: example
                        - nullable: true
                          type: object
                    pageSize:
                      anyOf:
                        - type: number
                          example: 1
                        - type: string
                          example: example
                        - nullable: true
                          type: object
                    pageNumMode:
                      type: string
                      nullable: true
                      enum:
                        - INPUT
                        - VARIABLE
                        - EMPTY
                      example: INPUT
                    pageSizeMode:
                      type: string
                      nullable: true
                      enum:
                        - INPUT
                        - VARIABLE
                        - EMPTY
                      example: INPUT
                    sort:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            example: example
                          type:
                            type: string
                            enum:
                              - asc
                              - desc
                            example: asc
                        required:
                          - path
                          - type
                    query:
                      $ref: '#/components/schemas/DynamicTablesQuery'
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - ITERATION
                      example: ITERATION
                    variableName:
                      type: string
                      default: ''
                      example: example
                    variablePath:
                      type: string
                      default: ''
                      example: example
                    continueOnError:
                      type: boolean
                      default: false
                      example: false
                  required:
                    - type
                  description: >-
                    Loop node. Wire type is ITERATION. Connect edges with
                    sourceHandle body (for-each), completed (after all items),
                    and empty (null/empty list). At most 50 items per loop
                    invocation; if the resolved array has more than 50 items,
                    the automation run fails before the loop body starts (no
                    items processed). Automations are also limited to 500 node
                    execution steps total. Not available in agent flows.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - BREAK
                      example: BREAK
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - AUTOMATION_STATUS
                      example: AUTOMATION_STATUS
                    automationId:
                      type: integer
                      nullable: true
                      minimum: 0
                      exclusiveMinimum: true
                      example: 1
                    automationName:
                      type: string
                      nullable: true
                      example: example
                    action:
                      type: string
                      enum:
                        - SET_ACTIVE
                        - SET_DRAFT
                        - TOGGLE
                      default: SET_ACTIVE
                      example: SET_ACTIVE
                  required:
                    - type
                  description: >-
                    Changes another automation's status (live/draft/toggle).
                    Does not publish draft graph changes.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - SEND_MESSAGE
                      example: SEND_MESSAGE
                    whatsapp:
                      type: object
                      nullable: true
                      properties:
                        messageType:
                          type: string
                          enum:
                            - STATIC
                            - DYNAMIC
                            - WHATSAPP_TEMPLATE
                          example: STATIC
                        message:
                          type: string
                          nullable: true
                          example: example
                        prompt:
                          type: string
                          nullable: true
                          example: example
                        temperature:
                          type: number
                          nullable: true
                          example: 1
                        aiModelId:
                          type: number
                          nullable: true
                          example: 1
                        aiVendor:
                          type: string
                          nullable: true
                          enum:
                            - OPENAI
                            - ANTHROPIC
                            - GOOGLE
                            - AZURE
                            - DEEPSEEK
                            - LLAMA
                          example: OPENAI
                        model:
                          type: string
                          nullable: true
                          example: example
                        template:
                          type: string
                          nullable: true
                          example: example
                        templateVariables:
                          type: object
                          nullable: true
                          properties:
                            body:
                              type: object
                              additionalProperties: {}
                            header:
                              type: object
                              additionalProperties: {}
                            buttons:
                              type: array
                              items:
                                type: object
                                additionalProperties: {}
                        templateData:
                          type: object
                          nullable: true
                          additionalProperties: {}
                      required:
                        - messageType
                    instagram:
                      type: object
                      nullable: true
                      properties:
                        messageType:
                          type: string
                          enum:
                            - STATIC
                            - DYNAMIC
                            - WHATSAPP_TEMPLATE
                          example: STATIC
                        message:
                          type: string
                          nullable: true
                          example: example
                        prompt:
                          type: string
                          nullable: true
                          example: example
                        temperature:
                          type: number
                          nullable: true
                          example: 1
                        aiModelId:
                          type: number
                          nullable: true
                          example: 1
                        aiVendor:
                          type: string
                          nullable: true
                          enum:
                            - OPENAI
                            - ANTHROPIC
                            - GOOGLE
                            - AZURE
                            - DEEPSEEK
                            - LLAMA
                          example: OPENAI
                        model:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - messageType
                    messenger:
                      type: object
                      nullable: true
                      properties:
                        messageType:
                          type: string
                          enum:
                            - STATIC
                            - DYNAMIC
                            - WHATSAPP_TEMPLATE
                          example: STATIC
                        message:
                          type: string
                          nullable: true
                          example: example
                        prompt:
                          type: string
                          nullable: true
                          example: example
                        temperature:
                          type: number
                          nullable: true
                          example: 1
                        aiModelId:
                          type: number
                          nullable: true
                          example: 1
                        aiVendor:
                          type: string
                          nullable: true
                          enum:
                            - OPENAI
                            - ANTHROPIC
                            - GOOGLE
                            - AZURE
                            - DEEPSEEK
                            - LLAMA
                          example: OPENAI
                        model:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - messageType
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - SEND_WHATSAPP_MESSAGE
                      example: SEND_WHATSAPP_MESSAGE
                    recipientMode:
                      type: string
                      nullable: true
                      enum:
                        - PHONE_NUMBER
                        - PEOPLE_RECORD
                      example: PHONE_NUMBER
                    peopleRecordTypeId:
                      type: number
                      nullable: true
                      example: 1
                    peopleRowId:
                      type: string
                      nullable: true
                      example: example
                    personName:
                      type: string
                      nullable: true
                      example: example
                    phoneNumber:
                      type: string
                      nullable: true
                      example: example
                    phoneNumberId:
                      type: string
                      nullable: true
                      example: example
                    template:
                      type: string
                      nullable: true
                      example: example
                    templateVariables:
                      type: object
                      nullable: true
                      properties:
                        body:
                          type: object
                          additionalProperties: {}
                        header:
                          type: object
                          additionalProperties: {}
                        buttons:
                          type: array
                          items:
                            type: object
                            additionalProperties: {}
                  required:
                    - type
                  description: >-
                    Sends a WhatsApp Business template message. phoneNumberId
                    must belong to this account and have an assistantId
                    assigned.
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - TRANSCRIPTION
                      example: TRANSCRIPTION
                    audioUrl:
                      type: string
                      example: example
                    language:
                      type: string
                      default: es
                      example: example
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      default: gpt-4o-transcribe
                      example: example
                    captureVariables:
                      type: array
                      nullable: true
                      items:
                        nullable: true
                        type: object
                    enableDiarization:
                      type: boolean
                      default: false
                      example: false
                    captureSegmentsVariable:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        description:
                          type: string
                          example: example
                      required:
                        - id
                        - name
                  required:
                    - type
                    - audioUrl
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - FILE_ANALYSIS
                      example: FILE_ANALYSIS
                    fileUrl:
                      type: string
                      example: example
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    captureVariables:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          id:
                            type: number
                            example: 1
                          name:
                            type: string
                            example: example
                          description:
                            type: string
                            example: example
                        required:
                          - id
                          - name
                    captureOcrVariable:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        description:
                          type: string
                          example: example
                      required:
                        - id
                        - name
                  required:
                    - type
                    - fileUrl
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - CREATE_RECORD_ACTIVITY
                      example: CREATE_RECORD_ACTIVITY
                    recordTypeId:
                      nullable: true
                      type: object
                    rowId:
                      type: string
                      nullable: true
                      example: example
                    activityType:
                      type: string
                      nullable: true
                      enum:
                        - NOTE
                        - EMAIL
                        - PHONE_CALL
                        - MEETING
                        - WHATSAPP
                      example: NOTE
                    content:
                      type: string
                      nullable: true
                      example: example
                  required:
                    - type
                - nullable: true
                  type: object
          required:
            - position
            - type
      required:
        - node
    PublicWorkflowNodePatch:
      type: object
      properties:
        alias:
          type: string
          nullable: true
          example: Fetch CRM contact
        name:
          type: string
          example: Initial trigger
        position:
          type: object
          properties:
            positionX:
              type: number
              example: 1
            positionY:
              type: number
              example: 1
          required:
            - positionX
            - positionY
        type:
          type: string
          enum:
            - TRIGGER
            - SCHEDULED_TRIGGER
            - WEBHOOK
            - TOOLS_AI
            - API
            - CONDITIONAL_ROUTING
            - AI_CAPTURE
            - DATA_TRANSFORMER
            - DYNAMIC_TABLES
            - ITERATION
            - BREAK
            - AUTOMATION_STATUS
            - SEND_MESSAGE
            - SEND_WHATSAPP_MESSAGE
            - TRANSCRIPTION
            - FILE_ANALYSIS
            - CREATE_RECORD_ACTIVITY
          example: TRIGGER
        data:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TRIGGER
                  example: TRIGGER
                triggerType:
                  type: string
                  nullable: true
                  enum:
                    - CONVERSATION_ENDED
                    - CONTACT_CREATED
                    - CONTACT_UPDATED
                    - FEEDBACK_CAPTURED
                    - INCOMING_WEBHOOK
                    - TABLE_ROW_CREATED
                    - OBJECT_RECORD_CREATED
                    - TABLE_ROW_UPDATED
                    - OBJECT_RECORD_UPDATED
                    - CONVERSATION_IDLE
                    - COMPOSIO_TRIGGER
                  example: CONVERSATION_ENDED
                triggeredBy:
                  type: string
                  nullable: true
                  enum:
                    - BOTH
                    - AGENT
                    - USER
                    - INCOMING_WEBHOOK
                  example: BOTH
                triggeredByAgentIds:
                  type: array
                  items:
                    type: string
                    example: example
                triggerByWebhookIds:
                  type: array
                  items:
                    type: string
                    example: example
                triggeredByTableId:
                  type: number
                  nullable: true
                  example: 1
                triggeredByRecordTypeId:
                  type: number
                  nullable: true
                  example: 1
                connectedAccountTriggerId:
                  type: string
                  nullable: true
                  example: example
                triggerToolkit:
                  type: string
                  nullable: true
                  example: example
                triggerSlug:
                  type: string
                  nullable: true
                  example: example
                triggerConfig:
                  type: object
                  nullable: true
                  additionalProperties: {}
                triggerQueryConfig:
                  type: object
                  nullable: true
                  properties:
                    query:
                      type: object
                      description: >-
                        Dynamic-table query: a single `{ path, operator, value
                        }` condition, or a nested `{ operator: 'and' | 'or',
                        conditions: [...] }` group.
                connectedAccountId:
                  type: number
                  nullable: true
                  example: 1
              required:
                - type
              additionalProperties: false
              description: >-
                Event-based entry point. Conversation triggers
                (CONVERSATION_ENDED, CONVERSATION_IDLE, FEEDBACK_CAPTURED) only
                fire for the agents listed in triggeredByAgentIds — leave it
                empty and the workflow never runs. Get the ids from GET
                /public/v1/agents.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SCHEDULED_TRIGGER
                  example: SCHEDULED_TRIGGER
                cronExpression:
                  type: string
                  description: >-
                    Cron expression (default preset). Validated by
                    cron-validate.
                  example: 0 9 * * 1-5
                timezone:
                  type: string
                  description: >-
                    IANA timezone identifier. Validated against the host ICU
                    table.
                  example: America/Argentina/Buenos_Aires
                startTime:
                  type: string
                  nullable: true
                  example: example
                endTime:
                  type: string
                  nullable: true
                  example: example
                startDate:
                  type: string
                  nullable: true
                  example: example
                endDate:
                  type: string
                  nullable: true
                  example: example
                frequency:
                  type: string
                  nullable: true
                  enum:
                    - INTERVALS
                    - DAILY
                    - WEEKLY
                    - MONTHLY
                  example: INTERVALS
              required:
                - type
                - cronExpression
                - timezone
                - startTime
                - endTime
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - WEBHOOK
                  example: WEBHOOK
                includeConversationTranscript:
                  type: boolean
                  default: false
                  example: false
                includeContactInfo:
                  type: boolean
                  default: false
                  example: false
                includeFeedbackCaptured:
                  type: boolean
                  default: false
                  example: false
                includeCapturedVariables:
                  type: boolean
                  default: false
                  example: false
                includeWebhookPayload:
                  type: boolean
                  default: false
                  example: false
                url:
                  type: string
                  nullable: true
                  format: uri
                  example: https://api.example.com/contacts/123
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TOOLS_AI
                  example: TOOLS_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                customToolIds:
                  type: array
                  nullable: true
                  items:
                    type: number
                    example: 1
                maxIterations:
                  type: number
                  minimum: 1
                  maximum: 30
                  default: 10
                  example: 1
                agentType:
                  type: string
                  enum:
                    - BASIC
                    - ADVANCED
                  default: BASIC
                  example: BASIC
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    type: object
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                selectedRecordTypes:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      recordTypeId:
                        type: number
                        example: 1
                      read:
                        type: boolean
                        example: false
                      create:
                        type: boolean
                        example: false
                      update:
                        type: boolean
                        example: false
                      delete:
                        type: boolean
                        example: false
                      createActivity:
                        type: boolean
                        example: false
                    required:
                      - recordTypeId
                systemToolsConfig:
                  type: object
                  nullable: true
                  properties:
                    webSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                    urlScrapeEnabled:
                      type: boolean
                      default: false
                      example: false
                    linkedinSearchEnabled:
                      type: boolean
                      default: false
                      example: false
                connectedAccountConfigs:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      connectedAccountId:
                        type: number
                        example: 1
                      useAllTools:
                        type: boolean
                        default: true
                        example: false
                      selectedToolSlugs:
                        type: array
                        nullable: true
                        items:
                          type: string
                          example: example
                    required:
                      - connectedAccountId
                playbookIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - conditions
                - instructions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - API
                  example: API
                url:
                  type: string
                  format: uri
                  example: https://api.example.com/hook
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - DELETE
                    - PATCH
                  example: GET
                headers:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                body:
                  type: string
                  nullable: true
                  example: example
                response:
                  type: string
                  nullable: true
                  example: example
                parameters:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
                variables:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                      fullResponse:
                        type: boolean
                        default: false
                        example: false
                    required:
                      - key
                      - value
              required:
                - type
                - url
                - method
                - headers
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - CONDITIONAL_ROUTING
                  example: CONDITIONAL_ROUTING
                routingType:
                  type: string
                  enum:
                    - CONDITIONAL_AI
                    - DYNAMIC
                  example: CONDITIONAL_AI
                conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      handleId:
                        type: string
                        example: example
                      expression:
                        type: string
                        example: example
                    required:
                      - handleId
                      - expression
                temperature:
                  type: number
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
              required:
                - type
                - routingType
                - conditions
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - AI_CAPTURE
                  example: AI_CAPTURE
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                model:
                  type: string
                  example: example
                aiVendor:
                  type: string
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                instructions:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  example: 1
                captureVariables:
                  type: array
                  items:
                    nullable: true
                    type: object
                knowledgeBaseMode:
                  type: string
                  enum:
                    - DEFAULT
                    - CUSTOM
                    - DISABLED
                  default: DEFAULT
                  example: DEFAULT
                knowledgeBaseIds:
                  type: array
                  nullable: true
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
              required:
                - type
                - model
                - aiVendor
                - prompt
                - temperature
                - captureVariables
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - DATA_TRANSFORMER
                  example: DATA_TRANSFORMER
                prompt:
                  type: string
                  nullable: true
                  example: example
                temperature:
                  type: number
                  default: 0.7
                  example: 1
                model:
                  type: string
                  nullable: true
                  example: example
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                aiModelId:
                  type: integer
                  nullable: true
                  example: 1
                outputJson:
                  type: string
                  nullable: true
                  example: example
                outputMode:
                  type: string
                  nullable: true
                  enum:
                    - JSON
                    - KEY_VALUE
                    - TEXT
                  example: JSON
                keyValuePairs:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: example
                      value:
                        type: string
                        example: example
                    required:
                      - key
                      - value
              required:
                - type
                - prompt
                - model
                - aiVendor
                - outputMode
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - DYNAMIC_TABLES
                  example: DYNAMIC_TABLES
                tableId:
                  type: number
                  nullable: true
                  example: 1
                recordTypeId:
                  type: number
                  nullable: true
                  example: 1
                targetRecordTypeId:
                  type: number
                  nullable: true
                  description: >-
                    Destination record type id. Required when actionType is
                    CHANGE_RECORD_TYPE.
                  example: 12
                actionType:
                  type: string
                  nullable: true
                  enum:
                    - CREATE
                    - UPDATE
                    - DELETE
                    - SEARCH
                    - SEARCH_BY_ID
                    - CHANGE_RECORD_TYPE
                  description: >-
                    Operation to run. Required-field rules per action: CREATE →
                    rowData; UPDATE → rowId + rowData; DELETE / SEARCH_BY_ID →
                    rowId; CHANGE_RECORD_TYPE → rowId + targetRecordTypeId.
                  example: CREATE
                rowData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                inputModeByField:
                  type: object
                  nullable: true
                  additionalProperties:
                    type: string
                    enum:
                      - INPUT
                      - VARIABLE
                      - EMPTY
                    example: INPUT
                rowId:
                  type: string
                  nullable: true
                  example: example
                search:
                  type: string
                  nullable: true
                  example: example
                pageNum:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageSize:
                  anyOf:
                    - type: number
                      example: 1
                    - type: string
                      example: example
                    - nullable: true
                      type: object
                pageNumMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                pageSizeMode:
                  type: string
                  nullable: true
                  enum:
                    - INPUT
                    - VARIABLE
                    - EMPTY
                  example: INPUT
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - asc
                          - desc
                        example: asc
                    required:
                      - path
                      - type
                query:
                  $ref: '#/components/schemas/DynamicTablesQuery'
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - ITERATION
                  example: ITERATION
                variableName:
                  type: string
                  default: ''
                  example: example
                variablePath:
                  type: string
                  default: ''
                  example: example
                continueOnError:
                  type: boolean
                  default: false
                  example: false
              required:
                - type
              description: >-
                Loop node. Wire type is ITERATION. Connect edges with
                sourceHandle body (for-each), completed (after all items), and
                empty (null/empty list). At most 50 items per loop invocation;
                if the resolved array has more than 50 items, the automation run
                fails before the loop body starts (no items processed).
                Automations are also limited to 500 node execution steps total.
                Not available in agent flows.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - BREAK
                  example: BREAK
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - AUTOMATION_STATUS
                  example: AUTOMATION_STATUS
                automationId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                automationName:
                  type: string
                  nullable: true
                  example: example
                action:
                  type: string
                  enum:
                    - SET_ACTIVE
                    - SET_DRAFT
                    - TOGGLE
                  default: SET_ACTIVE
                  example: SET_ACTIVE
              required:
                - type
              description: >-
                Changes another automation's status (live/draft/toggle). Does
                not publish draft graph changes.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SEND_MESSAGE
                  example: SEND_MESSAGE
                whatsapp:
                  type: object
                  nullable: true
                  properties:
                    messageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                        - WHATSAPP_TEMPLATE
                      example: STATIC
                    message:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      nullable: true
                      example: 1
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                    template:
                      type: string
                      nullable: true
                      example: example
                    templateVariables:
                      type: object
                      nullable: true
                      properties:
                        body:
                          type: object
                          additionalProperties: {}
                        header:
                          type: object
                          additionalProperties: {}
                        buttons:
                          type: array
                          items:
                            type: object
                            additionalProperties: {}
                    templateData:
                      type: object
                      nullable: true
                      additionalProperties: {}
                  required:
                    - messageType
                instagram:
                  type: object
                  nullable: true
                  properties:
                    messageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                        - WHATSAPP_TEMPLATE
                      example: STATIC
                    message:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      nullable: true
                      example: 1
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                  required:
                    - messageType
                messenger:
                  type: object
                  nullable: true
                  properties:
                    messageType:
                      type: string
                      enum:
                        - STATIC
                        - DYNAMIC
                        - WHATSAPP_TEMPLATE
                      example: STATIC
                    message:
                      type: string
                      nullable: true
                      example: example
                    prompt:
                      type: string
                      nullable: true
                      example: example
                    temperature:
                      type: number
                      nullable: true
                      example: 1
                    aiModelId:
                      type: number
                      nullable: true
                      example: 1
                    aiVendor:
                      type: string
                      nullable: true
                      enum:
                        - OPENAI
                        - ANTHROPIC
                        - GOOGLE
                        - AZURE
                        - DEEPSEEK
                        - LLAMA
                      example: OPENAI
                    model:
                      type: string
                      nullable: true
                      example: example
                  required:
                    - messageType
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - SEND_WHATSAPP_MESSAGE
                  example: SEND_WHATSAPP_MESSAGE
                recipientMode:
                  type: string
                  nullable: true
                  enum:
                    - PHONE_NUMBER
                    - PEOPLE_RECORD
                  example: PHONE_NUMBER
                peopleRecordTypeId:
                  type: number
                  nullable: true
                  example: 1
                peopleRowId:
                  type: string
                  nullable: true
                  example: example
                personName:
                  type: string
                  nullable: true
                  example: example
                phoneNumber:
                  type: string
                  nullable: true
                  example: example
                phoneNumberId:
                  type: string
                  nullable: true
                  example: example
                template:
                  type: string
                  nullable: true
                  example: example
                templateVariables:
                  type: object
                  nullable: true
                  properties:
                    body:
                      type: object
                      additionalProperties: {}
                    header:
                      type: object
                      additionalProperties: {}
                    buttons:
                      type: array
                      items:
                        type: object
                        additionalProperties: {}
              required:
                - type
              description: >-
                Sends a WhatsApp Business template message. phoneNumberId must
                belong to this account and have an assistantId assigned.
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - TRANSCRIPTION
                  example: TRANSCRIPTION
                audioUrl:
                  type: string
                  example: example
                language:
                  type: string
                  default: es
                  example: example
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                model:
                  type: string
                  default: gpt-4o-transcribe
                  example: example
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    nullable: true
                    type: object
                enableDiarization:
                  type: boolean
                  default: false
                  example: false
                captureSegmentsVariable:
                  type: object
                  nullable: true
                  properties:
                    id:
                      type: number
                      example: 1
                    name:
                      type: string
                      example: example
                    description:
                      type: string
                      example: example
                  required:
                    - id
                    - name
              required:
                - type
                - audioUrl
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - FILE_ANALYSIS
                  example: FILE_ANALYSIS
                fileUrl:
                  type: string
                  example: example
                aiModelId:
                  type: number
                  nullable: true
                  example: 1
                aiVendor:
                  type: string
                  nullable: true
                  enum:
                    - OPENAI
                    - ANTHROPIC
                    - GOOGLE
                    - AZURE
                    - DEEPSEEK
                    - LLAMA
                  example: OPENAI
                model:
                  type: string
                  nullable: true
                  example: example
                prompt:
                  type: string
                  nullable: true
                  example: example
                captureVariables:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      description:
                        type: string
                        example: example
                    required:
                      - id
                      - name
                captureOcrVariable:
                  type: object
                  nullable: true
                  properties:
                    id:
                      type: number
                      example: 1
                    name:
                      type: string
                      example: example
                    description:
                      type: string
                      example: example
                  required:
                    - id
                    - name
              required:
                - type
                - fileUrl
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - CREATE_RECORD_ACTIVITY
                  example: CREATE_RECORD_ACTIVITY
                recordTypeId:
                  nullable: true
                  type: object
                rowId:
                  type: string
                  nullable: true
                  example: example
                activityType:
                  type: string
                  nullable: true
                  enum:
                    - NOTE
                    - EMAIL
                    - PHONE_CALL
                    - MEETING
                    - WHATSAPP
                  example: NOTE
                content:
                  type: string
                  nullable: true
                  example: example
              required:
                - type
            - nullable: true
              type: object
    PublicWorkflowNodeUpdateInput:
      type: object
      properties:
        node:
          $ref: '#/components/schemas/PublicWorkflowNodePatch'
      required:
        - node
    PublicWorkflowEdgeInput:
      type: object
      properties:
        edge:
          type: object
          properties:
            source:
              type: string
              example: trigger_1
            sourceHandle:
              type: string
              example: default
            target:
              type: string
              example: api_1
            targetHandle:
              type: string
              example: default
          required:
            - source
            - sourceHandle
            - target
            - targetHandle
      required:
        - edge
    PublicWorkflowEdgeDeleteInput:
      type: object
      properties:
        edge:
          type: object
          properties:
            source:
              type: string
              example: trigger_1
            sourceHandle:
              type: string
              example: default
            target:
              type: string
              example: api_1
            targetHandle:
              type: string
              example: default
          required:
            - source
            - sourceHandle
            - target
            - targetHandle
      required:
        - edge
    WorkflowAnalytics:
      type: object
      properties:
        runsByDate:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                nullable: true
                example: '2024-01-01'
              totalRuns:
                type: number
                example: 100
              completedRuns:
                type: number
                example: 95
              failedRuns:
                type: number
                example: 5
              pendingRuns:
                type: number
                example: 0
              totalCredits:
                type: number
                example: 250.5
            required:
              - date
              - totalRuns
              - completedRuns
              - failedRuns
              - pendingRuns
              - totalCredits
        summary:
          type: object
          properties:
            totalRuns:
              type: number
              example: 1000
            completedRuns:
              type: number
              example: 950
            failedRuns:
              type: number
              example: 50
            pendingRuns:
              type: number
              example: 0
            totalCredits:
              type: number
              example: 2500
            averageCreditsPerRun:
              type: number
              example: 2.5
            nonExecutedRuns:
              type: number
              example: 10
          required:
            - totalRuns
            - completedRuns
            - failedRuns
            - pendingRuns
            - totalCredits
            - averageCreditsPerRun
            - nonExecutedRuns
      required:
        - runsByDate
        - summary
    BillingPlan:
      type: object
      properties:
        planName:
          type: string
          nullable: true
          example: Professional
        creditsPerMonth:
          type: number
          nullable: true
          example: 5000
        creditsUsed:
          type: number
          example: 1250.5
        subscriptionRenews:
          type: string
          nullable: true
          example: '2026-03-25T00:00:00Z'
      required:
        - planName
        - creditsPerMonth
        - creditsUsed
        - subscriptionRenews
    PublicStudioUsage:
      type: object
      properties:
        usage:
          type: object
          nullable: true
          additionalProperties: {}
        plan:
          type: object
          nullable: true
          additionalProperties: {}
        subscription:
          type: object
          nullable: true
          additionalProperties: {}
        limits:
          type: object
          nullable: true
          additionalProperties: {}
        next:
          type: object
          nullable: true
          additionalProperties: {}
    PublicCreditHistoryItem:
      type: object
      properties:
        date:
          type: string
          example: '2026-05-12'
        aiModelId:
          type: number
          nullable: true
          example: 1
        model:
          type: string
          nullable: true
          example: gpt-4o
        modelName:
          type: string
          nullable: true
          example: GPT-4o
        analyticsColor:
          type: string
          nullable: true
          example: example
        totalCredits:
          type: number
          example: 42.5
        messageCount:
          type: number
          example: 120
      required:
        - date
        - totalCredits
        - messageCount
    PublicCreditHistory:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicCreditHistoryItem'
      required:
        - results
    PublicMaxUsage:
      type: object
      properties:
        plan:
          type: object
          nullable: true
          additionalProperties: {}
        subscription:
          type: object
          nullable: true
          additionalProperties: {}
        seats:
          type: object
          nullable: true
          additionalProperties: {}
        limits:
          type: object
          nullable: true
          additionalProperties: {}
        next:
          type: object
          nullable: true
          additionalProperties: {}
    PublicMaxSeatUser:
      type: object
      properties:
        userId:
          type: number
          example: 12
        firstName:
          type: string
          nullable: true
          example: example
        lastName:
          type: string
          nullable: true
          example: example
        email:
          type: string
          nullable: true
          example: example
        assignedAt:
          type: string
          nullable: true
          example: example
      required:
        - userId
    PublicMaxSeats:
      type: object
      properties:
        totalSeats:
          type: number
          example: 5
        assignedCount:
          type: number
          example: 3
        available:
          type: number
          example: 2
        assigned:
          type: array
          items:
            $ref: '#/components/schemas/PublicMaxSeatUser'
        unassigned:
          type: array
          items:
            type: object
            properties:
              userId:
                type: number
                example: 12
              firstName:
                type: string
                nullable: true
                example: example
              lastName:
                type: string
                nullable: true
                example: example
              email:
                type: string
                nullable: true
                example: example
            required:
              - userId
      required:
        - totalSeats
        - assignedCount
        - available
        - assigned
        - unassigned
    PublicMaxSeatResult:
      type: object
      properties:
        success:
          type: boolean
          example: true
        userId:
          type: number
          example: 12
        assigned:
          type: boolean
          description: Whether the user holds a Max seat after this operation
          example: false
      required:
        - success
        - userId
        - assigned
    PublicMaxSeatInput:
      type: object
      properties:
        userId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: ID of the user to assign/unassign (see GET /users)
          example: 12
      required:
        - userId
    PublicAgentRunMessage:
      type: object
      properties:
        id:
          type: number
          nullable: true
          example: 1
        role:
          type: string
          enum:
            - USER
            - ASSISTANT
            - SYSTEM
          example: ASSISTANT
        type:
          type: string
          enum:
            - MESSAGE
            - TRIGGER_INTENT
            - RESPONSE_AI
            - SAY_AI
            - API
            - ENTER_FLOW
            - EXIT_FLOW
            - ERROR_MESSAGE
            - SET_VARIABLES
            - OFF_TOPIC
            - CONVERSATION_ENDED
            - CONVERSATION_IDLE
            - CONDITIONAL_ROUTING
            - PROCESSED_MEDIA_WITH_AI
            - AGENT_TOOL
            - START_CONVERSATION
            - WHATSAPP_TEMPLATE_MESSAGE
            - WHATSAPP_FLOW_COMPLETED
            - MESSAGE_REACTION
            - CHANNEL_CONTEXT
            - ABORTED_MESSAGE
            - MAX_PLAN_PROPOSED
            - MAX_PLAN_STARTED
            - MAX_PLAN_COMPLETED
            - MAX_PLAN_CANCELLED
            - MAX_PLAN_QUESTIONS_PROPOSED
            - MAX_PLAN_QUESTIONS_RESOLVED
          example: MESSAGE
        text:
          type: string
          example: Hi! How can I help?
        created_at:
          type: string
          nullable: true
          example: example
      required:
        - role
        - type
        - text
    PublicAgentRunOutput:
      type: object
      properties:
        conversation_id:
          type: number
          nullable: true
          example: 42
        messages:
          type: array
          items:
            $ref: '#/components/schemas/PublicAgentRunMessage'
      required:
        - messages
    PublicAgentMessageInput:
      type: object
      properties:
        message:
          type: string
          minLength: 1
          description: >-
            The message to send. Omit on a NEW conversation to just open it and
            run the agent's Start flow (like the Overview/Playground). Required
            when continuing an existing conversation (conversation_id present).
          example: Hi, I need help with my order
        conversation_id:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Continue an existing conversation. Omit to start a new one.
          example: 42
        contact_id:
          type: string
          description: Link the conversation to a People (contact) record.
          example: example
        initial_variables:
          type: object
          additionalProperties: {}
          description: >-
            Variables to seed the conversation with when starting a new one
            (HMAC is computed server-side).
    PublicConversation:
      type: object
      properties:
        id:
          type: number
          example: 42
        name:
          type: string
          nullable: true
          example: Anonymous Visitor
        channel:
          type: string
          example: API
        is_closed:
          type: boolean
          example: false
        contact_id:
          type: string
          nullable: true
          example: example
        summary:
          type: string
          nullable: true
          description: >-
            Latest rolling summary of the conversation, if one has been
            generated.
          example: example
        contact:
          type: object
          nullable: true
          additionalProperties: {}
          description: The linked CRM contact (People record), if any.
        created_at:
          type: string
          example: example
        updated_at:
          type: string
          nullable: true
          example: example
      required:
        - id
        - channel
        - is_closed
        - created_at
    PublicConversationMessage:
      type: object
      properties:
        id:
          type: number
          nullable: true
          example: 1
        role:
          type: string
          enum:
            - USER
            - ASSISTANT
            - SYSTEM
          example: USER
        type:
          type: string
          enum:
            - MESSAGE
            - TRIGGER_INTENT
            - RESPONSE_AI
            - SAY_AI
            - API
            - ENTER_FLOW
            - EXIT_FLOW
            - ERROR_MESSAGE
            - SET_VARIABLES
            - OFF_TOPIC
            - CONVERSATION_ENDED
            - CONVERSATION_IDLE
            - CONDITIONAL_ROUTING
            - PROCESSED_MEDIA_WITH_AI
            - AGENT_TOOL
            - START_CONVERSATION
            - WHATSAPP_TEMPLATE_MESSAGE
            - WHATSAPP_FLOW_COMPLETED
            - MESSAGE_REACTION
            - CHANNEL_CONTEXT
            - ABORTED_MESSAGE
            - MAX_PLAN_PROPOSED
            - MAX_PLAN_STARTED
            - MAX_PLAN_COMPLETED
            - MAX_PLAN_CANCELLED
            - MAX_PLAN_QUESTIONS_PROPOSED
            - MAX_PLAN_QUESTIONS_RESOLVED
          example: MESSAGE
        text:
          type: string
          nullable: true
          example: example
        created_at:
          type: string
          example: example
        audit_log_id:
          type: string
          nullable: true
          description: >-
            Pointer to the message's full LLM trace. Fetch via the message trace
            endpoint.
          example: example
      required:
        - role
        - type
        - created_at
    PublicConversationTranscript:
      allOf:
        - $ref: '#/components/schemas/PublicConversation'
        - type: object
          properties:
            messages:
              type: array
              items:
                $ref: '#/components/schemas/PublicConversationMessage'
          required:
            - messages
    PublicExecutionTrace:
      type: object
      properties:
        id:
          type: string
          nullable: true
          example: example
        type:
          type: string
          nullable: true
          example: example
    PublicWorkflowLog:
      type: object
      properties:
        id:
          type: number
          example: 501
        successful:
          type: boolean
          example: false
        started_at:
          type: string
          nullable: true
          example: example
        completed_at:
          type: string
          nullable: true
          example: example
        duration:
          type: number
          nullable: true
          description: Run duration in ms.
          example: 1
        operations:
          type: number
          nullable: true
          example: 1
        ai_credits:
          type: number
          nullable: true
          example: 1
        error:
          type: string
          nullable: true
          example: example
        insufficient_credits:
          type: boolean
          nullable: true
          example: false
        prevented_loop:
          type: boolean
          nullable: true
          example: false
      required:
        - id
        - successful
    PublicWorkflowLogNodeResult:
      type: object
      properties:
        id:
          type: number
          description: Node-result ID. Use with the node trace endpoint.
          example: 1
        node_id:
          type: string
          example: example
        alias:
          type: string
          nullable: true
          example: example
        type:
          type: string
          nullable: true
          example: example
        success:
          type: boolean
          example: false
        error:
          type: string
          nullable: true
          example: example
        ai_credits:
          type: number
          nullable: true
          example: 1
        created_at:
          type: string
          example: example
        audit_log_id:
          type: string
          nullable: true
          description: >-
            Pointer to this node's full execution trace. Fetch via the node
            trace endpoint.
          example: example
      required:
        - id
        - node_id
        - success
        - created_at
    PublicWorkflowLogDetail:
      allOf:
        - $ref: '#/components/schemas/PublicWorkflowLog'
        - type: object
          properties:
            node_results:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/PublicWorkflowLogNodeResult'
    PublicUser:
      type: object
      properties:
        id:
          type: number
          example: 12
        first_name:
          type: string
          nullable: true
          example: example
        last_name:
          type: string
          nullable: true
          example: example
        full_name:
          type: string
          nullable: true
          example: example
        email:
          type: string
          nullable: true
          example: example
        avatar:
          type: string
          nullable: true
          example: example
        role:
          type: string
          enum:
            - OWNER
            - ADMIN
            - USER
          example: OWNER
        status:
          type: string
          enum:
            - ACTIVE
            - DELETED
            - INVITED
            - ONBOARDING
          example: ACTIVE
      required:
        - id
        - role
        - status
    PublicUserList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/PublicUser'
      required:
        - results
    PublicUserTask:
      type: object
      properties:
        id:
          type: number
          example: 101
        content:
          type: string
          example: Email David Booth about Q3 renewal
        due_date:
          type: string
          nullable: true
          example: '2026-06-25T00:00:00Z'
        completed:
          type: boolean
          example: false
        completed_at:
          type: string
          nullable: true
          example: null
        created_at:
          type: string
          example: '2026-06-01T12:00:00Z'
        updated_at:
          type: string
          example: '2026-06-01T12:00:00Z'
        created_by:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 42
            name:
              type: string
              nullable: true
              example: Alvaro Vargas
            email:
              type: string
              nullable: true
              example: alvaro@example.com
          required:
            - id
        completed_by:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 42
            name:
              type: string
              nullable: true
              example: Alvaro Vargas
            email:
              type: string
              nullable: true
              example: alvaro@example.com
          required:
            - id
        assignees:
          type: array
          items:
            type: object
            properties:
              id:
                type: number
                example: 42
              name:
                type: string
                nullable: true
                example: Alvaro Vargas
              email:
                type: string
                nullable: true
                example: alvaro@example.com
            required:
              - id
          description: Assigned users
        related:
          type: object
          nullable: true
          properties:
            object_name:
              type: string
              nullable: true
              description: >-
                Object the task is linked to (the slug used in /objects
                commands).
              example: companies
            object_label:
              type: string
              nullable: true
              example: Companies
            row_id:
              type: string
              nullable: true
              example: abc123
          description: Linked object record, if the task is attached to one (else null).
      required:
        - id
        - content
        - completed
        - created_at
        - updated_at
        - assignees
    PublicUserTaskCreateInput:
      type: object
      properties:
        content:
          type: string
          minLength: 1
          example: Email David Booth about Q3 renewal
        due_date:
          type: string
          nullable: true
          example: '2026-06-25'
        assignee_ids:
          type: array
          items:
            type: number
            example: 1
          description: User IDs (see GET /users).
          example:
            - 42
        object_name:
          type: string
          minLength: 1
          description: Link the task to an object record (requires row_id too).
          example: companies
        row_id:
          type: string
          minLength: 1
          example: abc123
      required:
        - content
    PublicUserTaskUpdateInput:
      type: object
      properties:
        content:
          type: string
          minLength: 1
          example: example
        due_date:
          type: string
          nullable: true
          description: Pass null to clear the due date.
          example: example
        assignee_ids:
          type: array
          items:
            type: number
            example: 1
        object_name:
          type: string
          nullable: true
          minLength: 1
          description: Pass null (with row_id null) to unlink the object record.
          example: example
        row_id:
          type: string
          nullable: true
          minLength: 1
          example: example
    PublicWhatsAppNumber:
      type: object
      properties:
        id:
          type: number
          example: 1
        phoneNumberId:
          type: string
          example: example
        assistantId:
          type: string
          nullable: true
          example: example
        assistant:
          type: object
          nullable: true
          properties:
            id:
              type: string
              example: example
            name:
              type: string
              example: example
          required:
            - id
            - name
        status:
          type: string
          enum:
            - CONNECTED
            - PENDING
            - UNREGISTERED
            - ERROR
            - VERIFICATION_PENDING
            - DELETED
          example: CONNECTED
        wabaId:
          type: string
          example: example
        name:
          type: string
          example: example
        about:
          type: string
          nullable: true
          example: example
        description:
          type: string
          nullable: true
          example: example
        address:
          type: string
          nullable: true
          example: example
        category:
          type: string
          enum:
            - AUTO
            - BEAUTY
            - APPAREL
            - EDU
            - ENTERTAIN
            - EVENT_PLAN
            - FINANCE
            - GROCERY
            - GOVT
            - HOTEL
            - HEALTH
            - NONPROFIT
            - PROF_SERVICES
            - RETAIL
            - TRAVEL
            - RESTAURANT
            - OTHER
            - UNDEFINED
          example: AUTO
        displayPhoneNumber:
          type: string
          example: example
        website:
          type: string
          nullable: true
          example: example
        secondaryWebsite:
          type: string
          nullable: true
          example: example
        verificationStatus:
          type: string
          enum:
            - VERIFIED
            - NOT_VERIFIED
          example: VERIFIED
        image:
          type: string
          nullable: true
          example: example
        email:
          type: string
          nullable: true
          example: example
        createdAt:
          type: string
          example: example
        updatedAt:
          type: string
          example: example
      required:
        - id
        - phoneNumberId
        - assistantId
        - status
        - wabaId
        - name
        - about
        - description
        - address
        - category
        - displayPhoneNumber
        - website
        - secondaryWebsite
        - verificationStatus
        - image
        - email
        - createdAt
        - updatedAt
    PublicChannelIntegrations:
      type: object
      nullable: true
      properties:
        id:
          type: number
          example: 1
        accountId:
          type: number
          example: 1
        whatsapp:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            integrationId:
              type: number
              example: 1
            status:
              type: string
              enum:
                - PENDING
                - ACTIVE
                - DELETED
              example: PENDING
            integratedById:
              type: number
              example: 1
            integratedBy:
              type: object
              properties:
                firstName:
                  type: string
                  example: example
                lastName:
                  type: string
                  example: example
                avatar:
                  type: string
                  nullable: true
                  example: example
              required:
                - firstName
                - lastName
            phoneNumbers:
              type: array
              items:
                $ref: '#/components/schemas/PublicWhatsAppNumber'
            allocationId:
              type: string
              nullable: true
              example: example
            expirationTime:
              type: string
              nullable: true
              example: example
            createdAt:
              type: string
              example: example
            updatedAt:
              type: string
              example: example
          required:
            - id
            - integrationId
            - status
            - integratedById
            - integratedBy
            - phoneNumbers
            - allocationId
            - createdAt
            - updatedAt
        instagram:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            integrationId:
              type: number
              example: 1
            status:
              type: string
              enum:
                - PENDING
                - ACTIVE
                - EXPIRED
                - DELETED
              example: PENDING
            integratedById:
              type: number
              example: 1
            integratedBy:
              type: object
              properties:
                firstName:
                  type: string
                  example: example
                lastName:
                  type: string
                  example: example
                avatar:
                  type: string
                  nullable: true
                  example: example
              required:
                - firstName
                - lastName
            instagramAccounts:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  instagramUserId:
                    type: string
                    example: example
                  username:
                    type: string
                    example: example
                  accountType:
                    type: string
                    enum:
                      - BUSINESS
                      - CREATOR
                    example: BUSINESS
                  profilePictureUrl:
                    type: string
                    nullable: true
                    example: example
                  followersCount:
                    type: number
                    nullable: true
                    example: 1
                  mediaCount:
                    type: number
                    nullable: true
                    example: 1
                  assistantId:
                    type: string
                    nullable: true
                    example: example
                  createdAt:
                    type: string
                    example: example
                  updatedAt:
                    type: string
                    example: example
                required:
                  - id
                  - instagramUserId
                  - username
                  - accountType
                  - profilePictureUrl
                  - followersCount
                  - mediaCount
                  - assistantId
                  - createdAt
                  - updatedAt
            tokenExpiresAt:
              type: string
              nullable: true
              example: example
            createdAt:
              type: string
              example: example
            updatedAt:
              type: string
              example: example
          required:
            - id
            - integrationId
            - status
            - integratedById
            - integratedBy
            - instagramAccounts
            - tokenExpiresAt
            - createdAt
            - updatedAt
        messenger:
          type: object
          nullable: true
          properties:
            id:
              type: number
              example: 1
            integrationId:
              type: number
              example: 1
            status:
              type: string
              enum:
                - PENDING
                - ACTIVE
                - EXPIRED
                - DELETED
              example: PENDING
            integratedById:
              type: number
              example: 1
            integratedBy:
              type: object
              properties:
                firstName:
                  type: string
                  example: example
                lastName:
                  type: string
                  example: example
                avatar:
                  type: string
                  nullable: true
                  example: example
              required:
                - firstName
                - lastName
            messengerPages:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: number
                    example: 1
                  messengerPageId:
                    type: string
                    example: example
                  businessAccountId:
                    type: string
                    nullable: true
                    example: example
                  pageName:
                    type: string
                    example: example
                  pageType:
                    type: string
                    enum:
                      - business
                    example: business
                  pagePictureUrl:
                    type: string
                    nullable: true
                    example: example
                  followersCount:
                    type: number
                    nullable: true
                    example: 1
                  likesCount:
                    type: number
                    nullable: true
                    example: 1
                  assistantId:
                    type: string
                    nullable: true
                    example: example
                  createdAt:
                    type: string
                    example: example
                  updatedAt:
                    type: string
                    example: example
                required:
                  - id
                  - messengerPageId
                  - businessAccountId
                  - pageName
                  - pageType
                  - pagePictureUrl
                  - followersCount
                  - likesCount
                  - assistantId
                  - createdAt
                  - updatedAt
            createdAt:
              type: string
              example: example
            updatedAt:
              type: string
              example: example
          required:
            - id
            - integrationId
            - status
            - integratedById
            - integratedBy
            - messengerPages
            - createdAt
            - updatedAt
      required:
        - id
        - accountId
        - whatsapp
        - instagram
        - messenger
    PublicWhatsAppBusinessInfo:
      type: object
      properties:
        about:
          type: string
          nullable: true
          example: example
        address:
          type: string
          nullable: true
          example: example
        description:
          type: string
          nullable: true
          example: example
        email:
          type: string
          nullable: true
          example: example
        profile_picture_url:
          type: string
          nullable: true
          example: example
        websites:
          type: array
          nullable: true
          items:
            type: string
            example: example
        vertical:
          type: string
          nullable: true
          enum:
            - AUTO
            - BEAUTY
            - APPAREL
            - EDU
            - ENTERTAIN
            - EVENT_PLAN
            - FINANCE
            - GROCERY
            - GOVT
            - HOTEL
            - HEALTH
            - NONPROFIT
            - PROF_SERVICES
            - RETAIL
            - TRAVEL
            - RESTAURANT
            - OTHER
            - UNDEFINED
          example: AUTO
    PublicWhatsAppNumberUpdateInput:
      type: object
      properties:
        description:
          type: string
          nullable: true
          maxLength: 512
          example: example
        website:
          type: string
          nullable: true
          maxLength: 256
          example: example
        secondaryWebsite:
          type: string
          nullable: true
          maxLength: 256
          example: example
        address:
          type: string
          nullable: true
          maxLength: 256
          example: example
        email:
          type: string
          nullable: true
          maxLength: 128
          format: email
          example: user@example.com
        about:
          type: string
          nullable: true
          minLength: 1
          maxLength: 139
          example: example
        category:
          type: string
          nullable: true
          enum:
            - AUTO
            - BEAUTY
            - APPAREL
            - EDU
            - ENTERTAIN
            - EVENT_PLAN
            - FINANCE
            - GROCERY
            - GOVT
            - HOTEL
            - HEALTH
            - NONPROFIT
            - PROF_SERVICES
            - RETAIL
            - TRAVEL
            - RESTAURANT
            - OTHER
            - UNDEFINED
          example: AUTO
        agentId:
          type: string
          nullable: true
          example: asst_123
    PublicChannelAssignInput:
      type: object
      properties:
        agentId:
          type: string
          nullable: true
          example: asst_123
      required:
        - agentId
  parameters: {}
paths:
  /public/v1/objects:
    get:
      summary: List objects
      operationId: listObjects
      description: Returns every object (standard + custom) for the authenticated account.
      security:
        - bearerAuth: []
      tags:
        - Objects
      responses:
        '200':
          description: Objects list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        display_name:
                          type: string
                          example: example
                        type:
                          type: string
                          enum:
                            - table
                            - object
                          example: table
                        custom:
                          type: boolean
                          example: false
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                        description:
                          type: string
                          example: example
                        emoji:
                          type: string
                          example: example
                        icon_color:
                          type: string
                          example: example
                        field_count:
                          type: number
                          example: 1
                      required:
                        - id
                        - name
                        - display_name
                        - type
                        - custom
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create object
      operationId: createObject
      description: >-
        Creates a custom object. At least one column is required. Requires a
        USER API key.
      security:
        - bearerAuth: []
      tags:
        - Objects
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                displayName:
                  type: string
                  minLength: 1
                  example: example
                emoji:
                  type: string
                  example: example
                icon_color:
                  type: string
                  example: example
                iconColor:
                  type: string
                  example: example
                description:
                  type: string
                  example: example
                columns:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        example: example
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - string
                              - number
                              - boolean
                              - date
                              - tags
                              - relation
                              - autoIncrement
                              - dateOnly
                              - prismaRelation
                              - kanbanViewOrder
                              - file
                              - avatar
                              - permissions
                              - formula
                            example: string
                          - type: string
                            enum:
                              - select
                            example: select
                      metadata:
                        type: object
                        additionalProperties: {}
                      record_type_id:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                      recordTypeId:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                    required:
                      - name
                      - type
                    additionalProperties: false
                  minItems: 1
              required:
                - name
                - displayName
                - columns
      responses:
        '201':
          description: Created object
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - table
                          - object
                        example: table
                      custom:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      description:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      field_count:
                        type: number
                        example: 1
                      fields:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            key:
                              type: string
                              example: example
                            type:
                              type: string
                              example: example
                            editable:
                              type: boolean
                              example: false
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            read_only:
                              type: boolean
                              example: false
                            required:
                              type: boolean
                              example: false
                            unique:
                              type: boolean
                              example: false
                            is_system:
                              type: boolean
                              example: false
                            is_predefined:
                              type: boolean
                              example: false
                            default_value:
                              nullable: true
                              type: object
                            format:
                              type: string
                              example: example
                            mode:
                              type: string
                              enum:
                                - singleSelect
                                - multiSelect
                                - single
                                - multi
                              example: singleSelect
                            timezone:
                              type: string
                              example: example
                            decimals:
                              type: number
                              example: 1
                            currency:
                              type: string
                              example: example
                            min:
                              type: number
                              nullable: true
                              example: 1
                            max:
                              type: number
                              nullable: true
                              example: 1
                            time_format:
                              type: string
                              example: example
                            show_preview:
                              type: boolean
                              example: false
                            allowed_file_types:
                              type: array
                              items:
                                type: string
                                example: example
                            max_file_size:
                              type: number
                              example: 1
                            related_table_id:
                              type: number
                              example: 1
                            related_record_type_ids:
                              type: array
                              nullable: true
                              items:
                                type: number
                                example: 1
                            display_field_id:
                              type: number
                              example: 1
                            relation_mode:
                              type: string
                              example: example
                            include_activity:
                              type: boolean
                              example: false
                            metadata:
                              type: object
                              additionalProperties: {}
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  color:
                                    type: string
                                    example: example
                                  order:
                                    type: number
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                required:
                                  - id
                                  - name
                                  - color
                                  - order
                                  - created_at
                                  - updated_at
                            expression:
                              nullable: true
                              type: object
                            output_type:
                              type: string
                              example: example
                            apply_if:
                              nullable: true
                              type: object
                            number_config:
                              nullable: true
                              type: object
                            date_config:
                              nullable: true
                              type: object
                            string_config:
                              nullable: true
                              type: object
                          required:
                            - id
                            - name
                            - key
                            - type
                            - editable
                            - created_at
                            - updated_at
                      views:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            type:
                              type: string
                              enum:
                                - TABLE
                                - KANBAN
                                - RECORD
                              example: TABLE
                            is_default:
                              type: boolean
                              example: false
                            is_private:
                              type: boolean
                              example: false
                            record_type_id:
                              type: number
                              nullable: true
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            column_order:
                              type: array
                              items:
                                type: string
                                example: example
                            hidden_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            sticky_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            grouping_field_id:
                              type: number
                              example: 1
                            column_ordering:
                              nullable: true
                              type: object
                            title_field_id:
                              type: number
                              example: 1
                            display_field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                          required:
                            - id
                            - name
                            - type
                            - is_default
                            - is_private
                            - record_type_id
                            - created_at
                            - updated_at
                      record_types:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            display_name:
                              type: string
                              example: example
                            is_default:
                              type: boolean
                              example: false
                            single_noun:
                              type: string
                              example: example
                            emoji:
                              type: string
                              example: example
                            icon_color:
                              type: string
                              example: example
                            disable_side_effects:
                              type: boolean
                              example: false
                            disable_relation_logging:
                              type: boolean
                              example: false
                            default_view_id:
                              type: number
                              example: 1
                            field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                            views:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  type:
                                    type: string
                                    enum:
                                      - TABLE
                                      - KANBAN
                                      - RECORD
                                    example: TABLE
                                  is_default:
                                    type: boolean
                                    example: false
                                  is_private:
                                    type: boolean
                                    example: false
                                  record_type_id:
                                    type: number
                                    nullable: true
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  column_order:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  hidden_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  sticky_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  grouping_field_id:
                                    type: number
                                    example: 1
                                  column_ordering:
                                    nullable: true
                                    type: object
                                  title_field_id:
                                    type: number
                                    example: 1
                                  display_field_ids:
                                    type: array
                                    items:
                                      type: number
                                      example: 1
                                required:
                                  - id
                                  - name
                                  - type
                                  - is_default
                                  - is_private
                                  - record_type_id
                                  - created_at
                                  - updated_at
                          required:
                            - id
                            - name
                            - display_name
                            - is_default
                    required:
                      - id
                      - name
                      - display_name
                      - type
                      - custom
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}:
    get:
      summary: Get object
      operationId: getObject
      description: Returns one object including fields, views, and record types.
      security:
        - bearerAuth: []
      tags:
        - Objects
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Object detail
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - table
                          - object
                        example: table
                      custom:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      description:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      field_count:
                        type: number
                        example: 1
                      fields:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            key:
                              type: string
                              example: example
                            type:
                              type: string
                              example: example
                            editable:
                              type: boolean
                              example: false
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            read_only:
                              type: boolean
                              example: false
                            required:
                              type: boolean
                              example: false
                            unique:
                              type: boolean
                              example: false
                            is_system:
                              type: boolean
                              example: false
                            is_predefined:
                              type: boolean
                              example: false
                            default_value:
                              nullable: true
                              type: object
                            format:
                              type: string
                              example: example
                            mode:
                              type: string
                              enum:
                                - singleSelect
                                - multiSelect
                                - single
                                - multi
                              example: singleSelect
                            timezone:
                              type: string
                              example: example
                            decimals:
                              type: number
                              example: 1
                            currency:
                              type: string
                              example: example
                            min:
                              type: number
                              nullable: true
                              example: 1
                            max:
                              type: number
                              nullable: true
                              example: 1
                            time_format:
                              type: string
                              example: example
                            show_preview:
                              type: boolean
                              example: false
                            allowed_file_types:
                              type: array
                              items:
                                type: string
                                example: example
                            max_file_size:
                              type: number
                              example: 1
                            related_table_id:
                              type: number
                              example: 1
                            related_record_type_ids:
                              type: array
                              nullable: true
                              items:
                                type: number
                                example: 1
                            display_field_id:
                              type: number
                              example: 1
                            relation_mode:
                              type: string
                              example: example
                            include_activity:
                              type: boolean
                              example: false
                            metadata:
                              type: object
                              additionalProperties: {}
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  color:
                                    type: string
                                    example: example
                                  order:
                                    type: number
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                required:
                                  - id
                                  - name
                                  - color
                                  - order
                                  - created_at
                                  - updated_at
                            expression:
                              nullable: true
                              type: object
                            output_type:
                              type: string
                              example: example
                            apply_if:
                              nullable: true
                              type: object
                            number_config:
                              nullable: true
                              type: object
                            date_config:
                              nullable: true
                              type: object
                            string_config:
                              nullable: true
                              type: object
                          required:
                            - id
                            - name
                            - key
                            - type
                            - editable
                            - created_at
                            - updated_at
                      views:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            type:
                              type: string
                              enum:
                                - TABLE
                                - KANBAN
                                - RECORD
                              example: TABLE
                            is_default:
                              type: boolean
                              example: false
                            is_private:
                              type: boolean
                              example: false
                            record_type_id:
                              type: number
                              nullable: true
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            column_order:
                              type: array
                              items:
                                type: string
                                example: example
                            hidden_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            sticky_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            grouping_field_id:
                              type: number
                              example: 1
                            column_ordering:
                              nullable: true
                              type: object
                            title_field_id:
                              type: number
                              example: 1
                            display_field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                          required:
                            - id
                            - name
                            - type
                            - is_default
                            - is_private
                            - record_type_id
                            - created_at
                            - updated_at
                      record_types:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            display_name:
                              type: string
                              example: example
                            is_default:
                              type: boolean
                              example: false
                            single_noun:
                              type: string
                              example: example
                            emoji:
                              type: string
                              example: example
                            icon_color:
                              type: string
                              example: example
                            disable_side_effects:
                              type: boolean
                              example: false
                            disable_relation_logging:
                              type: boolean
                              example: false
                            default_view_id:
                              type: number
                              example: 1
                            field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                            views:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  type:
                                    type: string
                                    enum:
                                      - TABLE
                                      - KANBAN
                                      - RECORD
                                    example: TABLE
                                  is_default:
                                    type: boolean
                                    example: false
                                  is_private:
                                    type: boolean
                                    example: false
                                  record_type_id:
                                    type: number
                                    nullable: true
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  column_order:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  hidden_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  sticky_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  grouping_field_id:
                                    type: number
                                    example: 1
                                  column_ordering:
                                    nullable: true
                                    type: object
                                  title_field_id:
                                    type: number
                                    example: 1
                                  display_field_ids:
                                    type: array
                                    items:
                                      type: number
                                      example: 1
                                required:
                                  - id
                                  - name
                                  - type
                                  - is_default
                                  - is_private
                                  - record_type_id
                                  - created_at
                                  - updated_at
                          required:
                            - id
                            - name
                            - display_name
                            - is_default
                    required:
                      - id
                      - name
                      - display_name
                      - type
                      - custom
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update object
      operationId: updateObject
      description: >-
        Updates an object's display name, emoji, color, or description. Requires
        a USER API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Objects
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                displayName:
                  type: string
                  minLength: 1
                  example: example
                emoji:
                  type: string
                  example: example
                icon_color:
                  type: string
                  example: example
                iconColor:
                  type: string
                  example: example
                description:
                  type: string
                  example: example
      responses:
        '200':
          description: Updated object
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - table
                          - object
                        example: table
                      custom:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      description:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      field_count:
                        type: number
                        example: 1
                    required:
                      - id
                      - name
                      - display_name
                      - type
                      - custom
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete object
      operationId: deleteObject
      description: >-
        Deletes a custom object. System objects cannot be deleted. Requires a
        USER API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Objects
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/schema:
    get:
      summary: Get object schema
      operationId: getObjectSchema
      description: Returns only the schema (fields, types, formats) for an object.
      security:
        - bearerAuth: []
      tags:
        - Objects
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Object schema
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/fields:
    get:
      summary: List object fields
      operationId: listObjectFields
      description: Returns the columns defined on an object.
      security:
        - bearerAuth: []
      tags:
        - Object fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Fields list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        key:
                          type: string
                          example: example
                        type:
                          type: string
                          example: example
                        editable:
                          type: boolean
                          example: false
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                        read_only:
                          type: boolean
                          example: false
                        required:
                          type: boolean
                          example: false
                        unique:
                          type: boolean
                          example: false
                        is_system:
                          type: boolean
                          example: false
                        is_predefined:
                          type: boolean
                          example: false
                        default_value:
                          nullable: true
                          type: object
                        format:
                          type: string
                          example: example
                        mode:
                          type: string
                          enum:
                            - singleSelect
                            - multiSelect
                            - single
                            - multi
                          example: singleSelect
                        timezone:
                          type: string
                          example: example
                        decimals:
                          type: number
                          example: 1
                        currency:
                          type: string
                          example: example
                        min:
                          type: number
                          nullable: true
                          example: 1
                        max:
                          type: number
                          nullable: true
                          example: 1
                        time_format:
                          type: string
                          example: example
                        show_preview:
                          type: boolean
                          example: false
                        allowed_file_types:
                          type: array
                          items:
                            type: string
                            example: example
                        max_file_size:
                          type: number
                          example: 1
                        related_table_id:
                          type: number
                          example: 1
                        related_record_type_ids:
                          type: array
                          nullable: true
                          items:
                            type: number
                            example: 1
                        display_field_id:
                          type: number
                          example: 1
                        relation_mode:
                          type: string
                          example: example
                        include_activity:
                          type: boolean
                          example: false
                        metadata:
                          type: object
                          additionalProperties: {}
                        options:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: number
                                example: 1
                              name:
                                type: string
                                example: example
                              color:
                                type: string
                                example: example
                              order:
                                type: number
                                example: 1
                              created_at:
                                type: string
                                nullable: true
                                example: example
                              updated_at:
                                type: string
                                nullable: true
                                example: example
                            required:
                              - id
                              - name
                              - color
                              - order
                              - created_at
                              - updated_at
                        expression:
                          nullable: true
                          type: object
                        output_type:
                          type: string
                          example: example
                        apply_if:
                          nullable: true
                          type: object
                        number_config:
                          nullable: true
                          type: object
                        date_config:
                          nullable: true
                          type: object
                        string_config:
                          nullable: true
                          type: object
                      required:
                        - id
                        - name
                        - key
                        - type
                        - editable
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create object field
      operationId: createObjectField
      description: >-
        Creates a column on an object. Requires a USER API key with ADMIN or
        OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                type:
                  anyOf:
                    - type: string
                      enum:
                        - string
                        - number
                        - boolean
                        - date
                        - tags
                        - relation
                        - autoIncrement
                        - dateOnly
                        - prismaRelation
                        - kanbanViewOrder
                        - file
                        - avatar
                        - permissions
                        - formula
                      example: string
                    - type: string
                      enum:
                        - select
                      example: select
                metadata:
                  type: object
                  additionalProperties: {}
                record_type_id:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                recordTypeId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
                - name
                - type
              additionalProperties: false
      responses:
        '201':
          description: Created field
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      key:
                        type: string
                        example: example
                      type:
                        type: string
                        example: example
                      editable:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      read_only:
                        type: boolean
                        example: false
                      required:
                        type: boolean
                        example: false
                      unique:
                        type: boolean
                        example: false
                      is_system:
                        type: boolean
                        example: false
                      is_predefined:
                        type: boolean
                        example: false
                      default_value:
                        nullable: true
                        type: object
                      format:
                        type: string
                        example: example
                      mode:
                        type: string
                        enum:
                          - singleSelect
                          - multiSelect
                          - single
                          - multi
                        example: singleSelect
                      timezone:
                        type: string
                        example: example
                      decimals:
                        type: number
                        example: 1
                      currency:
                        type: string
                        example: example
                      min:
                        type: number
                        nullable: true
                        example: 1
                      max:
                        type: number
                        nullable: true
                        example: 1
                      time_format:
                        type: string
                        example: example
                      show_preview:
                        type: boolean
                        example: false
                      allowed_file_types:
                        type: array
                        items:
                          type: string
                          example: example
                      max_file_size:
                        type: number
                        example: 1
                      related_table_id:
                        type: number
                        example: 1
                      related_record_type_ids:
                        type: array
                        nullable: true
                        items:
                          type: number
                          example: 1
                      display_field_id:
                        type: number
                        example: 1
                      relation_mode:
                        type: string
                        example: example
                      include_activity:
                        type: boolean
                        example: false
                      metadata:
                        type: object
                        additionalProperties: {}
                      options:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            color:
                              type: string
                              example: example
                            order:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          required:
                            - id
                            - name
                            - color
                            - order
                            - created_at
                            - updated_at
                      expression:
                        nullable: true
                        type: object
                      output_type:
                        type: string
                        example: example
                      apply_if:
                        nullable: true
                        type: object
                      number_config:
                        nullable: true
                        type: object
                      date_config:
                        nullable: true
                        type: object
                      string_config:
                        nullable: true
                        type: object
                    required:
                      - id
                      - name
                      - key
                      - type
                      - editable
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/fields/{fieldId}:
    patch:
      summary: Update object field
      operationId: updateObjectField
      description: >-
        Updates a field's metadata, defaults, or ordering. Requires a USER API
        key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                type:
                  anyOf:
                    - type: string
                      enum:
                        - string
                        - number
                        - boolean
                        - date
                        - tags
                        - relation
                        - autoIncrement
                        - dateOnly
                        - prismaRelation
                        - kanbanViewOrder
                        - file
                        - avatar
                        - permissions
                        - formula
                      example: string
                    - type: string
                      enum:
                        - select
                      example: select
                metadata:
                  type: object
                  additionalProperties: {}
                order:
                  type: integer
                  example: 1
                required:
                  type: boolean
                  example: false
                unique:
                  type: boolean
                  example: false
                tags:
                  type: array
                  items:
                    type: object
                    additionalProperties: {}
                defaultValue:
                  nullable: true
                  type: object
              additionalProperties: false
      responses:
        '200':
          description: Updated field
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      key:
                        type: string
                        example: example
                      type:
                        type: string
                        example: example
                      editable:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      read_only:
                        type: boolean
                        example: false
                      required:
                        type: boolean
                        example: false
                      unique:
                        type: boolean
                        example: false
                      is_system:
                        type: boolean
                        example: false
                      is_predefined:
                        type: boolean
                        example: false
                      default_value:
                        nullable: true
                        type: object
                      format:
                        type: string
                        example: example
                      mode:
                        type: string
                        enum:
                          - singleSelect
                          - multiSelect
                          - single
                          - multi
                        example: singleSelect
                      timezone:
                        type: string
                        example: example
                      decimals:
                        type: number
                        example: 1
                      currency:
                        type: string
                        example: example
                      min:
                        type: number
                        nullable: true
                        example: 1
                      max:
                        type: number
                        nullable: true
                        example: 1
                      time_format:
                        type: string
                        example: example
                      show_preview:
                        type: boolean
                        example: false
                      allowed_file_types:
                        type: array
                        items:
                          type: string
                          example: example
                      max_file_size:
                        type: number
                        example: 1
                      related_table_id:
                        type: number
                        example: 1
                      related_record_type_ids:
                        type: array
                        nullable: true
                        items:
                          type: number
                          example: 1
                      display_field_id:
                        type: number
                        example: 1
                      relation_mode:
                        type: string
                        example: example
                      include_activity:
                        type: boolean
                        example: false
                      metadata:
                        type: object
                        additionalProperties: {}
                      options:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            color:
                              type: string
                              example: example
                            order:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          required:
                            - id
                            - name
                            - color
                            - order
                            - created_at
                            - updated_at
                      expression:
                        nullable: true
                        type: object
                      output_type:
                        type: string
                        example: example
                      apply_if:
                        nullable: true
                        type: object
                      number_config:
                        nullable: true
                        type: object
                      date_config:
                        nullable: true
                        type: object
                      string_config:
                        nullable: true
                        type: object
                    required:
                      - id
                      - name
                      - key
                      - type
                      - editable
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete object field
      operationId: deleteObjectField
      description: >-
        Deletes a column from an object. Requires a USER API key with ADMIN or
        OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/fields/{fieldId}/formula-dependencies:
    get:
      summary: Get object field formula dependencies
      operationId: getObjectFieldFormulaDependencies
      description: >-
        Returns the formula dependencies for a specific field. Requires a USER
        API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      responses:
        '200':
          description: Formula dependencies
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: number
                        example: 1
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/fields/preview-formula:
    post:
      summary: Preview formula evaluation
      operationId: previewObjectFormula
      description: >-
        Previews formula evaluation on existing data. Requires a USER API key
        with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                formulaMetadata:
                  type: object
                  properties:
                    applyIf:
                      type: object
                      description: Query preconditions filter
                    expression:
                      type: object
                      description: >-
                        Formula expression AST. Maximum AST depth is 5
                        (root-to-leaf node count; root node is depth 1).
                previewFilter:
                  type: object
                  description: Filter for preview rows
                limit:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
                - formulaMetadata
      responses:
        '200':
          description: Formula preview evaluation results
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          type: object
                          properties:
                            rowId:
                              type: string
                              example: example
                            rowName:
                              type: string
                              example: example
                            previewState:
                              type: object
                              properties:
                                value:
                                  nullable: true
                                  type: object
                                isValid:
                                  type: boolean
                                  example: false
                                error:
                                  type: string
                                  nullable: true
                                  example: example
                              required:
                                - isValid
                                - error
                            row:
                              type: object
                              additionalProperties: {}
                          required:
                            - rowId
                            - rowName
                            - previewState
                            - row
                      inferredOutputType:
                        type: string
                        example: example
                    required:
                      - results
                      - inferredOutputType
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/fields/{fieldId}/options:
    get:
      summary: List field options
      operationId: listObjectFieldOptions
      description: Returns the options (tags) defined on a select/tags field.
      security:
        - bearerAuth: []
      tags:
        - Object options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      responses:
        '200':
          description: Options list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        color:
                          type: string
                          example: example
                        order:
                          type: number
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - name
                        - color
                        - order
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create field option
      operationId: createObjectFieldOption
      description: >-
        Adds an option (tag) to a select/tags field. Requires a USER API key
        with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                color:
                  type: string
                  example: example
                order:
                  type: number
                  example: 1
              required:
                - name
      responses:
        '201':
          description: Created option
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      color:
                        type: string
                        example: example
                      order:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - name
                      - color
                      - order
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/options/{tagId}:
    patch:
      summary: Update field option
      operationId: updateObjectFieldOption
      description: >-
        Updates an option's name, color, or order. Requires a USER API key with
        ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 7
          required: true
          name: tagId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                color:
                  type: string
                  example: example
                order:
                  type: number
                  example: 1
      responses:
        '200':
          description: Updated option
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      color:
                        type: string
                        example: example
                      order:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - name
                      - color
                      - order
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete field option
      operationId: deleteObjectFieldOption
      description: >-
        Deletes an option from a select/tags field. Requires a USER API key with
        ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 7
          required: true
          name: tagId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/record-types:
    get:
      summary: List record types
      operationId: listObjectRecordTypes
      description: Returns the record types defined on an object.
      security:
        - bearerAuth: []
      tags:
        - Object record types
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Record types
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        display_name:
                          type: string
                          example: example
                        is_default:
                          type: boolean
                          example: false
                        single_noun:
                          type: string
                          example: example
                        emoji:
                          type: string
                          example: example
                        icon_color:
                          type: string
                          example: example
                        disable_side_effects:
                          type: boolean
                          example: false
                        disable_relation_logging:
                          type: boolean
                          example: false
                        default_view_id:
                          type: number
                          example: 1
                        field_ids:
                          type: array
                          items:
                            type: number
                            example: 1
                        views:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: number
                                example: 1
                              name:
                                type: string
                                example: example
                              type:
                                type: string
                                enum:
                                  - TABLE
                                  - KANBAN
                                  - RECORD
                                example: TABLE
                              is_default:
                                type: boolean
                                example: false
                              is_private:
                                type: boolean
                                example: false
                              record_type_id:
                                type: number
                                nullable: true
                                example: 1
                              created_at:
                                type: string
                                nullable: true
                                example: example
                              updated_at:
                                type: string
                                nullable: true
                                example: example
                              column_order:
                                type: array
                                items:
                                  type: string
                                  example: example
                              hidden_columns:
                                type: array
                                items:
                                  type: string
                                  example: example
                              sticky_columns:
                                type: array
                                items:
                                  type: string
                                  example: example
                              grouping_field_id:
                                type: number
                                example: 1
                              column_ordering:
                                nullable: true
                                type: object
                              title_field_id:
                                type: number
                                example: 1
                              display_field_ids:
                                type: array
                                items:
                                  type: number
                                  example: 1
                            required:
                              - id
                              - name
                              - type
                              - is_default
                              - is_private
                              - record_type_id
                              - created_at
                              - updated_at
                      required:
                        - id
                        - name
                        - display_name
                        - is_default
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create record type
      operationId: createObjectRecordType
      description: >-
        Creates a record type on an object. Record types are an object-only
        feature; tables always keep the single implicit record type they are
        created with. Requires a USER API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object record types
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                displayName:
                  type: string
                  minLength: 1
                  example: example
                display_name:
                  type: string
                  minLength: 1
                  example: example
                singularNoun:
                  type: string
                  example: example
                singleNoun:
                  type: string
                  example: example
                singular_noun:
                  type: string
                  example: example
                emoji:
                  type: string
                  example: example
                icon_color:
                  type: string
                  example: example
                iconColor:
                  type: string
                  example: example
                fieldNames:
                  type: array
                  items:
                    type: string
                    example: example
                columnIds:
                  type: array
                  items:
                    type: number
                    example: 1
                fieldIds:
                  type: array
                  items:
                    type: number
                    example: 1
                field_ids:
                  type: array
                  items:
                    type: number
                    example: 1
                disableSideEffects:
                  type: boolean
                  example: false
                disableRelationLogging:
                  type: boolean
                  example: false
                disable_relation_logging:
                  type: boolean
                  example: false
              required:
                - name
      responses:
        '201':
          description: Created record type
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      is_default:
                        type: boolean
                        example: false
                      single_noun:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      disable_side_effects:
                        type: boolean
                        example: false
                      disable_relation_logging:
                        type: boolean
                        example: false
                      default_view_id:
                        type: number
                        example: 1
                      field_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      views:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            type:
                              type: string
                              enum:
                                - TABLE
                                - KANBAN
                                - RECORD
                              example: TABLE
                            is_default:
                              type: boolean
                              example: false
                            is_private:
                              type: boolean
                              example: false
                            record_type_id:
                              type: number
                              nullable: true
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            column_order:
                              type: array
                              items:
                                type: string
                                example: example
                            hidden_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            sticky_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            grouping_field_id:
                              type: number
                              example: 1
                            column_ordering:
                              nullable: true
                              type: object
                            title_field_id:
                              type: number
                              example: 1
                            display_field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                          required:
                            - id
                            - name
                            - type
                            - is_default
                            - is_private
                            - record_type_id
                            - created_at
                            - updated_at
                    required:
                      - id
                      - name
                      - display_name
                      - is_default
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/record-types/{recordTypeId}:
    patch:
      summary: Update record type
      operationId: updateObjectRecordType
      description: >-
        Updates a record type. The default record type's name and display name
        cannot be changed (promote another record type to default first).
        Requires a USER API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object record types
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                displayName:
                  type: string
                  minLength: 1
                  example: example
                display_name:
                  type: string
                  minLength: 1
                  example: example
                singularNoun:
                  type: string
                  example: example
                singleNoun:
                  type: string
                  example: example
                singular_noun:
                  type: string
                  example: example
                emoji:
                  type: string
                  example: example
                icon_color:
                  type: string
                  example: example
                iconColor:
                  type: string
                  example: example
                fieldNames:
                  type: array
                  items:
                    type: string
                    example: example
                columnIds:
                  type: array
                  items:
                    type: number
                    example: 1
                fieldIds:
                  type: array
                  items:
                    type: number
                    example: 1
                field_ids:
                  type: array
                  items:
                    type: number
                    example: 1
                disableSideEffects:
                  type: boolean
                  example: false
                disableRelationLogging:
                  type: boolean
                  example: false
                disable_relation_logging:
                  type: boolean
                  example: false
                defaultViewId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                default_view_id:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
      responses:
        '200':
          description: Updated record type
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      is_default:
                        type: boolean
                        example: false
                      single_noun:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      disable_side_effects:
                        type: boolean
                        example: false
                      disable_relation_logging:
                        type: boolean
                        example: false
                      default_view_id:
                        type: number
                        example: 1
                      field_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      views:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            type:
                              type: string
                              enum:
                                - TABLE
                                - KANBAN
                                - RECORD
                              example: TABLE
                            is_default:
                              type: boolean
                              example: false
                            is_private:
                              type: boolean
                              example: false
                            record_type_id:
                              type: number
                              nullable: true
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            column_order:
                              type: array
                              items:
                                type: string
                                example: example
                            hidden_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            sticky_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            grouping_field_id:
                              type: number
                              example: 1
                            column_ordering:
                              nullable: true
                              type: object
                            title_field_id:
                              type: number
                              example: 1
                            display_field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                          required:
                            - id
                            - name
                            - type
                            - is_default
                            - is_private
                            - record_type_id
                            - created_at
                            - updated_at
                    required:
                      - id
                      - name
                      - display_name
                      - is_default
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete record type
      operationId: deleteObjectRecordType
      description: >-
        Deletes a record type. The default record type cannot be deleted.
        Requires a USER API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object record types
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/record-types/{recordTypeId}/security:
    get:
      summary: Get record type security
      operationId: getObjectRecordTypeSecurity
      description: >-
        Returns the record-level security (RLS) configuration for a record type,
        including the workspace default for new records. If no config has been
        saved yet, returns in-memory defaults (enabled: false, auto-detected
        Users column if present). Requires a USER API key with ADMIN or OWNER
        role.
      security:
        - bearerAuth: []
      tags:
        - Object record types
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
      responses:
        '200':
          description: Record type security config
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                        example: false
                      virtual_owner_column_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      virtual_owner_columns:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            key:
                              type: string
                              example: example
                          required:
                            - id
                            - name
                            - key
                      workspace:
                        type: string
                        enum:
                          - FULL_ACCESS
                          - READ_ONLY
                          - NO_ACCESS
                        example: FULL_ACCESS
                    required:
                      - enabled
                      - virtual_owner_column_ids
                      - workspace
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update record type security
      operationId: updateObjectRecordTypeSecurity
      description: >-
        Updates record-level security (RLS) for a record type.
        virtual_owner_column_ids must reference User-relation fields assigned to
        the record type. workspace sets the default access for new records
        (FULL_ACCESS, READ_ONLY, NO_ACCESS). Unknown body keys return 400.
        Requires a USER API key with ADMIN or OWNER role.
      security:
        - bearerAuth: []
      tags:
        - Object record types
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  example: false
                virtualOwnerColumnIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                virtual_owner_column_ids:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                workspace:
                  type: string
                  enum:
                    - FULL_ACCESS
                    - READ_ONLY
                    - NO_ACCESS
                  example: FULL_ACCESS
                default_workspace_record_permission:
                  type: string
                  enum:
                    - FULL_ACCESS
                    - READ_ONLY
                    - NO_ACCESS
                  example: FULL_ACCESS
                defaultWorkspaceRecordPermission:
                  type: string
                  enum:
                    - FULL_ACCESS
                    - READ_ONLY
                    - NO_ACCESS
                  example: FULL_ACCESS
              additionalProperties: false
      responses:
        '200':
          description: Updated record type security config
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                        example: false
                      virtual_owner_column_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      virtual_owner_columns:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            key:
                              type: string
                              example: example
                          required:
                            - id
                            - name
                            - key
                      workspace:
                        type: string
                        enum:
                          - FULL_ACCESS
                          - READ_ONLY
                          - NO_ACCESS
                        example: FULL_ACCESS
                    required:
                      - enabled
                      - virtual_owner_column_ids
                      - workspace
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views:
    get:
      summary: List views
      operationId: listObjectViews
      description: >-
        Returns the saved views configured on an object. Optionally filter by
        record_type_id and shared (shared=true returns only shared/system
        views).
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          required: false
          name: record_type_id
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          required: false
          name: recordTypeId
          in: query
        - schema:
            anyOf:
              - type: boolean
                enum:
                  - true
                example: true
              - type: boolean
                enum:
                  - false
                example: false
              - type: string
                enum:
                  - 'true'
                example: 'true'
              - type: string
                enum:
                  - 'false'
                example: 'false'
          required: false
          name: shared
          in: query
      responses:
        '200':
          description: Views list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        type:
                          type: string
                          enum:
                            - TABLE
                            - KANBAN
                            - RECORD
                          example: TABLE
                        is_default:
                          type: boolean
                          example: false
                        is_private:
                          type: boolean
                          example: false
                        record_type_id:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                        column_order:
                          type: array
                          items:
                            type: string
                            example: example
                        hidden_columns:
                          type: array
                          items:
                            type: string
                            example: example
                        sticky_columns:
                          type: array
                          items:
                            type: string
                            example: example
                        grouping_field_id:
                          type: number
                          example: 1
                        column_ordering:
                          nullable: true
                          type: object
                        title_field_id:
                          type: number
                          example: 1
                        display_field_ids:
                          type: array
                          items:
                            type: number
                            example: 1
                      required:
                        - id
                        - name
                        - type
                        - is_default
                        - is_private
                        - record_type_id
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create view
      operationId: createObjectView
      description: Creates a saved view on an object. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                type:
                  type: string
                  enum:
                    - TABLE
                    - KANBAN
                    - RECORD
                  example: TABLE
                metadata:
                  type: object
                  properties:
                    grouping_field_id:
                      type: number
                      example: 1
                    groupingColumnId:
                      type: number
                      example: 1
                    column_order:
                      type: array
                      items:
                        type: string
                        example: example
                    columnOrder:
                      type: array
                      items:
                        type: string
                        example: example
                    hidden_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    hiddenColumns:
                      type: array
                      items:
                        type: string
                        example: example
                    dialog_field_order:
                      type: array
                      items:
                        type: string
                        example: example
                    dialogFieldOrder:
                      type: array
                      items:
                        type: string
                        example: example
                    sticky_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    stickyColumns:
                      type: array
                      items:
                        type: string
                        example: example
                    kanban_lane_size:
                      type: string
                      enum:
                        - THIN
                        - MEDIUM
                        - WIDE
                      example: THIN
                    kanbanLaneSize:
                      type: string
                      enum:
                        - THIN
                        - MEDIUM
                        - WIDE
                      example: THIN
                  additionalProperties: {}
              required:
                - name
                - type
      responses:
        '201':
          description: Created view
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - TABLE
                          - KANBAN
                          - RECORD
                        example: TABLE
                      is_default:
                        type: boolean
                        example: false
                      is_private:
                        type: boolean
                        example: false
                      record_type_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      column_order:
                        type: array
                        items:
                          type: string
                          example: example
                      hidden_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      sticky_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      grouping_field_id:
                        type: number
                        example: 1
                      column_ordering:
                        nullable: true
                        type: object
                      title_field_id:
                        type: number
                        example: 1
                      display_field_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                    required:
                      - id
                      - name
                      - type
                      - is_default
                      - is_private
                      - record_type_id
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/record-types/{recordTypeId}/views:
    post:
      summary: Create record-type-scoped view
      operationId: createObjectRecordTypeView
      description: Creates a saved view scoped to a record type. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                type:
                  type: string
                  enum:
                    - TABLE
                    - KANBAN
                    - RECORD
                  example: TABLE
                metadata:
                  type: object
                  properties:
                    grouping_field_id:
                      type: number
                      example: 1
                    groupingColumnId:
                      type: number
                      example: 1
                    column_order:
                      type: array
                      items:
                        type: string
                        example: example
                    columnOrder:
                      type: array
                      items:
                        type: string
                        example: example
                    hidden_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    hiddenColumns:
                      type: array
                      items:
                        type: string
                        example: example
                    dialog_field_order:
                      type: array
                      items:
                        type: string
                        example: example
                    dialogFieldOrder:
                      type: array
                      items:
                        type: string
                        example: example
                    sticky_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    stickyColumns:
                      type: array
                      items:
                        type: string
                        example: example
                    kanban_lane_size:
                      type: string
                      enum:
                        - THIN
                        - MEDIUM
                        - WIDE
                      example: THIN
                    kanbanLaneSize:
                      type: string
                      enum:
                        - THIN
                        - MEDIUM
                        - WIDE
                      example: THIN
                  additionalProperties: {}
              required:
                - name
                - type
      responses:
        '201':
          description: Created view
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - TABLE
                          - KANBAN
                          - RECORD
                        example: TABLE
                      is_default:
                        type: boolean
                        example: false
                      is_private:
                        type: boolean
                        example: false
                      record_type_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      column_order:
                        type: array
                        items:
                          type: string
                          example: example
                      hidden_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      sticky_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      grouping_field_id:
                        type: number
                        example: 1
                      column_ordering:
                        nullable: true
                        type: object
                      title_field_id:
                        type: number
                        example: 1
                      display_field_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                    required:
                      - id
                      - name
                      - type
                      - is_default
                      - is_private
                      - record_type_id
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views/{viewId}:
    patch:
      summary: Update view
      operationId: updateObjectView
      description: Updates a saved view. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                metadata:
                  type: object
                  properties:
                    column_order:
                      type: array
                      items:
                        type: string
                        example: example
                    hidden_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    dialog_field_order:
                      type: array
                      items:
                        type: string
                        example: example
                    sticky_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    kanban_lane_size:
                      type: string
                      enum:
                        - THIN
                        - MEDIUM
                        - WIDE
                      example: THIN
                    column_ordering:
                      type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
      responses:
        '200':
          description: Updated view
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - TABLE
                          - KANBAN
                          - RECORD
                        example: TABLE
                      is_default:
                        type: boolean
                        example: false
                      is_private:
                        type: boolean
                        example: false
                      record_type_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      column_order:
                        type: array
                        items:
                          type: string
                          example: example
                      hidden_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      sticky_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      grouping_field_id:
                        type: number
                        example: 1
                      column_ordering:
                        nullable: true
                        type: object
                      title_field_id:
                        type: number
                        example: 1
                      display_field_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                    required:
                      - id
                      - name
                      - type
                      - is_default
                      - is_private
                      - record_type_id
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete view
      operationId: deleteObjectView
      description: Deletes a saved view. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/record-types/{recordTypeId}/views/{viewId}:
    patch:
      summary: Update record-type-scoped view
      operationId: updateObjectRecordTypeView
      description: >-
        Updates a saved view that is scoped to a record type. Requires a USER
        API key.
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                metadata:
                  type: object
                  properties:
                    column_order:
                      type: array
                      items:
                        type: string
                        example: example
                    hidden_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    dialog_field_order:
                      type: array
                      items:
                        type: string
                        example: example
                    sticky_columns:
                      type: array
                      items:
                        type: string
                        example: example
                    kanban_lane_size:
                      type: string
                      enum:
                        - THIN
                        - MEDIUM
                        - WIDE
                      example: THIN
                    column_ordering:
                      type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
      responses:
        '200':
          description: Updated view
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - TABLE
                          - KANBAN
                          - RECORD
                        example: TABLE
                      is_default:
                        type: boolean
                        example: false
                      is_private:
                        type: boolean
                        example: false
                      record_type_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      column_order:
                        type: array
                        items:
                          type: string
                          example: example
                      hidden_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      sticky_columns:
                        type: array
                        items:
                          type: string
                          example: example
                      grouping_field_id:
                        type: number
                        example: 1
                      column_ordering:
                        nullable: true
                        type: object
                      title_field_id:
                        type: number
                        example: 1
                      display_field_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                    required:
                      - id
                      - name
                      - type
                      - is_default
                      - is_private
                      - record_type_id
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete record-type-scoped view
      operationId: deleteObjectRecordTypeView
      description: Deletes a record-type-scoped view. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object views
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 3
          required: true
          name: recordTypeId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{id}/relations/{relation}:
    get:
      summary: List related rows
      operationId: listObjectRelations
      description: Returns rows linked to this row via the given relation field.
      security:
        - bearerAuth: []
      tags:
        - Object relations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            description: Row id (Mongo ObjectId)
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            example: companies
          required: true
          name: relation
          in: path
      responses:
        '200':
          description: Related rows
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        auto_id:
                          type: number
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/relations/{relation}/target/{targetId}:
    get:
      summary: Find rows by relation target
      operationId: findObjectByRelation
      description: >-
        Returns rows on the source object linked to the target id via the
        relation.
      security:
        - bearerAuth: []
      tags:
        - Object relations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            minLength: 1
            example: companies
          required: true
          name: relation
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: targetId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            default: 1
            example: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 200
            default: 50
            example: 1
          required: false
          name: page_size
          in: query
        - schema:
            type: string
            example: example
          required: false
          name: search
          in: query
      responses:
        '200':
          description: Rows page
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      rows:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              example: example
                            auto_id:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          additionalProperties: {}
                      total_count:
                        type: number
                        example: 1
                      total_pages:
                        type: number
                        example: 1
                      current_page:
                        type: number
                        example: 1
                    required:
                      - rows
                      - total_count
                      - total_pages
                      - current_page
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{id}/relations/{relation}/link:
    post:
      summary: Link relation
      operationId: linkObjectRelation
      description: >-
        Links the target row to this row via the relation. Requires a USER API
        key.
      security:
        - bearerAuth: []
      tags:
        - Object relations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            description: Row id (Mongo ObjectId)
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            example: companies
          required: true
          name: relation
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                target_id:
                  type: string
                  pattern: '[a-fA-F0-9]{24}'
                  example: 65cf9b3a4b7c2a0012a3b4c5
              required:
                - target_id
      responses:
        '200':
          description: Updated row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{id}/relations/{relation}/unlink:
    post:
      summary: Unlink relation
      operationId: unlinkObjectRelation
      description: >-
        Unlinks the target row from this row's relation. Requires a USER API
        key.
      security:
        - bearerAuth: []
      tags:
        - Object relations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            description: Row id (Mongo ObjectId)
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            example: companies
          required: true
          name: relation
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                target_id:
                  type: string
                  pattern: '[a-fA-F0-9]{24}'
                  example: 65cf9b3a4b7c2a0012a3b4c5
              required:
                - target_id
      responses:
        '200':
          description: Updated row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/list:
    post:
      summary: List rows
      operationId: listObjectRows
      description: Returns a paginated, filterable list of rows.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                search:
                  type: string
                  nullable: true
                  example: example
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    additionalProperties: {}
                record_type:
                  anyOf:
                    - type: string
                      example: example
                    - type: number
                      example: 1
                    - type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    - nullable: true
                      type: object
                page:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  default: 1
                  example: 1
                page_size:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 200
                  default: 50
                  example: 1
      responses:
        '200':
          description: Rows page
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      rows:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              example: example
                            auto_id:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          additionalProperties: {}
                      total_count:
                        type: number
                        example: 1
                      total_pages:
                        type: number
                        example: 1
                      current_page:
                        type: number
                        example: 1
                    required:
                      - rows
                      - total_count
                      - total_pages
                      - current_page
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows:
    post:
      summary: Create row
      operationId: createObjectRow
      description: Creates a single row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  additionalProperties: {}
              additionalProperties: {}
      responses:
        '201':
          description: Created row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/bulk:
    post:
      summary: Bulk-create rows
      operationId: createObjectRowsBulk
      description: Creates multiple rows in a single call. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rows:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        additionalProperties: {}
                    additionalProperties: {}
                  minItems: 1
              required:
                - rows
      responses:
        '201':
          description: Created rows
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        auto_id:
                          type: number
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{id}:
    get:
      summary: Get row
      operationId: getObjectRow
      description: Returns a single row by id.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            description: Row id (Mongo ObjectId)
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update row
      operationId: updateObjectRow
      description: >-
        Updates a row's fields. Pass field values flat in the body or nested
        under `data`. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            description: Row id (Mongo ObjectId)
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  additionalProperties: {}
              additionalProperties: {}
      responses:
        '200':
          description: Updated row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete row
      operationId: deleteObjectRow
      description: Deletes a row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            description: Row id (Mongo ObjectId)
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/count:
    post:
      summary: Count rows
      operationId: countObjectRows
      description: >-
        Returns the number of rows matching the optional query and record type
        filter.
      security:
        - bearerAuth: []
      tags:
        - Object rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                recordType:
                  anyOf:
                    - type: string
                      example: example
                    - type: number
                      example: 1
                    - type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    - nullable: true
                      type: object
      responses:
        '200':
          description: Count
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      count:
                        type: number
                        example: 1
                    required:
                      - count
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views/{viewId}/aggregations:
    get:
      summary: List aggregations
      operationId: listObjectAggregations
      description: Returns aggregations configured for a view.
      security:
        - bearerAuth: []
      tags:
        - Object aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      responses:
        '200':
          description: Aggregations
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        view_id:
                          type: number
                          example: 1
                        column_id:
                          type: number
                          example: 1
                        operation:
                          type: string
                          example: example
                        tag_id:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - view_id
                        - column_id
                        - operation
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create aggregation
      operationId: createObjectAggregation
      description: >-
        Creates an aggregation on a column for the given view. Requires a USER
        API key.
      security:
        - bearerAuth: []
      tags:
        - Object aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                columnId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                operation:
                  type: string
                  enum:
                    - COUNT_EMPTY
                    - COUNT_FILLED
                    - PERCENT_EMPTY
                    - PERCENT_FILLED
                    - SUM
                    - AVERAGE
                    - MIN
                    - MAX
                    - COUNT_TRUE
                    - COUNT_FALSE
                    - PERCENT_TRUE
                    - PERCENT_FALSE
                  example: COUNT_EMPTY
                tagId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
                - columnId
                - operation
      responses:
        '201':
          description: Created aggregation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      view_id:
                        type: number
                        example: 1
                      column_id:
                        type: number
                        example: 1
                      operation:
                        type: string
                        example: example
                      tag_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - view_id
                      - column_id
                      - operation
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views/{viewId}/aggregations/{aggId}:
    patch:
      summary: Update aggregation
      operationId: updateObjectAggregation
      description: Changes the operation of an aggregation. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 5
          required: true
          name: aggId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                operation:
                  type: string
                  enum:
                    - COUNT_EMPTY
                    - COUNT_FILLED
                    - PERCENT_EMPTY
                    - PERCENT_FILLED
                    - SUM
                    - AVERAGE
                    - MIN
                    - MAX
                    - COUNT_TRUE
                    - COUNT_FALSE
                    - PERCENT_TRUE
                    - PERCENT_FALSE
                  example: COUNT_EMPTY
              required:
                - operation
      responses:
        '200':
          description: Updated aggregation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      view_id:
                        type: number
                        example: 1
                      column_id:
                        type: number
                        example: 1
                      operation:
                        type: string
                        example: example
                      tag_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - view_id
                      - column_id
                      - operation
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete aggregation
      operationId: deleteObjectAggregation
      description: Removes an aggregation from a view. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 5
          required: true
          name: aggId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/views/{viewId}/aggregations/compute:
    post:
      summary: Compute aggregations
      operationId: computeObjectAggregations
      description: Computes the configured aggregations for the rows matching the query.
      security:
        - bearerAuth: []
      tags:
        - Object aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Query + search + sort + filters for the aggregation compute
                    call.
                search:
                  type: string
                  nullable: true
                  example: example
                recordType:
                  anyOf:
                    - type: string
                      example: example
                    - type: number
                      example: 1
                    - type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    - nullable: true
                      type: object
                columnId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
      responses:
        '200':
          description: Aggregation results
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{rowId}/activities:
    get:
      summary: List activities
      operationId: listObjectActivities
      description: >-
        Returns manually-created activities attached to a row. Activities log
        interactions like notes, calls, meetings, and emails.
      security:
        - bearerAuth: []
      tags:
        - Object activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      responses:
        '200':
          description: Activities
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        type:
                          type: string
                          enum:
                            - NOTE
                            - EMAIL
                            - PHONE_CALL
                            - MEETING
                            - WHATSAPP
                          description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                          example: NOTE
                        content:
                          type: string
                          example: example
                        activity_date:
                          type: string
                          nullable: true
                          example: example
                        additional_data:
                          type: object
                          nullable: true
                          additionalProperties: {}
                        related_table_id:
                          type: number
                          nullable: true
                          example: 1
                        related_row_id:
                          type: string
                          nullable: true
                          example: example
                        users:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: number
                                example: 1
                              email:
                                type: string
                                example: example
                            required:
                              - id
                              - email
                        created_by:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - type
                        - content
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create activity
      operationId: createObjectActivity
      description: >-
        Attaches a manual activity to a row. Use `type` to categorize it (NOTE,
        PHONE_CALL, MEETING, EMAIL, WHATSAPP). Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                type:
                  type: string
                  enum:
                    - NOTE
                    - EMAIL
                    - PHONE_CALL
                    - MEETING
                    - WHATSAPP
                  default: NOTE
                  example: NOTE
                activityDate:
                  type: string
                  nullable: true
                  example: example
                additionalData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                userIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                relatedTableId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                relatedRowId:
                  type: string
                  example: example
              required:
                - content
      responses:
        '201':
          description: Created activity
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - NOTE
                          - EMAIL
                          - PHONE_CALL
                          - MEETING
                          - WHATSAPP
                        description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                        example: NOTE
                      content:
                        type: string
                        example: example
                      activity_date:
                        type: string
                        nullable: true
                        example: example
                      additional_data:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      related_table_id:
                        type: number
                        nullable: true
                        example: 1
                      related_row_id:
                        type: string
                        nullable: true
                        example: example
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            email:
                              type: string
                              example: example
                          required:
                            - id
                            - email
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - type
                      - content
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/activities/{id}:
    get:
      summary: Get activity
      operationId: getObjectActivity
      description: Returns an activity by id.
      security:
        - bearerAuth: []
      tags:
        - Object activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Activity
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - NOTE
                          - EMAIL
                          - PHONE_CALL
                          - MEETING
                          - WHATSAPP
                        description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                        example: NOTE
                      content:
                        type: string
                        example: example
                      activity_date:
                        type: string
                        nullable: true
                        example: example
                      additional_data:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      related_table_id:
                        type: number
                        nullable: true
                        example: 1
                      related_row_id:
                        type: string
                        nullable: true
                        example: example
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            email:
                              type: string
                              example: example
                          required:
                            - id
                            - email
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - type
                      - content
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update activity
      operationId: updateObjectActivity
      description: Updates an activity. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                activityDate:
                  type: string
                  nullable: true
                  example: example
                additionalData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                userIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                relatedTableId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                relatedRowId:
                  type: string
                  nullable: true
                  example: example
      responses:
        '200':
          description: Updated activity
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - NOTE
                          - EMAIL
                          - PHONE_CALL
                          - MEETING
                          - WHATSAPP
                        description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                        example: NOTE
                      content:
                        type: string
                        example: example
                      activity_date:
                        type: string
                        nullable: true
                        example: example
                      additional_data:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      related_table_id:
                        type: number
                        nullable: true
                        example: 1
                      related_row_id:
                        type: string
                        nullable: true
                        example: example
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            email:
                              type: string
                              example: example
                          required:
                            - id
                            - email
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - type
                      - content
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete activity
      operationId: deleteObjectActivity
      description: >-
        Deletes a manually-created activity. Only the owner or an account admin
        can delete. Auto-generated activities (email sync, conversation audit,
        etc.) cannot be deleted. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{rowId}/tasks:
    get:
      summary: List tasks
      operationId: listObjectTasks
      description: Returns tasks attached to a row.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      responses:
        '200':
          description: Tasks
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        content:
                          type: string
                          example: example
                        due_date:
                          type: string
                          nullable: true
                          example: example
                        assignee_ids:
                          type: array
                          items:
                            type: number
                            example: 1
                        completed:
                          type: boolean
                          example: false
                        completed_at:
                          type: string
                          nullable: true
                          example: example
                        created_by:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - content
                        - completed
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create task
      operationId: createObjectTask
      description: Attaches a task to a row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                dueDate:
                  type: string
                  nullable: true
                  example: example
                assigneeIds:
                  type: array
                  items:
                    type: number
                    example: 1
              required:
                - content
      responses:
        '201':
          description: Created task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/tasks/{id}:
    get:
      summary: Get task
      operationId: getObjectTask
      description: Returns a task by id.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update task
      operationId: updateObjectTask
      description: >-
        Updates a task's content, due date, or assignees. Requires a USER API
        key.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                dueDate:
                  type: string
                  nullable: true
                  example: example
                assigneeIds:
                  type: array
                  items:
                    type: number
                    example: 1
      responses:
        '200':
          description: Updated task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete task
      operationId: deleteObjectTask
      description: Deletes a task. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/tasks/{id}/complete:
    post:
      summary: Complete task
      operationId: completeObjectTask
      description: Marks a task as completed. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Completed task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/tasks/{id}/uncomplete:
    post:
      summary: Uncomplete task
      operationId: uncompleteObjectTask
      description: >-
        Marks a previously completed task as open again. Requires a USER API
        key.
      security:
        - bearerAuth: []
      tags:
        - Object tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Uncompleted task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/rows/{rowId}/files:
    get:
      summary: List files
      operationId: listObjectFiles
      description: Returns the files attached to a row.
      security:
        - bearerAuth: []
      tags:
        - Object files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      responses:
        '200':
          description: Files
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        filename:
                          type: string
                          example: example
                        mime_type:
                          type: string
                          example: example
                        size_bytes:
                          type: number
                          example: 1
                        url:
                          type: string
                          example: example
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - filename
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Upload files
      operationId: uploadObjectFiles
      description: >-
        Uploads one or more files to a row as multipart/form-data under the
        `files` field. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    nullable: true
                    type: object
                  description: Binary file uploads. Send as multipart form-data.
              required:
                - files
      responses:
        '201':
          description: Uploaded files
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        filename:
                          type: string
                          example: example
                        mime_type:
                          type: string
                          example: example
                        size_bytes:
                          type: number
                          example: 1
                        url:
                          type: string
                          example: example
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - filename
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/files/{id}:
    get:
      summary: Get file
      operationId: getObjectFile
      description: Returns file metadata.
      security:
        - bearerAuth: []
      tags:
        - Object files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: File
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      filename:
                        type: string
                        example: example
                      mime_type:
                        type: string
                        example: example
                      size_bytes:
                        type: number
                        example: 1
                      url:
                        type: string
                        example: example
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - filename
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete file
      operationId: deleteObjectFile
      description: Deletes a file from a row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Object files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/files/{id}/download:
    get:
      summary: Download file
      operationId: downloadObjectFile
      description: Streams the file content. Returns the file binary; not a JSON envelope.
      security:
        - bearerAuth: []
      tags:
        - Object files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: File binary
          content:
            application/octet-stream:
              schema:
                nullable: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/export/xlsx:
    post:
      summary: Export as XLSX
      operationId: exportObjectXlsx
      description: Exports rows matching the query as an XLSX file.
      security:
        - bearerAuth: []
      tags:
        - Object export
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                search:
                  type: string
                  nullable: true
                  example: example
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    additionalProperties: {}
      responses:
        '200':
          description: XLSX binary
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                nullable: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/objects/{name}/export/csv:
    post:
      summary: Export as CSV
      operationId: exportObjectCsv
      description: Exports rows matching the query as CSV.
      security:
        - bearerAuth: []
      tags:
        - Object export
      parameters:
        - schema:
            type: string
            minLength: 1
            example: deals
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                search:
                  type: string
                  nullable: true
                  example: example
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    additionalProperties: {}
      responses:
        '200':
          description: CSV body
          content:
            text/csv:
              schema:
                nullable: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables:
    get:
      summary: List tables
      operationId: listTables
      description: Returns every table for the authenticated account.
      security:
        - bearerAuth: []
      tags:
        - Tables
      responses:
        '200':
          description: Tables list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        display_name:
                          type: string
                          example: example
                        type:
                          type: string
                          enum:
                            - table
                            - object
                          example: table
                        custom:
                          type: boolean
                          example: false
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                        description:
                          type: string
                          example: example
                        emoji:
                          type: string
                          example: example
                        icon_color:
                          type: string
                          example: example
                        field_count:
                          type: number
                          example: 1
                      required:
                        - id
                        - name
                        - display_name
                        - type
                        - custom
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create table
      operationId: createTable
      description: >-
        Creates a table. Columns can be supplied at creation or added later.
        Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Tables
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                displayName:
                  type: string
                  minLength: 1
                  example: example
                emoji:
                  type: string
                  example: example
                icon_color:
                  type: string
                  example: example
                columns:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        example: example
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - string
                              - number
                              - boolean
                              - date
                              - tags
                              - relation
                              - autoIncrement
                              - dateOnly
                              - prismaRelation
                              - kanbanViewOrder
                              - file
                              - avatar
                              - permissions
                              - formula
                            example: string
                          - type: string
                            enum:
                              - select
                            example: select
                      metadata:
                        type: object
                        additionalProperties: {}
                      record_type_id:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                      recordTypeId:
                        type: integer
                        minimum: 0
                        exclusiveMinimum: true
                        example: 1
                    required:
                      - name
                      - type
                    additionalProperties: false
              required:
                - name
                - displayName
      responses:
        '201':
          description: Created table
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - table
                          - object
                        example: table
                      custom:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      description:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      field_count:
                        type: number
                        example: 1
                      fields:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            key:
                              type: string
                              example: example
                            type:
                              type: string
                              example: example
                            editable:
                              type: boolean
                              example: false
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            read_only:
                              type: boolean
                              example: false
                            required:
                              type: boolean
                              example: false
                            unique:
                              type: boolean
                              example: false
                            is_system:
                              type: boolean
                              example: false
                            is_predefined:
                              type: boolean
                              example: false
                            default_value:
                              nullable: true
                              type: object
                            format:
                              type: string
                              example: example
                            mode:
                              type: string
                              enum:
                                - singleSelect
                                - multiSelect
                                - single
                                - multi
                              example: singleSelect
                            timezone:
                              type: string
                              example: example
                            decimals:
                              type: number
                              example: 1
                            currency:
                              type: string
                              example: example
                            min:
                              type: number
                              nullable: true
                              example: 1
                            max:
                              type: number
                              nullable: true
                              example: 1
                            time_format:
                              type: string
                              example: example
                            show_preview:
                              type: boolean
                              example: false
                            allowed_file_types:
                              type: array
                              items:
                                type: string
                                example: example
                            max_file_size:
                              type: number
                              example: 1
                            related_table_id:
                              type: number
                              example: 1
                            related_record_type_ids:
                              type: array
                              nullable: true
                              items:
                                type: number
                                example: 1
                            display_field_id:
                              type: number
                              example: 1
                            relation_mode:
                              type: string
                              example: example
                            include_activity:
                              type: boolean
                              example: false
                            metadata:
                              type: object
                              additionalProperties: {}
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  color:
                                    type: string
                                    example: example
                                  order:
                                    type: number
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                required:
                                  - id
                                  - name
                                  - color
                                  - order
                                  - created_at
                                  - updated_at
                            expression:
                              nullable: true
                              type: object
                            output_type:
                              type: string
                              example: example
                            apply_if:
                              nullable: true
                              type: object
                            number_config:
                              nullable: true
                              type: object
                            date_config:
                              nullable: true
                              type: object
                            string_config:
                              nullable: true
                              type: object
                          required:
                            - id
                            - name
                            - key
                            - type
                            - editable
                            - created_at
                            - updated_at
                      views:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            type:
                              type: string
                              enum:
                                - TABLE
                                - KANBAN
                                - RECORD
                              example: TABLE
                            is_default:
                              type: boolean
                              example: false
                            is_private:
                              type: boolean
                              example: false
                            record_type_id:
                              type: number
                              nullable: true
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            column_order:
                              type: array
                              items:
                                type: string
                                example: example
                            hidden_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            sticky_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            grouping_field_id:
                              type: number
                              example: 1
                            column_ordering:
                              nullable: true
                              type: object
                            title_field_id:
                              type: number
                              example: 1
                            display_field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                          required:
                            - id
                            - name
                            - type
                            - is_default
                            - is_private
                            - record_type_id
                            - created_at
                            - updated_at
                      record_types:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            display_name:
                              type: string
                              example: example
                            is_default:
                              type: boolean
                              example: false
                            single_noun:
                              type: string
                              example: example
                            emoji:
                              type: string
                              example: example
                            icon_color:
                              type: string
                              example: example
                            disable_side_effects:
                              type: boolean
                              example: false
                            disable_relation_logging:
                              type: boolean
                              example: false
                            default_view_id:
                              type: number
                              example: 1
                            field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                            views:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  type:
                                    type: string
                                    enum:
                                      - TABLE
                                      - KANBAN
                                      - RECORD
                                    example: TABLE
                                  is_default:
                                    type: boolean
                                    example: false
                                  is_private:
                                    type: boolean
                                    example: false
                                  record_type_id:
                                    type: number
                                    nullable: true
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  column_order:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  hidden_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  sticky_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  grouping_field_id:
                                    type: number
                                    example: 1
                                  column_ordering:
                                    nullable: true
                                    type: object
                                  title_field_id:
                                    type: number
                                    example: 1
                                  display_field_ids:
                                    type: array
                                    items:
                                      type: number
                                      example: 1
                                required:
                                  - id
                                  - name
                                  - type
                                  - is_default
                                  - is_private
                                  - record_type_id
                                  - created_at
                                  - updated_at
                          required:
                            - id
                            - name
                            - display_name
                            - is_default
                    required:
                      - id
                      - name
                      - display_name
                      - type
                      - custom
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}:
    get:
      summary: Get table
      operationId: getTable
      description: Returns one table including fields and views.
      security:
        - bearerAuth: []
      tags:
        - Tables
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Table detail
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - table
                          - object
                        example: table
                      custom:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      description:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      field_count:
                        type: number
                        example: 1
                      fields:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            key:
                              type: string
                              example: example
                            type:
                              type: string
                              example: example
                            editable:
                              type: boolean
                              example: false
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            read_only:
                              type: boolean
                              example: false
                            required:
                              type: boolean
                              example: false
                            unique:
                              type: boolean
                              example: false
                            is_system:
                              type: boolean
                              example: false
                            is_predefined:
                              type: boolean
                              example: false
                            default_value:
                              nullable: true
                              type: object
                            format:
                              type: string
                              example: example
                            mode:
                              type: string
                              enum:
                                - singleSelect
                                - multiSelect
                                - single
                                - multi
                              example: singleSelect
                            timezone:
                              type: string
                              example: example
                            decimals:
                              type: number
                              example: 1
                            currency:
                              type: string
                              example: example
                            min:
                              type: number
                              nullable: true
                              example: 1
                            max:
                              type: number
                              nullable: true
                              example: 1
                            time_format:
                              type: string
                              example: example
                            show_preview:
                              type: boolean
                              example: false
                            allowed_file_types:
                              type: array
                              items:
                                type: string
                                example: example
                            max_file_size:
                              type: number
                              example: 1
                            related_table_id:
                              type: number
                              example: 1
                            related_record_type_ids:
                              type: array
                              nullable: true
                              items:
                                type: number
                                example: 1
                            display_field_id:
                              type: number
                              example: 1
                            relation_mode:
                              type: string
                              example: example
                            include_activity:
                              type: boolean
                              example: false
                            metadata:
                              type: object
                              additionalProperties: {}
                            options:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  color:
                                    type: string
                                    example: example
                                  order:
                                    type: number
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                required:
                                  - id
                                  - name
                                  - color
                                  - order
                                  - created_at
                                  - updated_at
                            expression:
                              nullable: true
                              type: object
                            output_type:
                              type: string
                              example: example
                            apply_if:
                              nullable: true
                              type: object
                            number_config:
                              nullable: true
                              type: object
                            date_config:
                              nullable: true
                              type: object
                            string_config:
                              nullable: true
                              type: object
                          required:
                            - id
                            - name
                            - key
                            - type
                            - editable
                            - created_at
                            - updated_at
                      views:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            type:
                              type: string
                              enum:
                                - TABLE
                                - KANBAN
                                - RECORD
                              example: TABLE
                            is_default:
                              type: boolean
                              example: false
                            is_private:
                              type: boolean
                              example: false
                            record_type_id:
                              type: number
                              nullable: true
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                            column_order:
                              type: array
                              items:
                                type: string
                                example: example
                            hidden_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            sticky_columns:
                              type: array
                              items:
                                type: string
                                example: example
                            grouping_field_id:
                              type: number
                              example: 1
                            column_ordering:
                              nullable: true
                              type: object
                            title_field_id:
                              type: number
                              example: 1
                            display_field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                          required:
                            - id
                            - name
                            - type
                            - is_default
                            - is_private
                            - record_type_id
                            - created_at
                            - updated_at
                      record_types:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            display_name:
                              type: string
                              example: example
                            is_default:
                              type: boolean
                              example: false
                            single_noun:
                              type: string
                              example: example
                            emoji:
                              type: string
                              example: example
                            icon_color:
                              type: string
                              example: example
                            disable_side_effects:
                              type: boolean
                              example: false
                            disable_relation_logging:
                              type: boolean
                              example: false
                            default_view_id:
                              type: number
                              example: 1
                            field_ids:
                              type: array
                              items:
                                type: number
                                example: 1
                            views:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: number
                                    example: 1
                                  name:
                                    type: string
                                    example: example
                                  type:
                                    type: string
                                    enum:
                                      - TABLE
                                      - KANBAN
                                      - RECORD
                                    example: TABLE
                                  is_default:
                                    type: boolean
                                    example: false
                                  is_private:
                                    type: boolean
                                    example: false
                                  record_type_id:
                                    type: number
                                    nullable: true
                                    example: 1
                                  created_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  updated_at:
                                    type: string
                                    nullable: true
                                    example: example
                                  column_order:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  hidden_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  sticky_columns:
                                    type: array
                                    items:
                                      type: string
                                      example: example
                                  grouping_field_id:
                                    type: number
                                    example: 1
                                  column_ordering:
                                    nullable: true
                                    type: object
                                  title_field_id:
                                    type: number
                                    example: 1
                                  display_field_ids:
                                    type: array
                                    items:
                                      type: number
                                      example: 1
                                required:
                                  - id
                                  - name
                                  - type
                                  - is_default
                                  - is_private
                                  - record_type_id
                                  - created_at
                                  - updated_at
                          required:
                            - id
                            - name
                            - display_name
                            - is_default
                    required:
                      - id
                      - name
                      - display_name
                      - type
                      - custom
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update table
      operationId: updateTable
      description: >-
        Updates display name, emoji, color, or description. Requires a USER API
        key with edit access to the table (admins/owners, the table's creator,
        or FULL_ACCESS sharing).
      security:
        - bearerAuth: []
      tags:
        - Tables
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                displayName:
                  type: string
                  minLength: 1
                  example: example
                emoji:
                  type: string
                  example: example
                icon_color:
                  type: string
                  example: example
                iconColor:
                  type: string
                  example: example
                description:
                  type: string
                  example: example
      responses:
        '200':
          description: Updated table
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      display_name:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - table
                          - object
                        example: table
                      custom:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      description:
                        type: string
                        example: example
                      emoji:
                        type: string
                        example: example
                      icon_color:
                        type: string
                        example: example
                      field_count:
                        type: number
                        example: 1
                    required:
                      - id
                      - name
                      - display_name
                      - type
                      - custom
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete table
      operationId: deleteTable
      description: >-
        Deletes a table. Requires a USER API key with delete access to the table
        (admins/owners, the table's creator, or FULL_ACCESS sharing).
      security:
        - bearerAuth: []
      tags:
        - Tables
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/schema:
    get:
      summary: Get table schema
      operationId: getTableSchema
      description: Returns only the schema (fields, types, formats) for a table.
      security:
        - bearerAuth: []
      tags:
        - Tables
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Table schema
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/fields:
    get:
      summary: List table fields
      operationId: listTableFields
      description: Returns the columns defined on a table.
      security:
        - bearerAuth: []
      tags:
        - Table fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      responses:
        '200':
          description: Fields list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        key:
                          type: string
                          example: example
                        type:
                          type: string
                          example: example
                        editable:
                          type: boolean
                          example: false
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                        read_only:
                          type: boolean
                          example: false
                        required:
                          type: boolean
                          example: false
                        unique:
                          type: boolean
                          example: false
                        is_system:
                          type: boolean
                          example: false
                        is_predefined:
                          type: boolean
                          example: false
                        default_value:
                          nullable: true
                          type: object
                        format:
                          type: string
                          example: example
                        mode:
                          type: string
                          enum:
                            - singleSelect
                            - multiSelect
                            - single
                            - multi
                          example: singleSelect
                        timezone:
                          type: string
                          example: example
                        decimals:
                          type: number
                          example: 1
                        currency:
                          type: string
                          example: example
                        min:
                          type: number
                          nullable: true
                          example: 1
                        max:
                          type: number
                          nullable: true
                          example: 1
                        time_format:
                          type: string
                          example: example
                        show_preview:
                          type: boolean
                          example: false
                        allowed_file_types:
                          type: array
                          items:
                            type: string
                            example: example
                        max_file_size:
                          type: number
                          example: 1
                        related_table_id:
                          type: number
                          example: 1
                        related_record_type_ids:
                          type: array
                          nullable: true
                          items:
                            type: number
                            example: 1
                        display_field_id:
                          type: number
                          example: 1
                        relation_mode:
                          type: string
                          example: example
                        include_activity:
                          type: boolean
                          example: false
                        metadata:
                          type: object
                          additionalProperties: {}
                        options:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: number
                                example: 1
                              name:
                                type: string
                                example: example
                              color:
                                type: string
                                example: example
                              order:
                                type: number
                                example: 1
                              created_at:
                                type: string
                                nullable: true
                                example: example
                              updated_at:
                                type: string
                                nullable: true
                                example: example
                            required:
                              - id
                              - name
                              - color
                              - order
                              - created_at
                              - updated_at
                        expression:
                          nullable: true
                          type: object
                        output_type:
                          type: string
                          example: example
                        apply_if:
                          nullable: true
                          type: object
                        number_config:
                          nullable: true
                          type: object
                        date_config:
                          nullable: true
                          type: object
                        string_config:
                          nullable: true
                          type: object
                      required:
                        - id
                        - name
                        - key
                        - type
                        - editable
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create table field
      operationId: createTableField
      description: >-
        Creates a column on a table. Requires a USER API key with edit access to
        the table (FULL_ACCESS sharing); read-only access is not enough.
      security:
        - bearerAuth: []
      tags:
        - Table fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                type:
                  anyOf:
                    - type: string
                      enum:
                        - string
                        - number
                        - boolean
                        - date
                        - tags
                        - relation
                        - autoIncrement
                        - dateOnly
                        - prismaRelation
                        - kanbanViewOrder
                        - file
                        - avatar
                        - permissions
                        - formula
                      example: string
                    - type: string
                      enum:
                        - select
                      example: select
                metadata:
                  type: object
                  additionalProperties: {}
                record_type_id:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                recordTypeId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
                - name
                - type
              additionalProperties: false
      responses:
        '201':
          description: Created field
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      key:
                        type: string
                        example: example
                      type:
                        type: string
                        example: example
                      editable:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      read_only:
                        type: boolean
                        example: false
                      required:
                        type: boolean
                        example: false
                      unique:
                        type: boolean
                        example: false
                      is_system:
                        type: boolean
                        example: false
                      is_predefined:
                        type: boolean
                        example: false
                      default_value:
                        nullable: true
                        type: object
                      format:
                        type: string
                        example: example
                      mode:
                        type: string
                        enum:
                          - singleSelect
                          - multiSelect
                          - single
                          - multi
                        example: singleSelect
                      timezone:
                        type: string
                        example: example
                      decimals:
                        type: number
                        example: 1
                      currency:
                        type: string
                        example: example
                      min:
                        type: number
                        nullable: true
                        example: 1
                      max:
                        type: number
                        nullable: true
                        example: 1
                      time_format:
                        type: string
                        example: example
                      show_preview:
                        type: boolean
                        example: false
                      allowed_file_types:
                        type: array
                        items:
                          type: string
                          example: example
                      max_file_size:
                        type: number
                        example: 1
                      related_table_id:
                        type: number
                        example: 1
                      related_record_type_ids:
                        type: array
                        nullable: true
                        items:
                          type: number
                          example: 1
                      display_field_id:
                        type: number
                        example: 1
                      relation_mode:
                        type: string
                        example: example
                      include_activity:
                        type: boolean
                        example: false
                      metadata:
                        type: object
                        additionalProperties: {}
                      options:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            color:
                              type: string
                              example: example
                            order:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          required:
                            - id
                            - name
                            - color
                            - order
                            - created_at
                            - updated_at
                      expression:
                        nullable: true
                        type: object
                      output_type:
                        type: string
                        example: example
                      apply_if:
                        nullable: true
                        type: object
                      number_config:
                        nullable: true
                        type: object
                      date_config:
                        nullable: true
                        type: object
                      string_config:
                        nullable: true
                        type: object
                    required:
                      - id
                      - name
                      - key
                      - type
                      - editable
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/fields/{fieldId}:
    patch:
      summary: Update table field
      operationId: updateTableField
      description: >-
        Updates a field's metadata, defaults, or ordering. Requires a USER API
        key with edit access to the table (FULL_ACCESS sharing); read-only
        access is not enough.
      security:
        - bearerAuth: []
      tags:
        - Table fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                type:
                  anyOf:
                    - type: string
                      enum:
                        - string
                        - number
                        - boolean
                        - date
                        - tags
                        - relation
                        - autoIncrement
                        - dateOnly
                        - prismaRelation
                        - kanbanViewOrder
                        - file
                        - avatar
                        - permissions
                        - formula
                      example: string
                    - type: string
                      enum:
                        - select
                      example: select
                metadata:
                  type: object
                  additionalProperties: {}
                order:
                  type: integer
                  example: 1
                required:
                  type: boolean
                  example: false
                unique:
                  type: boolean
                  example: false
                tags:
                  type: array
                  items:
                    type: object
                    additionalProperties: {}
                defaultValue:
                  nullable: true
                  type: object
              additionalProperties: false
      responses:
        '200':
          description: Updated field
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      key:
                        type: string
                        example: example
                      type:
                        type: string
                        example: example
                      editable:
                        type: boolean
                        example: false
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                      read_only:
                        type: boolean
                        example: false
                      required:
                        type: boolean
                        example: false
                      unique:
                        type: boolean
                        example: false
                      is_system:
                        type: boolean
                        example: false
                      is_predefined:
                        type: boolean
                        example: false
                      default_value:
                        nullable: true
                        type: object
                      format:
                        type: string
                        example: example
                      mode:
                        type: string
                        enum:
                          - singleSelect
                          - multiSelect
                          - single
                          - multi
                        example: singleSelect
                      timezone:
                        type: string
                        example: example
                      decimals:
                        type: number
                        example: 1
                      currency:
                        type: string
                        example: example
                      min:
                        type: number
                        nullable: true
                        example: 1
                      max:
                        type: number
                        nullable: true
                        example: 1
                      time_format:
                        type: string
                        example: example
                      show_preview:
                        type: boolean
                        example: false
                      allowed_file_types:
                        type: array
                        items:
                          type: string
                          example: example
                      max_file_size:
                        type: number
                        example: 1
                      related_table_id:
                        type: number
                        example: 1
                      related_record_type_ids:
                        type: array
                        nullable: true
                        items:
                          type: number
                          example: 1
                      display_field_id:
                        type: number
                        example: 1
                      relation_mode:
                        type: string
                        example: example
                      include_activity:
                        type: boolean
                        example: false
                      metadata:
                        type: object
                        additionalProperties: {}
                      options:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            name:
                              type: string
                              example: example
                            color:
                              type: string
                              example: example
                            order:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          required:
                            - id
                            - name
                            - color
                            - order
                            - created_at
                            - updated_at
                      expression:
                        nullable: true
                        type: object
                      output_type:
                        type: string
                        example: example
                      apply_if:
                        nullable: true
                        type: object
                      number_config:
                        nullable: true
                        type: object
                      date_config:
                        nullable: true
                        type: object
                      string_config:
                        nullable: true
                        type: object
                    required:
                      - id
                      - name
                      - key
                      - type
                      - editable
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete table field
      operationId: deleteTableField
      description: >-
        Deletes a column from a table. Requires a USER API key with edit access
        to the table (FULL_ACCESS sharing); read-only access is not enough.
      security:
        - bearerAuth: []
      tags:
        - Table fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/fields/{fieldId}/formula-dependencies:
    get:
      summary: Get table field formula dependencies
      operationId: getTableFieldFormulaDependencies
      description: >-
        Returns the formula dependencies for a specific field. Requires a USER
        API key with edit access to the table.
      security:
        - bearerAuth: []
      tags:
        - Table fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      responses:
        '200':
          description: Formula dependencies
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: number
                        example: 1
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/fields/preview-formula:
    post:
      summary: Preview formula evaluation
      operationId: previewTableFormula
      description: >-
        Previews formula evaluation on existing data. Requires a USER API key
        with edit access to the table.
      security:
        - bearerAuth: []
      tags:
        - Table fields
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                formulaMetadata:
                  type: object
                  properties:
                    applyIf:
                      type: object
                      description: Query preconditions filter
                    expression:
                      type: object
                      description: >-
                        Formula expression AST. Maximum AST depth is 5
                        (root-to-leaf node count; root node is depth 1).
                previewFilter:
                  type: object
                  description: Filter for preview rows
                limit:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
                - formulaMetadata
      responses:
        '200':
          description: Formula preview evaluation results
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          type: object
                          properties:
                            rowId:
                              type: string
                              example: example
                            rowName:
                              type: string
                              example: example
                            previewState:
                              type: object
                              properties:
                                value:
                                  nullable: true
                                  type: object
                                isValid:
                                  type: boolean
                                  example: false
                                error:
                                  type: string
                                  nullable: true
                                  example: example
                              required:
                                - isValid
                                - error
                            row:
                              type: object
                              additionalProperties: {}
                          required:
                            - rowId
                            - rowName
                            - previewState
                            - row
                      inferredOutputType:
                        type: string
                        example: example
                    required:
                      - results
                      - inferredOutputType
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/fields/{fieldId}/tags:
    get:
      summary: List field options
      operationId: listTableFieldOptions
      description: Returns the options (tags) defined on a select/tags field.
      security:
        - bearerAuth: []
      tags:
        - Table options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      responses:
        '200':
          description: Options list
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        name:
                          type: string
                          example: example
                        color:
                          type: string
                          example: example
                        order:
                          type: number
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - name
                        - color
                        - order
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create field option
      operationId: createTableFieldOption
      description: >-
        Adds an option (tag) to a select/tags field. Requires a USER API key
        with edit access to the table.
      security:
        - bearerAuth: []
      tags:
        - Table options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: fieldId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                color:
                  type: string
                  example: example
                order:
                  type: number
                  example: 1
              required:
                - name
      responses:
        '201':
          description: Created option
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      color:
                        type: string
                        example: example
                      order:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - name
                      - color
                      - order
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/tags/{tagId}:
    patch:
      summary: Update field option
      operationId: updateTableFieldOption
      description: >-
        Updates an option's name, color, or order. Requires a USER API key with
        edit access to the table.
      security:
        - bearerAuth: []
      tags:
        - Table options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 7
          required: true
          name: tagId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  example: example
                color:
                  type: string
                  example: example
                order:
                  type: number
                  example: 1
      responses:
        '200':
          description: Updated option
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      name:
                        type: string
                        example: example
                      color:
                        type: string
                        example: example
                      order:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - name
                      - color
                      - order
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete field option
      operationId: deleteTableFieldOption
      description: >-
        Deletes an option from a select/tags field. Requires a USER API key with
        edit access to the table.
      security:
        - bearerAuth: []
      tags:
        - Table options
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 7
          required: true
          name: tagId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/list:
    post:
      summary: List rows
      operationId: listTableRows
      description: Returns a paginated, filterable list of rows.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                search:
                  type: string
                  nullable: true
                  example: example
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    additionalProperties: {}
                record_type:
                  anyOf:
                    - type: string
                      example: example
                    - type: number
                      example: 1
                    - type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    - nullable: true
                      type: object
                page:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  default: 1
                  example: 1
                page_size:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 200
                  default: 50
                  example: 1
      responses:
        '200':
          description: Rows page
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      rows:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              example: example
                            auto_id:
                              type: number
                              example: 1
                            created_at:
                              type: string
                              nullable: true
                              example: example
                            updated_at:
                              type: string
                              nullable: true
                              example: example
                          additionalProperties: {}
                      total_count:
                        type: number
                        example: 1
                      total_pages:
                        type: number
                        example: 1
                      current_page:
                        type: number
                        example: 1
                    required:
                      - rows
                      - total_count
                      - total_pages
                      - current_page
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows:
    post:
      summary: Create row
      operationId: createTableRow
      description: Creates a single row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  additionalProperties: {}
              additionalProperties: {}
      responses:
        '201':
          description: Created row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/bulk:
    post:
      summary: Bulk-create rows
      operationId: createTableRowsBulk
      description: Creates multiple rows in a single call. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rows:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        additionalProperties: {}
                    additionalProperties: {}
                  minItems: 1
              required:
                - rows
      responses:
        '201':
          description: Created rows
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        auto_id:
                          type: number
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/{id}:
    get:
      summary: Get row
      operationId: getTableRow
      description: Returns a single row by id.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update row
      operationId: updateTableRow
      description: >-
        Updates a row's fields. Pass field values flat in the body or nested
        under `data`. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  additionalProperties: {}
              additionalProperties: {}
      responses:
        '200':
          description: Updated row
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: example
                      auto_id:
                        type: number
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete row
      operationId: deleteTableRow
      description: Deletes a row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/count:
    post:
      summary: Count rows
      operationId: countTableRows
      description: Returns the number of rows matching the optional query.
      security:
        - bearerAuth: []
      tags:
        - Table rows
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                recordType:
                  anyOf:
                    - type: string
                      example: example
                    - type: number
                      example: 1
                    - type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    - nullable: true
                      type: object
      responses:
        '200':
          description: Count
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      count:
                        type: number
                        example: 1
                    required:
                      - count
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/views/{viewId}/aggregations:
    get:
      summary: List aggregations
      operationId: listTableAggregations
      description: Returns aggregations configured for a view.
      security:
        - bearerAuth: []
      tags:
        - Table aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      responses:
        '200':
          description: Aggregations
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        view_id:
                          type: number
                          example: 1
                        column_id:
                          type: number
                          example: 1
                        operation:
                          type: string
                          example: example
                        tag_id:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - view_id
                        - column_id
                        - operation
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create aggregation
      operationId: createTableAggregation
      description: >-
        Creates an aggregation on a column for the given view. Requires a USER
        API key.
      security:
        - bearerAuth: []
      tags:
        - Table aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                columnId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                operation:
                  type: string
                  enum:
                    - COUNT_EMPTY
                    - COUNT_FILLED
                    - PERCENT_EMPTY
                    - PERCENT_FILLED
                    - SUM
                    - AVERAGE
                    - MIN
                    - MAX
                    - COUNT_TRUE
                    - COUNT_FALSE
                    - PERCENT_TRUE
                    - PERCENT_FALSE
                  example: COUNT_EMPTY
                tagId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
              required:
                - columnId
                - operation
      responses:
        '201':
          description: Created aggregation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      view_id:
                        type: number
                        example: 1
                      column_id:
                        type: number
                        example: 1
                      operation:
                        type: string
                        example: example
                      tag_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - view_id
                      - column_id
                      - operation
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/views/{viewId}/aggregations/{aggId}:
    patch:
      summary: Update aggregation
      operationId: updateTableAggregation
      description: Changes the operation of an aggregation. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 5
          required: true
          name: aggId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                operation:
                  type: string
                  enum:
                    - COUNT_EMPTY
                    - COUNT_FILLED
                    - PERCENT_EMPTY
                    - PERCENT_FILLED
                    - SUM
                    - AVERAGE
                    - MIN
                    - MAX
                    - COUNT_TRUE
                    - COUNT_FALSE
                    - PERCENT_TRUE
                    - PERCENT_FALSE
                  example: COUNT_EMPTY
              required:
                - operation
      responses:
        '200':
          description: Updated aggregation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      view_id:
                        type: number
                        example: 1
                      column_id:
                        type: number
                        example: 1
                      operation:
                        type: string
                        example: example
                      tag_id:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - view_id
                      - column_id
                      - operation
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete aggregation
      operationId: deleteTableAggregation
      description: Removes an aggregation from a view. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 5
          required: true
          name: aggId
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/views/{viewId}/aggregations/compute:
    post:
      summary: Compute aggregations
      operationId: computeTableAggregations
      description: Computes the configured aggregations for the rows matching the query.
      security:
        - bearerAuth: []
      tags:
        - Table aggregations
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 11
          required: true
          name: viewId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Query + search + sort + filters for the aggregation compute
                    call.
                search:
                  type: string
                  nullable: true
                  example: example
                recordType:
                  anyOf:
                    - type: string
                      example: example
                    - type: number
                      example: 1
                    - type: array
                      items:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    - nullable: true
                      type: object
                columnId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
      responses:
        '200':
          description: Aggregation results
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    additionalProperties: {}
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/{rowId}/activities:
    get:
      summary: List activities
      operationId: listTableActivities
      description: >-
        Returns manually-created activities attached to a row. Activities log
        interactions like notes, calls, meetings, and emails.
      security:
        - bearerAuth: []
      tags:
        - Table activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      responses:
        '200':
          description: Activities
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        type:
                          type: string
                          enum:
                            - NOTE
                            - EMAIL
                            - PHONE_CALL
                            - MEETING
                            - WHATSAPP
                          description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                          example: NOTE
                        content:
                          type: string
                          example: example
                        activity_date:
                          type: string
                          nullable: true
                          example: example
                        additional_data:
                          type: object
                          nullable: true
                          additionalProperties: {}
                        related_table_id:
                          type: number
                          nullable: true
                          example: 1
                        related_row_id:
                          type: string
                          nullable: true
                          example: example
                        users:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: number
                                example: 1
                              email:
                                type: string
                                example: example
                            required:
                              - id
                              - email
                        created_by:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - type
                        - content
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create activity
      operationId: createTableActivity
      description: >-
        Attaches a manual activity to a row. Use `type` to categorize it (NOTE,
        PHONE_CALL, MEETING, EMAIL, WHATSAPP). Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                type:
                  type: string
                  enum:
                    - NOTE
                    - EMAIL
                    - PHONE_CALL
                    - MEETING
                    - WHATSAPP
                  default: NOTE
                  example: NOTE
                activityDate:
                  type: string
                  nullable: true
                  example: example
                additionalData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                userIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                relatedTableId:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                relatedRowId:
                  type: string
                  example: example
              required:
                - content
      responses:
        '201':
          description: Created activity
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - NOTE
                          - EMAIL
                          - PHONE_CALL
                          - MEETING
                          - WHATSAPP
                        description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                        example: NOTE
                      content:
                        type: string
                        example: example
                      activity_date:
                        type: string
                        nullable: true
                        example: example
                      additional_data:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      related_table_id:
                        type: number
                        nullable: true
                        example: 1
                      related_row_id:
                        type: string
                        nullable: true
                        example: example
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            email:
                              type: string
                              example: example
                          required:
                            - id
                            - email
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - type
                      - content
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/activities/{id}:
    get:
      summary: Get activity
      operationId: getTableActivity
      description: Returns an activity by id.
      security:
        - bearerAuth: []
      tags:
        - Table activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Activity
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - NOTE
                          - EMAIL
                          - PHONE_CALL
                          - MEETING
                          - WHATSAPP
                        description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                        example: NOTE
                      content:
                        type: string
                        example: example
                      activity_date:
                        type: string
                        nullable: true
                        example: example
                      additional_data:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      related_table_id:
                        type: number
                        nullable: true
                        example: 1
                      related_row_id:
                        type: string
                        nullable: true
                        example: example
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            email:
                              type: string
                              example: example
                          required:
                            - id
                            - email
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - type
                      - content
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update activity
      operationId: updateTableActivity
      description: Updates an activity. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                activityDate:
                  type: string
                  nullable: true
                  example: example
                additionalData:
                  type: object
                  nullable: true
                  additionalProperties: {}
                userIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                    example: 1
                relatedTableId:
                  type: integer
                  nullable: true
                  minimum: 0
                  exclusiveMinimum: true
                  example: 1
                relatedRowId:
                  type: string
                  nullable: true
                  example: example
      responses:
        '200':
          description: Updated activity
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      type:
                        type: string
                        enum:
                          - NOTE
                          - EMAIL
                          - PHONE_CALL
                          - MEETING
                          - WHATSAPP
                        description: NOTE | EMAIL | PHONE_CALL | MEETING | WHATSAPP
                        example: NOTE
                      content:
                        type: string
                        example: example
                      activity_date:
                        type: string
                        nullable: true
                        example: example
                      additional_data:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      related_table_id:
                        type: number
                        nullable: true
                        example: 1
                      related_row_id:
                        type: string
                        nullable: true
                        example: example
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            email:
                              type: string
                              example: example
                          required:
                            - id
                            - email
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - type
                      - content
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete activity
      operationId: deleteTableActivity
      description: >-
        Deletes a manually-created activity. Only the owner or an account admin
        can delete. Auto-generated activities cannot be deleted. Requires a USER
        API key.
      security:
        - bearerAuth: []
      tags:
        - Table activities
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/{rowId}/tasks:
    get:
      summary: List tasks
      operationId: listTableTasks
      description: Returns tasks attached to a row.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      responses:
        '200':
          description: Tasks
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        content:
                          type: string
                          example: example
                        due_date:
                          type: string
                          nullable: true
                          example: example
                        assignee_ids:
                          type: array
                          items:
                            type: number
                            example: 1
                        completed:
                          type: boolean
                          example: false
                        completed_at:
                          type: string
                          nullable: true
                          example: example
                        created_by:
                          type: number
                          nullable: true
                          example: 1
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - content
                        - completed
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create task
      operationId: createTableTask
      description: Attaches a task to a row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                dueDate:
                  type: string
                  nullable: true
                  example: example
                assigneeIds:
                  type: array
                  items:
                    type: number
                    example: 1
              required:
                - content
      responses:
        '201':
          description: Created task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/tasks/{id}:
    get:
      summary: Get task
      operationId: getTableTask
      description: Returns a task by id.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update task
      operationId: updateTableTask
      description: >-
        Updates a task's content, due date, or assignees. Requires a USER API
        key.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  example: example
                dueDate:
                  type: string
                  nullable: true
                  example: example
                assigneeIds:
                  type: array
                  items:
                    type: number
                    example: 1
      responses:
        '200':
          description: Updated task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete task
      operationId: deleteTableTask
      description: Deletes a task. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/tasks/{id}/complete:
    post:
      summary: Complete task
      operationId: completeTableTask
      description: Marks a task as completed. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Completed task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/tasks/{id}/uncomplete:
    post:
      summary: Uncomplete task
      operationId: uncompleteTableTask
      description: >-
        Marks a previously completed task as open again. Requires a USER API
        key.
      security:
        - bearerAuth: []
      tags:
        - Table tasks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Uncompleted task
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      content:
                        type: string
                        example: example
                      due_date:
                        type: string
                        nullable: true
                        example: example
                      assignee_ids:
                        type: array
                        items:
                          type: number
                          example: 1
                      completed:
                        type: boolean
                        example: false
                      completed_at:
                        type: string
                        nullable: true
                        example: example
                      created_by:
                        type: number
                        nullable: true
                        example: 1
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - content
                      - completed
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/rows/{rowId}/files:
    get:
      summary: List files
      operationId: listTableFiles
      description: Returns the files attached to a row.
      security:
        - bearerAuth: []
      tags:
        - Table files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      responses:
        '200':
          description: Files
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        filename:
                          type: string
                          example: example
                        mime_type:
                          type: string
                          example: example
                        size_bytes:
                          type: number
                          example: 1
                        url:
                          type: string
                          example: example
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - filename
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Upload files
      operationId: uploadTableFiles
      description: >-
        Uploads one or more files to a row as multipart/form-data under the
        `files` field. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: string
            example: 65cf9b3a4b7c2a0012a3b4c5
          required: true
          name: rowId
          in: path
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    nullable: true
                    type: object
                  description: Binary file uploads. Send as multipart form-data.
              required:
                - files
      responses:
        '201':
          description: Uploaded files
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        row_id:
                          type: string
                          example: example
                        filename:
                          type: string
                          example: example
                        mime_type:
                          type: string
                          example: example
                        size_bytes:
                          type: number
                          example: 1
                        url:
                          type: string
                          example: example
                        created_at:
                          type: string
                          nullable: true
                          example: example
                        updated_at:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - row_id
                        - filename
                        - created_at
                        - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/files/{id}:
    get:
      summary: Get file
      operationId: getTableFile
      description: Returns file metadata.
      security:
        - bearerAuth: []
      tags:
        - Table files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: File
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      row_id:
                        type: string
                        example: example
                      filename:
                        type: string
                        example: example
                      mime_type:
                        type: string
                        example: example
                      size_bytes:
                        type: number
                        example: 1
                      url:
                        type: string
                        example: example
                      created_at:
                        type: string
                        nullable: true
                        example: example
                      updated_at:
                        type: string
                        nullable: true
                        example: example
                    required:
                      - id
                      - row_id
                      - filename
                      - created_at
                      - updated_at
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete file
      operationId: deleteTableFile
      description: Deletes a file from a row. Requires a USER API key.
      security:
        - bearerAuth: []
      tags:
        - Table files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    example: true
                  data:
                    type: object
                    properties:
                      deleted:
                        type: boolean
                        enum:
                          - true
                        example: true
                      id:
                        anyOf:
                          - type: string
                            example: example
                          - type: number
                            example: 1
                    required:
                      - deleted
                required:
                  - ok
                  - data
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/files/{id}/download:
    get:
      summary: Download file
      operationId: downloadTableFile
      description: Streams the file content. Returns the file binary; not a JSON envelope.
      security:
        - bearerAuth: []
      tags:
        - Table files
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 100
          required: true
          name: id
          in: path
      responses:
        '200':
          description: File binary
          content:
            application/octet-stream:
              schema:
                nullable: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/export/xlsx:
    post:
      summary: Export as XLSX
      operationId: exportTableXlsx
      description: Exports rows matching the query as an XLSX file.
      security:
        - bearerAuth: []
      tags:
        - Table export
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                search:
                  type: string
                  nullable: true
                  example: example
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    additionalProperties: {}
      responses:
        '200':
          description: XLSX binary
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                nullable: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tables/{name}/export/csv:
    post:
      summary: Export as CSV
      operationId: exportTableCsv
      description: Exports rows matching the query as CSV.
      security:
        - bearerAuth: []
      tags:
        - Table export
      parameters:
        - schema:
            type: string
            minLength: 1
            example: tasks_board
          required: true
          name: name
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: object
                  description: >-
                    Dynamic-table query. Either a single `{ path, operator,
                    value }` condition, or a nested group `{ operator: 'and' |
                    'or', conditions: [...] }`.
                search:
                  type: string
                  nullable: true
                  example: example
                sort:
                  type: array
                  nullable: true
                  items:
                    type: object
                    additionalProperties: {}
      responses:
        '200':
          description: CSV body
          content:
            text/csv:
              schema:
                nullable: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/integrations/resources/gmail/labels:
    get:
      summary: List Gmail labels
      operationId: listGmailLabelResources
      description: >-
        Lists Gmail labels for the connected account, to resolve label IDs used
        in Gmail trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Gmail labels
          content:
            application/json:
              schema:
                type: object
                properties:
                  labels:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        type:
                          type: string
                          enum:
                            - system
                            - user
                          example: system
                      required:
                        - id
                        - name
                        - type
                  total:
                    type: number
                    example: 1
                required:
                  - labels
                  - total
  /public/v1/integrations/resources/googlesheets/spreadsheets:
    get:
      summary: List Google spreadsheets
      operationId: listGoogleSpreadsheetResources
      description: >-
        Lists Google spreadsheets for the connected account, to resolve a
        spreadsheet_id for Google Sheets trigger configs. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            description: Optional search query to filter spreadsheets by name
            example: example
          required: false
          description: Optional search query to filter spreadsheets by name
          name: query
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 100
            default: 50
            example: 1
          required: false
          name: limit
          in: query
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Spreadsheets
          content:
            application/json:
              schema:
                type: object
                properties:
                  spreadsheets:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        url:
                          type: string
                          nullable: true
                          example: example
                        createdTime:
                          type: string
                          nullable: true
                          example: example
                        modifiedTime:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - name
                  total:
                    type: number
                    example: 1
                required:
                  - spreadsheets
                  - total
  /public/v1/integrations/resources/googlesheets/spreadsheets/{spreadsheetId}/sheets:
    get:
      summary: List sheets (tabs) in a spreadsheet
      operationId: listGoogleSpreadsheetSheetResources
      description: >-
        Lists the sheets (tabs) within a spreadsheet, to resolve a sheet_name
        for Google Sheets trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            example: 1AbC...
          required: true
          name: spreadsheetId
          in: path
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Sheets
          content:
            application/json:
              schema:
                type: object
                properties:
                  spreadsheetId:
                    type: string
                    example: example
                  spreadsheetName:
                    type: string
                    nullable: true
                    example: example
                  sheets:
                    type: array
                    items:
                      type: object
                      properties:
                        sheetId:
                          type: number
                          example: 1
                        title:
                          type: string
                          example: example
                        index:
                          type: number
                          example: 1
                      required:
                        - sheetId
                        - title
                        - index
                required:
                  - spreadsheetId
                  - sheets
  /public/v1/integrations/resources/googledocs/documents:
    get:
      summary: List Google Docs documents
      operationId: listGoogleDocumentResources
      description: >-
        Lists Google Docs documents for the connected account, to resolve a
        document_id for Google Docs trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            description: Optional search query to filter documents by name
            example: example
          required: false
          description: Optional search query to filter documents by name
          name: query
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 100
            default: 50
            example: 1
          required: false
          name: limit
          in: query
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Documents
          content:
            application/json:
              schema:
                type: object
                properties:
                  documents:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        url:
                          type: string
                          nullable: true
                          example: example
                        createdTime:
                          type: string
                          nullable: true
                          example: example
                        modifiedTime:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - name
                  total:
                    type: number
                    example: 1
                required:
                  - documents
                  - total
  /public/v1/integrations/resources/googledrive/shared-drives:
    get:
      summary: List Google Drive shared drives
      operationId: listGoogleSharedDriveResources
      description: >-
        Lists Google Drive shared drives for the connected account, to resolve a
        drive_id for Google Drive trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            description: Optional search query to filter shared drives by name
            example: example
          required: false
          description: Optional search query to filter shared drives by name
          name: query
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 100
            default: 50
            example: 1
          required: false
          name: limit
          in: query
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Shared drives
          content:
            application/json:
              schema:
                type: object
                properties:
                  drives:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        createdTime:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - name
                  total:
                    type: number
                    example: 1
                required:
                  - drives
                  - total
  /public/v1/integrations/resources/googledrive/folders:
    get:
      summary: List Google Drive folders
      operationId: listGoogleDriveFolderResources
      description: >-
        Lists Google Drive folders for the connected account, to resolve a
        folder_id for Google Drive trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            description: Optional search query to filter folders by name
            example: example
          required: false
          description: Optional search query to filter folders by name
          name: query
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 100
            default: 50
            example: 1
          required: false
          name: limit
          in: query
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Folders
          content:
            application/json:
              schema:
                type: object
                properties:
                  folders:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        createdTime:
                          type: string
                          nullable: true
                          example: example
                        modifiedTime:
                          type: string
                          nullable: true
                          example: example
                        webViewLink:
                          type: string
                          nullable: true
                          example: example
                      required:
                        - id
                        - name
                  total:
                    type: number
                    example: 1
                required:
                  - folders
                  - total
  /public/v1/integrations/resources/asana/workspaces:
    get:
      summary: List Asana workspaces
      operationId: listAsanaWorkspaceResources
      description: >-
        Lists Asana workspaces for the connected account, to resolve a
        workspace_gid for Asana trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Workspaces
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspaces:
                    type: array
                    items:
                      type: object
                      properties:
                        gid:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                      required:
                        - gid
                        - name
                  total:
                    type: number
                    example: 1
                required:
                  - workspaces
                  - total
  /public/v1/integrations/resources/asana/workspaces/{workspaceGid}/projects:
    get:
      summary: List Asana projects in a workspace
      operationId: listAsanaProjectResources
      description: >-
        Lists Asana projects within a workspace, to resolve a project_gid for
        Asana trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            example: '1200000000000001'
          required: true
          name: workspaceGid
          in: path
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Projects
          content:
            application/json:
              schema:
                type: object
                properties:
                  projects:
                    type: array
                    items:
                      type: object
                      properties:
                        gid:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        archived:
                          type: boolean
                          nullable: true
                          example: false
                      required:
                        - gid
                        - name
                  total:
                    type: number
                    example: 1
                required:
                  - projects
                  - total
  /public/v1/integrations/resources/salesforce/sobjects:
    get:
      summary: List Salesforce SObjects
      operationId: listSalesforceSObjectResources
      description: >-
        Lists Salesforce SObjects for the connected account, to resolve an
        sobject_name for Salesforce trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: SObjects
          content:
            application/json:
              schema:
                type: object
                properties:
                  sobjects:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: example
                        label:
                          type: string
                          example: example
                        custom:
                          type: boolean
                          example: false
                        queryable:
                          type: boolean
                          example: false
                      required:
                        - name
                        - label
                        - custom
                        - queryable
                  total:
                    type: number
                    example: 1
                required:
                  - sobjects
                  - total
  /public/v1/integrations/resources/salesforce/sobjects/{sobjectName}/fields:
    get:
      summary: List Salesforce SObject fields
      operationId: listSalesforceSObjectFieldResources
      description: >-
        Lists the fields of a Salesforce SObject, to resolve field names for
        Salesforce trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: string
            example: Opportunity
          required: true
          name: sobjectName
          in: path
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Fields
          content:
            application/json:
              schema:
                type: object
                properties:
                  sobjectName:
                    type: string
                    example: example
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: example
                        label:
                          type: string
                          example: example
                        type:
                          type: string
                          example: example
                        custom:
                          type: boolean
                          example: false
                        updateable:
                          type: boolean
                          example: false
                        filterable:
                          type: boolean
                          example: false
                      required:
                        - name
                        - label
                        - type
                        - custom
                        - updateable
                        - filterable
                  total:
                    type: number
                    example: 1
                required:
                  - sobjectName
                  - fields
                  - total
  /public/v1/integrations/resources/outlook/folders:
    get:
      summary: List Outlook mail folders
      operationId: listOutlookFolderResources
      description: >-
        Lists Outlook mail folders for the connected account, to resolve a
        folderId for Outlook message trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Folders
          content:
            application/json:
              schema:
                type: object
                properties:
                  folders:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        displayName:
                          type: string
                          example: example
                        totalItemCount:
                          type: number
                          example: 1
                        unreadItemCount:
                          type: number
                          example: 1
                        childFolderCount:
                          type: number
                          example: 1
                        isHidden:
                          type: boolean
                          example: false
                      required:
                        - id
                        - displayName
                        - totalItemCount
                        - unreadItemCount
                        - childFolderCount
                        - isHidden
                  total:
                    type: number
                    example: 1
                required:
                  - folders
                  - total
  /public/v1/integrations/resources/outlook/calendars:
    get:
      summary: List Outlook calendars
      operationId: listOutlookCalendarResources
      description: >-
        Lists Outlook calendars for the connected account, to resolve a
        calendarId for Outlook event trigger configs. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integration Resources
      parameters:
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: connectedAccountId
          in: query
      responses:
        '200':
          description: Calendars
          content:
            application/json:
              schema:
                type: object
                properties:
                  calendars:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: example
                        name:
                          type: string
                          example: example
                        color:
                          type: string
                          nullable: true
                          example: example
                        isDefaultCalendar:
                          type: boolean
                          example: false
                        canEdit:
                          type: boolean
                          example: false
                        owner:
                          type: object
                          nullable: true
                          properties:
                            name:
                              type: string
                              example: example
                            address:
                              type: string
                              example: example
                      required:
                        - id
                        - name
                        - color
                        - isDefaultCalendar
                        - canEdit
                        - owner
                  total:
                    type: number
                    example: 1
                required:
                  - calendars
                  - total
  /public/v1/integrations:
    get:
      summary: List connected account integrations
      operationId: listConnectedAccounts
      description: >-
        Read-only list of OAuth/API connected accounts for this account (for
        example Google Sheets, Gmail, Slack). Use the returned id as
        connectedAccountId in agent settings, flows, and workflows. Requires a
        USER API key. Private integrations are only visible to their creator;
        shared integrations are visible to all account users.
      security:
        - userApiKey: []
      tags:
        - Integrations
      parameters:
        - schema:
            type: string
            enum:
              - GMAIL
              - GOOGLECALENDAR
              - SLACK
              - CALENDLY
              - GOOGLEDOCS
              - GOOGLESHEETS
              - NOTION
              - GOOGLEDRIVE
              - GRANOLA_MCP
              - GOOGLEMEET
              - ZOOM
              - GAMMA
              - STRIPE
              - POSTHOG
              - LINKEDIN
              - FACEBOOK
              - GOOGLE_ANALYTICS
              - GOOGLE_SEARCH_CONSOLE
              - MAILCHIMP
              - SEMRUSH
              - GOOGLEADS
              - INSTAGRAM
              - ADYNTEL
              - GOOGLETASKS
              - LINEAR
              - JIRA
              - ASANA
              - SHARE_POINT
              - ONE_DRIVE
              - EXCEL
              - TIKTOK
              - TWITTER
              - YOUTUBE
              - GOOGLE_MAPS
              - METAADS
              - SHOPIFY
              - AIRTABLE
              - MONDAY
              - TRELLO
              - GOOGLESLIDES
              - BUILTWITH
              - HUBSPOT
              - PIPEDRIVE
              - ATTIO
              - ZENDESK
              - SALESFORCE
              - SALESFORCE_SERVICE_CLOUD
              - INTERCOM
              - WEBFLOW
              - FIGMA
              - APOLLO
              - OUTLOOK
              - FRESHDESK
              - ZOHO_DESK
              - ZOHO_INVOICE
              - ZOHO
              - BREX
            example: GMAIL
          required: false
          name: toolkit
          in: query
        - schema:
            type: string
            minLength: 1
            example: example
          required: false
          name: filterText
          in: query
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
          required: false
          name: isConnected
          in: query
        - schema:
            type: string
            enum:
              - PRIVATE
              - SHARED
            example: PRIVATE
          required: false
          name: visibility
          in: query
      responses:
        '200':
          description: Connected accounts for this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntegrationsListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/integrations/toolkits:
    get:
      summary: List connectable toolkits
      operationId: listIntegrationToolkits
      description: >-
        Lists the catalog of toolkits that can be connected, with each toolkit's
        auth scheme and the tool slugs it supports. Use this to discover valid
        toolkit values and the tool slugs accepted by the update-tools endpoint.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Account Integrations
      responses:
        '200':
          description: Connectable toolkits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntegrationToolkitList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/integrations/{integrationId}:
    get:
      summary: Get account integration details
      operationId: getAccountIntegration
      description: Returns a single account integration by ID. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Account Integrations
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: integrationId
          in: path
      responses:
        '200':
          description: Account integration details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntegration'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update account integration
      operationId: updateAccountIntegration
      description: >-
        Updates an integration's alias and/or visibility (SHARED or PRIVATE).
        Only the creator, an admin, or an owner may update. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Account Integrations
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: integrationId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIntegrationUpdateInput'
      responses:
        '200':
          description: Updated account integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntegration'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/integrations/{integrationId}/tools:
    get:
      summary: List integration tools
      operationId: getAccountIntegrationTools
      description: >-
        Returns the integration's tools split into enabled and available,
        including whether the connected account holds the OAuth scopes each tool
        requires. Use the tool `slug` values with the update-tools endpoint.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Account Integrations
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: integrationId
          in: path
      responses:
        '200':
          description: Integration tools (enabled + available)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntegrationTools'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Set integration allowed tools
      operationId: setAccountIntegrationTools
      description: >-
        Replaces the integration's enabled tool slugs with the provided list.
        Slugs must belong to the integration's toolkit. Only the creator, an
        admin, or an owner may update. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Account Integrations
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: integrationId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIntegrationSetToolsInput'
      responses:
        '200':
          description: Updated account integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntegration'
        '400':
          description: Invalid tool slugs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/guidance/visual-options:
    get:
      summary: List valid icons and colors
      operationId: getVisualOptions
      description: >-
        Returns the allowlists used when creating objects, tables, fields, and
        select options: valid icon keys, icon colors, option colors, and
        tag/relation modes. Sourced live from backend constants, so values never
        drift from validation. Accepts any valid API key.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Guidance
      responses:
        '200':
          description: Visual option allowlists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicVisualOptions'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/guidance/fields:
    get:
      summary: Field type & metadata reference
      operationId: getFieldGuidance
      description: >-
        Returns a markdown reference for every field/column type (string,
        number, boolean, date, dateOnly, select, relation), its metadata shape
        (formats, currency, decimals, modes), and best practices. Generated from
        the same constants the create/update schemas validate against. Accepts
        any valid API key.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Guidance
      responses:
        '200':
          description: Field type guidance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicFieldGuidance'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/guidance/nodes:
    get:
      summary: List workflow/flow node types
      operationId: listNodeTypes
      description: >-
        Returns every node type with flags for where it is valid (agent flow vs
        automation workflow) and whether it may have multiple outgoing edges.
        Use this to pick valid node types before building a flow or workflow
        graph. Accepts any valid API key.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Guidance
      responses:
        '200':
          description: Node type catalog
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicNodeTypeList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/guidance/nodes/{nodeType}:
    get:
      summary: Get configuration guidance for a node type
      operationId: getNodeGuidance
      description: >-
        Returns markdown guidance for configuring a single node type (e.g.
        TOOLS_AI, API, CONDITIONAL_ROUTING). Content is published per node type
        and editable without a deploy; returns empty guidance when none is
        published. Accepts any valid API key.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Guidance
      parameters:
        - schema:
            type: string
            enum:
              - TRIGGER_INTENT
              - TRIGGER
              - SCHEDULED_TRIGGER
              - WEBHOOK
              - THINK
              - RESPONSE_AI
              - SAY_AI
              - API
              - START
              - CONDITIONAL_ROUTING
              - TOOLS_AI
              - AI_CAPTURE
              - DATA_TRANSFORMER
              - DYNAMIC_TABLES
              - ITERATION
              - BREAK
              - AUTOMATION_STATUS
              - SEND_MESSAGE
              - SEND_WHATSAPP_MESSAGE
              - TRANSCRIPTION
              - FILE_ANALYSIS
              - CREATE_RECORD_ACTIVITY
            example: TOOLS_AI
          required: true
          name: nodeType
          in: path
      responses:
        '200':
          description: Node configuration guidance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicNodeGuidance'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/channels:
    get:
      summary: List channel integrations
      operationId: listChannelIntegrations
      description: >-
        Returns the account's connected channel integrations (WhatsApp,
        Instagram, Messenger) and which agent each number/account/page is bound
        to. Connecting a channel requires the OAuth flow in the app and is not
        available via the API. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      responses:
        '200':
          description: The account's channel integrations (null if none connected)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicChannelIntegrations'
  /public/v1/channels/whatsapp/templates:
    get:
      summary: List approved WhatsApp templates
      operationId: listChannelWhatsappTemplates
      description: >-
        Read-only list of APPROVED WhatsApp message templates from Meta for this
        account's WhatsApp Business channel. Use template.name in
        SEND_WHATSAPP_MESSAGE nodes and map parameters into templateVariables.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Channels
      responses:
        '200':
          description: Approved WhatsApp templates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicWhatsAppTemplatesOutput'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: WhatsApp channel not configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/integrations/trigger-types:
    get:
      summary: List integration trigger types
      operationId: listIntegrationTriggerTypes
      description: >-
        Catalog of the third-party events that can start an automation. Use
        `slug` as data.triggerSlug and `toolkit` as data.triggerToolkit on a
        TRIGGER node with triggerType COMPOSIO_TRIGGER. `configFields` describes
        the triggerConfig each event accepts: `required` fields must be sent,
        fields with `userConfigurable: false` are managed by the platform and
        ignored, and a non-null `resourceType` means GET
        /public/v1/integrations/trigger-resources lists the valid values. The
        catalog is static, so an Account or User API key both work.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Integrations
      parameters:
        - schema:
            type: string
            enum:
              - GMAIL
              - GOOGLECALENDAR
              - SLACK
              - CALENDLY
              - GOOGLEDOCS
              - GOOGLESHEETS
              - NOTION
              - GOOGLEDRIVE
              - GRANOLA_MCP
              - GOOGLEMEET
              - ZOOM
              - GAMMA
              - STRIPE
              - POSTHOG
              - LINKEDIN
              - FACEBOOK
              - GOOGLE_ANALYTICS
              - GOOGLE_SEARCH_CONSOLE
              - MAILCHIMP
              - SEMRUSH
              - GOOGLEADS
              - INSTAGRAM
              - ADYNTEL
              - GOOGLETASKS
              - LINEAR
              - JIRA
              - ASANA
              - SHARE_POINT
              - ONE_DRIVE
              - EXCEL
              - TIKTOK
              - TWITTER
              - YOUTUBE
              - GOOGLE_MAPS
              - METAADS
              - SHOPIFY
              - AIRTABLE
              - MONDAY
              - TRELLO
              - GOOGLESLIDES
              - BUILTWITH
              - HUBSPOT
              - PIPEDRIVE
              - ATTIO
              - ZENDESK
              - SALESFORCE
              - SALESFORCE_SERVICE_CLOUD
              - INTERCOM
              - WEBFLOW
              - FIGMA
              - APOLLO
              - OUTLOOK
              - FRESHDESK
              - ZOHO_DESK
              - ZOHO_INVOICE
              - ZOHO
              - BREX
            example: GMAIL
          required: false
          name: toolkit
          in: query
      responses:
        '200':
          description: Supported integration trigger types
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTriggerTypesListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/integrations/trigger-resources:
    get:
      summary: List values for a trigger config field
      operationId: listIntegrationTriggerResources
      description: >-
        Resolves the ids a triggerConfig needs (Drive folders, Sheets
        spreadsheets and tabs, Asana workspaces and projects, Salesforce
        sobjects and fields, Gmail labels, Outlook folders and calendars,
        OneDrive folders). Take `resourceType` from a trigger type's
        configFields, and send each result's `id` as the value of that config
        field. `parent` is required when browsing inside another resource:
        spreadsheetId for googlesheets_sheets, workspaceGid for asana_projects,
        sobjectName for salesforce_sobject_fields, and an optional folder path
        for onedrive_folders. The connected account must belong to your account
        and match the resource's toolkit. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Integrations
      parameters:
        - schema:
            type: string
            enum:
              - gmail_labels
              - googlesheets_spreadsheets
              - googlesheets_sheets
              - googledocs_documents
              - googledrive_folders
              - googledrive_shared_drives
              - onedrive_folders
              - asana_workspaces
              - asana_projects
              - salesforce_sobjects
              - salesforce_sobject_fields
              - outlook_folders
              - outlook_calendars
            example: gmail_labels
          required: true
          name: resourceType
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 1
          required: true
          name: connectedAccountId
          in: query
        - schema:
            type: string
            minLength: 1
            example: example
          required: false
          name: parent
          in: query
        - schema:
            type: string
            minLength: 1
            example: example
          required: false
          name: query
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            example: 1
          required: false
          name: limit
          in: query
      responses:
        '200':
          description: Values available for the requested resource type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTriggerResourcesListResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Connected account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/me:
    get:
      summary: Get current identity
      operationId: getMe
      description: >-
        Returns the account and (for USER keys) user attached to the API key.
        Use this to validate a key and inspect the calling identity.
      security:
        - bearerAuth: []
      tags:
        - Account
      responses:
        '200':
          description: Identity attached to the API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Me'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/incoming-webhooks:
    get:
      summary: List incoming webhooks
      operationId: listIncomingWebhooks
      description: >-
        Lists incoming webhooks for the authenticated account. Filter by search
        text and active status. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: CRM
          required: false
          name: search
          in: query
        - schema:
            type: boolean
            example: true
          required: false
          name: isActive
          in: query
      responses:
        '200':
          description: Paginated incoming webhooks
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/IncomingWebhookCreateOutput'
                  count:
                    type: number
                    example: 1
                  pageSize:
                    type: number
                    example: 20
                required:
                  - results
                  - count
                  - pageSize
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create an incoming webhook
      operationId: createIncomingWebhook
      description: >-
        Creates an incoming webhook for the authenticated account. Requires a
        USER API key and returns the access token needed to call the webhook.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIncomingWebhookCreateInput'
      responses:
        '201':
          description: Created incoming webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncomingWebhookCreateOutput'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/incoming-webhooks/{webhookId}:
    get:
      summary: Get incoming webhook details
      operationId: getIncomingWebhook
      description: Returns an incoming webhook by ID. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: clx123incomingwebhook
          required: true
          name: webhookId
          in: path
      responses:
        '200':
          description: Incoming webhook details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIncomingWebhook'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update incoming webhook
      operationId: updateIncomingWebhook
      description: >-
        Updates an incoming webhook's name, description, active state, or
        authentication toggle. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: clx123incomingwebhook
          required: true
          name: webhookId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIncomingWebhookUpdateInput'
      responses:
        '200':
          description: Updated incoming webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIncomingWebhook'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete incoming webhook
      operationId: deleteIncomingWebhook
      description: Deletes an incoming webhook. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: clx123incomingwebhook
          required: true
          name: webhookId
          in: path
      responses:
        '204':
          description: Incoming webhook deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/incoming-webhooks/{webhookId}/regenerate-access-token:
    post:
      summary: Regenerate incoming webhook access token
      operationId: regenerateIncomingWebhookAccessToken
      description: >-
        Generates a new bearer access token for the webhook, invalidating the
        previous one. The new token is returned in the response. Requires a USER
        API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: clx123incomingwebhook
          required: true
          name: webhookId
          in: path
      responses:
        '200':
          description: Incoming webhook with the regenerated access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIncomingWebhook'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/incoming-webhooks/{webhookId}/events:
    get:
      summary: List incoming webhook events
      operationId: listIncomingWebhookEvents
      description: >-
        Lists received events (deliveries) for an incoming webhook. Filter by
        date range, status, and search. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: clx123incomingwebhook
          required: true
          name: webhookId
          in: path
        - schema:
            type: string
            nullable: true
            example: example
          required: false
          name: startDate
          in: query
        - schema:
            type: string
            nullable: true
            example: example
          required: false
          name: endDate
          in: query
        - schema:
            type: string
            example: example
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - RECEIVED
              - PROCESSING
              - COMPLETED
              - FAILED
              - TIMEOUT
            example: RECEIVED
          required: false
          name: status
          in: query
      responses:
        '200':
          description: Paginated incoming webhook events
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIncomingWebhookEventList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/incoming-webhooks/{webhookId}/events/{eventId}:
    get:
      summary: Get incoming webhook event details
      operationId: getIncomingWebhookEvent
      description: >-
        Returns a single webhook event, including the automations it triggered.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Incoming Webhooks
      parameters:
        - schema:
            type: string
            example: clx123incomingwebhook
          required: true
          name: webhookId
          in: path
        - schema:
            type: string
            example: clx987event
          required: true
          name: eventId
          in: path
      responses:
        '200':
          description: Incoming webhook event details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIncomingWebhookEventDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/ai-models:
    get:
      summary: List AI models
      operationId: listAiModels
      description: >-
        Returns available AI models. Use these IDs when configuring an agent
        setting.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - AI Models
      parameters:
        - schema:
            type: string
            enum:
              - TEXT
              - TRANSCRIPTION
              - FILE_ANALYSIS
            example: TEXT
          required: false
          name: type
          in: query
      responses:
        '200':
          description: A list of AI models
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/AiModel'
                required:
                  - results
                description: Standard list response
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/ai-models/default:
    get:
      summary: Get default AI model
      operationId: getDefaultAiModel
      description: Returns the default AI model for the requested model type.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - AI Models
      parameters:
        - schema:
            type: string
            enum:
              - TEXT
              - TRANSCRIPTION
              - FILE_ANALYSIS
            example: TEXT
          required: false
          name: type
          in: query
      responses:
        '200':
          description: Default AI model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModel'
        '404':
          description: Default AI model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/ai-models/{aiModelId}:
    get:
      summary: Get AI model
      operationId: getAiModel
      description: Returns one AI model by ID.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - AI Models
      parameters:
        - schema:
            type: number
            nullable: true
            example: 1
          required: false
          name: aiModelId
          in: path
      responses:
        '200':
          description: AI model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiModel'
        '404':
          description: AI model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tools:
    get:
      summary: List custom tools
      operationId: listTools
      description: >-
        Returns the account's custom tools (API call tools created by the
        account). WhatsApp template tools are not exposed in this public
        surface.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Custom Tools
      parameters:
        - schema:
            type: string
            example: contact
          required: false
          name: filterText
          in: query
        - schema:
            type: string
            enum:
              - ACTIVE
              - PAUSED
            example: ACTIVE
          required: false
          name: status
          in: query
      responses:
        '200':
          description: A list of tools
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/CustomTool'
                required:
                  - results
                description: Standard list response
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create a custom tool
      operationId: createTool
      description: >-
        Creates a custom tool (an API call tool). Requires a USER API key.
        WhatsApp template tools are not supported in the public API.
      security:
        - userApiKey: []
      tags:
        - Custom Tools
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicToolCreateInput'
      responses:
        '201':
          description: Created tool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomTool'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/variables:
    get:
      summary: List agent variables
      operationId: listAgentVariables
      description: Lists variables for an agent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            example: customer
          required: false
          name: filterText
          in: query
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
            example: false
          required: false
          name: isDefault
          in: query
      responses:
        '200':
          description: Paginated variables
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: number
                    example: 1
                  pageSize:
                    type: number
                    example: 1
                  pageNum:
                    type: number
                    example: 1
                  totalPages:
                    type: number
                    example: 1
                  cursor:
                    type: number
                    example: 1
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Variable'
                  paginationType:
                    type: string
                    enum:
                      - offset
                      - cursor
                    default: offset
                    example: offset
                  nextCursor:
                    anyOf:
                      - type: string
                        example: example
                      - type: number
                        example: 1
                      - nullable: true
                        type: object
                required:
                  - pageSize
                  - results
    post:
      summary: Create agent variable
      operationId: createAgentVariable
      description: Creates a variable for an agent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowVariableCreateInput'
      responses:
        '201':
          description: Created variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
  /public/v1/agents/{agentId}/variables/all:
    get:
      summary: List all agent variables
      operationId: listAllAgentVariables
      description: Lists all agent variables including defaults. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Variables
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Variable'
  /public/v1/agents/{agentId}/variables/check-name:
    get:
      summary: Check agent variable name
      operationId: checkAgentVariableName
      description: >-
        Checks whether a variable name exists for an agent. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            minLength: 1
            example: customer_name
          required: true
          name: name
          in: query
      responses:
        '200':
          description: Name existence
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableCheckName'
  /public/v1/agents/{agentId}/variables/{variableId}:
    get:
      summary: Get agent variable
      operationId: getAgentVariable
      description: Manages a single agent variable. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: variableId
          in: path
      responses:
        '200':
          description: Variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
    put:
      summary: Update agent variable
      operationId: updateAgentVariable
      description: Manages a single agent variable. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: variableId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicVariableUpdateInput'
      responses:
        '200':
          description: Variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
    delete:
      summary: Delete agent variable
      operationId: deleteAgentVariable
      description: Manages a single agent variable. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Flow Variables
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: variableId
          in: path
      responses:
        '204':
          description: Variable deleted
  /public/v1/workflows/{workflowId}/variables:
    get:
      summary: List workflow variables
      operationId: listWorkflowVariables
      description: Lists variables for an automation workflow. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: string
            example: customer
          required: false
          name: filterText
          in: query
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
            example: false
          required: false
          name: isDefault
          in: query
      responses:
        '200':
          description: Paginated variables
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: number
                    example: 1
                  pageSize:
                    type: number
                    example: 1
                  pageNum:
                    type: number
                    example: 1
                  totalPages:
                    type: number
                    example: 1
                  cursor:
                    type: number
                    example: 1
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Variable'
                  paginationType:
                    type: string
                    enum:
                      - offset
                      - cursor
                    default: offset
                    example: offset
                  nextCursor:
                    anyOf:
                      - type: string
                        example: example
                      - type: number
                        example: 1
                      - nullable: true
                        type: object
                required:
                  - pageSize
                  - results
    post:
      summary: Create workflow variable
      operationId: createWorkflowVariable
      description: Creates a variable for an automation workflow. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowVariableCreateInput'
      responses:
        '201':
          description: Created variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
  /public/v1/workflows/{workflowId}/variables/all:
    get:
      summary: List all workflow variables
      operationId: listAllWorkflowVariables
      description: >-
        Lists all workflow variables including defaults. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
      responses:
        '200':
          description: Variables
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Variable'
  /public/v1/workflows/{workflowId}/variables/check-name:
    get:
      summary: Check workflow variable name
      operationId: checkWorkflowVariableName
      description: >-
        Checks whether a variable name exists for a workflow. Requires a USER
        API key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: string
            minLength: 1
            example: customer_name
          required: true
          name: name
          in: query
      responses:
        '200':
          description: Name existence
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableCheckName'
  /public/v1/workflows/{workflowId}/variables/{variableId}:
    get:
      summary: Get workflow variable
      operationId: getWorkflowVariable
      description: Manages a single workflow variable. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: variableId
          in: path
      responses:
        '200':
          description: Variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
    put:
      summary: Update workflow variable
      operationId: updateWorkflowVariable
      description: Manages a single workflow variable. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: variableId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicVariableUpdateInput'
      responses:
        '200':
          description: Variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Variable'
    delete:
      summary: Delete workflow variable
      operationId: deleteWorkflowVariable
      description: Manages a single workflow variable. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflow Variables
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: variableId
          in: path
      responses:
        '204':
          description: Variable deleted
  /public/v1/agents/{agentId}/intents:
    get:
      summary: List intents
      operationId: listIntents
      description: Lists agent intents. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            example: cancel
          required: false
          name: filterText
          in: query
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
            default: false
            example: true
          required: false
          name: includeUsedStatus
          in: query
      responses:
        '200':
          description: Paginated intents
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: number
                    example: 1
                  pageSize:
                    type: number
                    example: 1
                  pageNum:
                    type: number
                    example: 1
                  totalPages:
                    type: number
                    example: 1
                  cursor:
                    type: number
                    example: 1
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Intent'
                  paginationType:
                    type: string
                    enum:
                      - offset
                      - cursor
                    default: offset
                    example: offset
                  nextCursor:
                    anyOf:
                      - type: string
                        example: example
                      - type: number
                        example: 1
                      - nullable: true
                        type: object
                required:
                  - pageSize
                  - results
    post:
      summary: Create intent
      operationId: createIntent
      description: Creates an agent intent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIntentCreateInput'
      responses:
        '201':
          description: Created intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Intent'
  /public/v1/agents/{agentId}/intents/all:
    get:
      summary: List all intents
      operationId: listAllIntents
      description: Lists all agent intents. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            example: cancel
          required: false
          name: filterText
          in: query
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
            default: false
            example: true
          required: false
          name: includeUsedStatus
          in: query
      responses:
        '200':
          description: Intents
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Intent'
  /public/v1/agents/{agentId}/intents/generate-phrases:
    post:
      summary: Generate intent phrases
      operationId: generateIntentPhrases
      description: Generates suggested phrases for an intent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIntentGeneratePhrasesInput'
      responses:
        '201':
          description: Generated phrases
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicIntentGeneratePhrasesOutput'
  /public/v1/agents/{agentId}/intents/{intentId}:
    get:
      summary: Get intent
      operationId: getIntent
      description: Manages a single intent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 10
          required: false
          name: intentId
          in: path
      responses:
        '200':
          description: Intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Intent'
    put:
      summary: Update intent
      operationId: updateIntent
      description: Manages a single intent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 10
          required: false
          name: intentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicIntentUpdateInput'
      responses:
        '200':
          description: Intent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Intent'
    delete:
      summary: Delete intent
      operationId: deleteIntent
      description: Manages a single intent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Intents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 10
          required: false
          name: intentId
          in: path
      responses:
        '204':
          description: Intent deleted
  /public/v1/tools/{toolId}:
    get:
      summary: Get custom tool details
      operationId: getTool
      description: Returns a custom tool (API call tool) by ID.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Custom Tools
      parameters:
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: toolId
          in: path
      responses:
        '200':
          description: Tool details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomTool'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update a custom tool
      operationId: updateTool
      description: >-
        Updates a custom tool (API call tool). Requires a USER API key. The tool
        type cannot be changed.
      security:
        - userApiKey: []
      tags:
        - Custom Tools
      parameters:
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: toolId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicToolUpdateInput'
      responses:
        '200':
          description: Updated tool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomTool'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete a custom tool
      operationId: deleteTool
      description: Soft deletes a custom tool (API call tool). Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Custom Tools
      parameters:
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: toolId
          in: path
      responses:
        '204':
          description: Tool deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tools/{toolId}/test:
    post:
      summary: Test a tool
      operationId: testTool
      description: >-
        Executes a persisted API call tool with the provided argument values and
        returns the HTTP response. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Custom Tools
      parameters:
        - schema:
            type: number
            nullable: true
            example: 123
          required: false
          name: toolId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicToolTestInput'
      responses:
        '200':
          description: Tool test result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicToolTestOutput'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents:
    get:
      summary: List all agents
      operationId: listAgents
      description: Returns a list of agents associated with the account.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            enum:
              - NONE
              - ACTIVE
              - INACTIVE
              - TRAINING
              - TRAIN_ERROR
            example: ACTIVE
          required: false
          name: status
          in: query
      responses:
        '200':
          description: A list of agents
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Agent'
                required:
                  - results
                description: Standard list response
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create an agent
      operationId: createAgent
      description: >-
        Creates an assistant with the internal defaults for theme, channels,
        settings, flow, and billing checks. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentCreateInput'
      responses:
        '201':
          description: Created agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDetail'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}:
    get:
      summary: Get agent details
      operationId: getAgent
      description: Returns a safe agent detail without secret key or HMAC fields.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Agent details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update an agent
      operationId: updateAgent
      description: Updates basic agent metadata. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentUpdateInput'
      responses:
        '200':
          description: Updated agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete an agent
      operationId: deleteAgent
      description: >-
        Soft deletes an agent using the assistant manager. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '204':
          description: Agent deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/agent-setting:
    get:
      summary: Get agent setting
      operationId: getAgentSetting
      description: >-
        Returns safe agent model, instruction, tool, playbook, and
        connected-account settings.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Agent setting
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSetting'
    put:
      summary: Update agent setting
      operationId: updateAgentSetting
      description: >-
        Updates instructions, model, tools, playbooks, connected accounts, and
        system tool settings. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentSettingUpdateInput'
      responses:
        '200':
          description: Updated agent setting
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSetting'
  /public/v1/agents/{agentId}/theme:
    get:
      summary: Get agent theme
      operationId: getAgentTheme
      description: >-
        Returns textual and color theme settings. Image uploads are not exposed
        in the public builder.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Agent theme
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentTheme'
    put:
      summary: Update agent theme
      operationId: updateAgentTheme
      description: Updates textual and color theme settings. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentThemeUpdateInput'
      responses:
        '200':
          description: Updated agent theme
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentThemeUpdateOutput'
  /public/v1/agents/{agentId}/deployment-status:
    put:
      summary: Update agent deployment status
      operationId: updateAgentDeploymentStatus
      description: >-
        Publishes or pauses an agent by changing isOffline. Requires a USER API
        key and runs billing checks.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentDeploymentStatusInput'
      responses:
        '200':
          description: Updated agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDetail'
  /public/v1/agents/{agentId}/settings:
    get:
      summary: Get all agent channel settings
      operationId: getAgentChannelSettings
      description: Returns livechat, WhatsApp, Instagram, and Messenger channel settings.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Channel settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentChannelSettings'
  /public/v1/agents/{agentId}/settings/livechat:
    get:
      summary: Get livechat settings
      operationId: getAgentlivechatSettings
      description: Returns livechat channel settings for an agent.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  closeAfter:
                    type: number
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  conversationClose:
                    type: string
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  collectFeedback:
                    type: boolean
                    example: false
                  feedbackVisibility:
                    type: string
                    enum:
                      - ON_HOVER
                      - ALWAYS_VISIBLE
                    example: ON_HOVER
                  feedbackText:
                    type: string
                    nullable: true
                    example: example
                  collectFeedbackReason:
                    type: boolean
                    example: false
                  includeOtherReason:
                    type: boolean
                    example: false
                  openFeedbackText:
                    type: string
                    nullable: true
                    example: example
                  feedbackReasons:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        reason:
                          type: string
                          example: example
                        order:
                          type: number
                          example: 1
                      required:
                        - id
                        - reason
                        - order
                  enableDocumentProcessing:
                    type: boolean
                    example: false
                  enableImageProcessing:
                    type: boolean
                    example: false
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - closeAfter
                  - timeUnit
                  - conversationClose
                  - collectFeedback
                  - feedbackVisibility
                  - feedbackText
                  - collectFeedbackReason
                  - includeOtherReason
                  - openFeedbackText
                  - enableIdle
    put:
      summary: Update livechat settings
      operationId: updateAgentlivechatSettings
      description: Updates livechat channel settings. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                splitMessages:
                  type: boolean
                  example: false
                splitCharacterLimit:
                  type: integer
                  example: 1
                conversationClose:
                  type: string
                  enum:
                    - NEVER
                    - AUTOMATICALLY
                    - DYNAMICALLY
                  example: NEVER
                closeAfter:
                  type: integer
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                collectFeedback:
                  type: boolean
                  example: false
                feedbackVisibility:
                  type: string
                  enum:
                    - ON_HOVER
                    - ALWAYS_VISIBLE
                  example: ON_HOVER
                feedbackText:
                  type: string
                  nullable: true
                  minLength: 1
                  maxLength: 45
                  example: example
                collectFeedbackReason:
                  type: boolean
                  example: false
                includeOtherReason:
                  type: boolean
                  example: false
                openFeedbackText:
                  type: string
                  nullable: true
                  maxLength: 45
                  example: example
                feedbackReasons:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: number
                        example: 1
                      reason:
                        type: string
                        minLength: 1
                        maxLength: 45
                        example: example
                      order:
                        type: integer
                        minimum: 0
                        example: 0
                    required:
                      - reason
                  maxItems: 5
                enableDocumentProcessing:
                  type: boolean
                  example: false
                enableImageProcessing:
                  type: boolean
                  example: false
                enableIdle:
                  type: boolean
                  example: false
                idleSettings:
                  type: object
                  nullable: true
                  properties:
                    after:
                      type: integer
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    resetsLimit:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - after
                    - timeUnit
                    - resetsLimit
              required:
                - splitMessages
                - splitCharacterLimit
                - conversationClose
                - closeAfter
                - timeUnit
                - collectFeedback
                - feedbackText
                - collectFeedbackReason
                - includeOtherReason
                - feedbackReasons
      responses:
        '200':
          description: Updated channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  conversationClose:
                    type: string
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  closeAfter:
                    type: number
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  collectFeedback:
                    type: boolean
                    example: false
                  feedbackVisibility:
                    type: string
                    enum:
                      - ON_HOVER
                      - ALWAYS_VISIBLE
                    example: ON_HOVER
                  feedbackText:
                    type: string
                    nullable: true
                    example: example
                  collectFeedbackReason:
                    type: boolean
                    example: false
                  includeOtherReason:
                    type: boolean
                    example: false
                  openFeedbackText:
                    type: string
                    nullable: true
                    example: example
                  feedbackReasons:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                          example: 1
                        reason:
                          type: string
                          example: example
                        order:
                          type: number
                          example: 1
                      required:
                        - id
                        - reason
                        - order
                  enableDocumentProcessing:
                    type: boolean
                    example: false
                  enableImageProcessing:
                    type: boolean
                    example: false
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - conversationClose
                  - closeAfter
                  - timeUnit
                  - collectFeedback
                  - feedbackVisibility
                  - feedbackText
                  - collectFeedbackReason
                  - includeOtherReason
                  - openFeedbackText
                  - enableIdle
  /public/v1/agents/{agentId}/settings/whatsapp:
    get:
      summary: Get whatsapp settings
      operationId: getAgentwhatsappSettings
      description: Returns whatsapp channel settings for an agent.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  closeAfter:
                    type: number
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  conversationClose:
                    type: string
                    nullable: true
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  enableDocumentProcessing:
                    type: boolean
                    example: false
                  enableImageProcessing:
                    type: boolean
                    example: false
                  debounce:
                    type: boolean
                    example: false
                  debounceTime:
                    type: integer
                    minimum: 0
                    example: 0
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                  conversationInterruptTimeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  sendCloseMessage:
                    type: boolean
                    example: false
                  closeMessageType:
                    type: string
                    enum:
                      - STATIC
                      - DYNAMIC
                    example: STATIC
                  closeMessage:
                    type: string
                    nullable: true
                    example: example
                  closeInstruction:
                    type: string
                    nullable: true
                    example: example
                  autoReplyOnUninterrupt:
                    type: boolean
                    example: false
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - enableIdle
                  - sendCloseMessage
                  - closeMessageType
    put:
      summary: Update whatsapp settings
      operationId: updateAgentwhatsappSettings
      description: Updates whatsapp channel settings. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                splitMessages:
                  type: boolean
                  example: false
                splitCharacterLimit:
                  type: integer
                  example: 1
                conversationClose:
                  type: string
                  enum:
                    - NEVER
                    - AUTOMATICALLY
                    - DYNAMICALLY
                  example: NEVER
                closeAfter:
                  type: integer
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                enableDocumentProcessing:
                  type: boolean
                  example: false
                enableImageProcessing:
                  type: boolean
                  example: false
                debounce:
                  type: boolean
                  example: false
                debounceTime:
                  type: integer
                  minimum: 0
                  example: 0
                enableIdle:
                  type: boolean
                  example: false
                idleSettings:
                  type: object
                  nullable: true
                  properties:
                    after:
                      type: integer
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    resetsLimit:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - after
                    - timeUnit
                    - resetsLimit
                conversationInterruptTimeout:
                  type: integer
                  minimum: 0
                  example: 0
                conversationInterruptTimeUnit:
                  type: string
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                sendCloseMessage:
                  type: boolean
                  example: false
                closeMessageType:
                  type: string
                  enum:
                    - STATIC
                    - DYNAMIC
                  example: STATIC
                closeMessage:
                  type: string
                  nullable: true
                  example: example
                closeInstruction:
                  type: string
                  nullable: true
                  example: example
                autoReplyOnUninterrupt:
                  type: boolean
                  example: false
              required:
                - splitMessages
                - splitCharacterLimit
                - conversationClose
                - closeAfter
                - timeUnit
      responses:
        '200':
          description: Updated channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  conversationClose:
                    type: string
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  closeAfter:
                    type: integer
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  enableDocumentProcessing:
                    type: boolean
                    example: false
                  enableImageProcessing:
                    type: boolean
                    example: false
                  debounce:
                    type: boolean
                    example: false
                  debounceTime:
                    type: integer
                    minimum: 0
                    example: 0
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                  conversationInterruptTimeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  sendCloseMessage:
                    type: boolean
                    example: false
                  closeMessageType:
                    type: string
                    enum:
                      - STATIC
                      - DYNAMIC
                    example: STATIC
                  closeMessage:
                    type: string
                    nullable: true
                    example: example
                  closeInstruction:
                    type: string
                    nullable: true
                    example: example
                  autoReplyOnUninterrupt:
                    type: boolean
                    example: false
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - conversationClose
                  - closeAfter
                  - timeUnit
                  - enableIdle
                  - sendCloseMessage
                  - closeMessageType
  /public/v1/agents/{agentId}/settings/instagram:
    get:
      summary: Get instagram settings
      operationId: getAgentinstagramSettings
      description: Returns instagram channel settings for an agent.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  closeAfter:
                    type: number
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  conversationClose:
                    type: string
                    nullable: true
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  enableImageProcessing:
                    type: boolean
                    example: false
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                  conversationInterruptTimeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  sendCloseMessage:
                    type: boolean
                    example: false
                  closeMessageType:
                    type: string
                    enum:
                      - STATIC
                      - DYNAMIC
                    example: STATIC
                  closeMessage:
                    type: string
                    nullable: true
                    example: example
                  closeInstruction:
                    type: string
                    nullable: true
                    example: example
                  autoReplyOnUninterrupt:
                    type: boolean
                    example: false
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - enableIdle
                  - sendCloseMessage
                  - closeMessageType
    put:
      summary: Update instagram settings
      operationId: updateAgentinstagramSettings
      description: Updates instagram channel settings. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                splitMessages:
                  type: boolean
                  example: false
                splitCharacterLimit:
                  type: integer
                  example: 1
                conversationClose:
                  type: string
                  enum:
                    - NEVER
                    - AUTOMATICALLY
                    - DYNAMICALLY
                  example: NEVER
                closeAfter:
                  type: integer
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                enableImageProcessing:
                  type: boolean
                  example: false
                enableIdle:
                  type: boolean
                  example: false
                idleSettings:
                  type: object
                  nullable: true
                  properties:
                    after:
                      type: integer
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    resetsLimit:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - after
                    - timeUnit
                    - resetsLimit
                conversationInterruptTimeout:
                  type: integer
                  minimum: 0
                  example: 0
                conversationInterruptTimeUnit:
                  type: string
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                sendCloseMessage:
                  type: boolean
                  example: false
                closeMessageType:
                  type: string
                  enum:
                    - STATIC
                    - DYNAMIC
                  example: STATIC
                closeMessage:
                  type: string
                  nullable: true
                  example: example
                closeInstruction:
                  type: string
                  nullable: true
                  example: example
                autoReplyOnUninterrupt:
                  type: boolean
                  example: false
              required:
                - splitMessages
                - splitCharacterLimit
                - conversationClose
                - closeAfter
                - timeUnit
      responses:
        '200':
          description: Updated channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  conversationClose:
                    type: string
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  closeAfter:
                    type: integer
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  enableImageProcessing:
                    type: boolean
                    example: false
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                  conversationInterruptTimeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  sendCloseMessage:
                    type: boolean
                    example: false
                  closeMessageType:
                    type: string
                    enum:
                      - STATIC
                      - DYNAMIC
                    example: STATIC
                  closeMessage:
                    type: string
                    nullable: true
                    example: example
                  closeInstruction:
                    type: string
                    nullable: true
                    example: example
                  autoReplyOnUninterrupt:
                    type: boolean
                    example: false
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - conversationClose
                  - closeAfter
                  - timeUnit
                  - enableIdle
                  - sendCloseMessage
                  - closeMessageType
  /public/v1/agents/{agentId}/settings/messenger:
    get:
      summary: Get messenger settings
      operationId: getAgentmessengerSettings
      description: Returns messenger channel settings for an agent.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  closeAfter:
                    type: number
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  conversationClose:
                    type: string
                    nullable: true
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  enableImageProcessing:
                    type: boolean
                    example: false
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                  conversationInterruptTimeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  autoReplyOnUninterrupt:
                    type: boolean
                    example: false
                  sendCloseMessage:
                    type: boolean
                    example: false
                  closeMessageType:
                    type: string
                    enum:
                      - STATIC
                      - DYNAMIC
                    example: STATIC
                  closeMessage:
                    type: string
                    nullable: true
                    example: example
                  closeInstruction:
                    type: string
                    nullable: true
                    example: example
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - enableIdle
                  - sendCloseMessage
                  - closeMessageType
    put:
      summary: Update messenger settings
      operationId: updateAgentmessengerSettings
      description: Updates messenger channel settings. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                splitMessages:
                  type: boolean
                  example: false
                splitCharacterLimit:
                  type: integer
                  example: 1
                conversationClose:
                  type: string
                  enum:
                    - NEVER
                    - AUTOMATICALLY
                    - DYNAMICALLY
                  example: NEVER
                closeAfter:
                  type: integer
                  nullable: true
                  example: 1
                timeUnit:
                  type: string
                  nullable: true
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                enableImageProcessing:
                  type: boolean
                  example: false
                enableIdle:
                  type: boolean
                  example: false
                idleSettings:
                  type: object
                  nullable: true
                  properties:
                    after:
                      type: integer
                      nullable: true
                      example: 1
                    timeUnit:
                      type: string
                      nullable: true
                      enum:
                        - MINUTES
                        - HOURS
                      example: MINUTES
                    resetsLimit:
                      type: integer
                      nullable: true
                      example: 1
                  required:
                    - after
                    - timeUnit
                    - resetsLimit
                conversationInterruptTimeout:
                  type: integer
                  minimum: 0
                  example: 0
                conversationInterruptTimeUnit:
                  type: string
                  enum:
                    - MINUTES
                    - HOURS
                  example: MINUTES
                sendCloseMessage:
                  type: boolean
                  example: false
                closeMessageType:
                  type: string
                  enum:
                    - STATIC
                    - DYNAMIC
                  example: STATIC
                closeMessage:
                  type: string
                  nullable: true
                  example: example
                closeInstruction:
                  type: string
                  nullable: true
                  example: example
                autoReplyOnUninterrupt:
                  type: boolean
                  example: false
              required:
                - splitMessages
                - splitCharacterLimit
                - conversationClose
                - closeAfter
                - timeUnit
      responses:
        '200':
          description: Updated channel settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  splitMessages:
                    type: boolean
                    example: false
                  splitCharacterLimit:
                    type: integer
                    example: 1
                  conversationClose:
                    type: string
                    enum:
                      - NEVER
                      - AUTOMATICALLY
                      - DYNAMICALLY
                    example: NEVER
                  closeAfter:
                    type: integer
                    nullable: true
                    example: 1
                  timeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  enableImageProcessing:
                    type: boolean
                    example: false
                  enableIdle:
                    type: boolean
                    example: false
                  idleSettings:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: number
                        nullable: true
                        example: 1
                      after:
                        type: number
                        nullable: true
                        example: 1
                      timeUnit:
                        type: string
                        nullable: true
                        enum:
                          - MINUTES
                          - HOURS
                        example: MINUTES
                      resetsLimit:
                        type: number
                        nullable: true
                        example: 1
                    required:
                      - after
                      - timeUnit
                      - resetsLimit
                  conversationInterruptTimeout:
                    type: integer
                    minimum: 0
                    example: 0
                  conversationInterruptTimeUnit:
                    type: string
                    nullable: true
                    enum:
                      - MINUTES
                      - HOURS
                    example: MINUTES
                  sendCloseMessage:
                    type: boolean
                    example: false
                  closeMessageType:
                    type: string
                    enum:
                      - STATIC
                      - DYNAMIC
                    example: STATIC
                  closeMessage:
                    type: string
                    nullable: true
                    example: example
                  closeInstruction:
                    type: string
                    nullable: true
                    example: example
                  autoReplyOnUninterrupt:
                    type: boolean
                    example: false
                required:
                  - splitMessages
                  - splitCharacterLimit
                  - conversationClose
                  - closeAfter
                  - timeUnit
                  - enableIdle
                  - sendCloseMessage
                  - closeMessageType
  /public/v1/agents/{agentId}/flows:
    get:
      summary: List flows for an agent
      operationId: listAgentFlows
      description: >-
        Returns a list of flows associated with a specific agent. Nodes and
        logic are excluded.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            enum:
              - ACTIVE
              - SUSPENDED
              - DELETED
              - DRAFT
            example: ACTIVE
          required: false
          name: status
          in: query
      responses:
        '200':
          description: A list of flows
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Flow'
                required:
                  - results
                description: Standard list response
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create a flow for an agent
      operationId: createAgentFlow
      description: Creates a flow and an empty graph snapshot for a specific agent.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowCreateInput'
      responses:
        '201':
          description: Created flow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowDetail'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/flows/{flowId}:
    get:
      summary: Get flow details
      operationId: getAgentFlow
      description: Returns flow metadata. Pass includeNodes=true to include graph nodes.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
          required: false
          name: includeNodes
          in: query
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
          required: false
          name: draft
          in: query
      responses:
        '200':
          description: Flow details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update a flow
      operationId: updateAgentFlow
      description: Updates flow metadata or status.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowUpdateInput'
      responses:
        '200':
          description: Updated flow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete a flow
      operationId: deleteAgentFlow
      description: Soft deletes a flow.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
      responses:
        '204':
          description: Flow deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/flows/{flowId}/graph:
    get:
      summary: Get flow graph
      operationId: getAgentFlowGraph
      description: Returns the flow snapshot with nodes and edges.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
      responses:
        '200':
          description: Flow graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowGraph'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/flows/{flowId}/nodes:
    post:
      summary: Create flow node
      operationId: createAgentFlowNode
      description: >-
        Creates a node in a flow graph. The server assigns `nodeId` and `alias`;
        use the 201 response when adding edges or updates.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowNodeCreateInput'
      responses:
        '201':
          description: Created node
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicFlowNodeCreated'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/flows/{flowId}/nodes/{nodeId}:
    put:
      summary: Update flow node
      operationId: updateAgentFlowNode
      description: Updates a flow node and returns the updated graph.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
        - schema:
            type: string
            example: start_1
          required: true
          name: nodeId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowNodeUpdateInput'
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowGraph'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete flow node
      operationId: deleteAgentFlowNode
      description: Deletes a node and removes incoming and outgoing edges.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
        - schema:
            type: string
            example: start_1
          required: true
          name: nodeId
          in: path
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowGraph'
  /public/v1/agents/{agentId}/flows/{flowId}/edges:
    post:
      summary: Create flow edge
      operationId: createAgentFlowEdge
      description: Adds or replaces an edge by handle in the flow graph.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowEdgeInput'
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowGraph'
        '409':
          description: Invalid graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete flow edge
      operationId: deleteAgentFlowEdge
      description: Removes an edge from the flow graph.
      security:
        - userApiKey: []
      tags:
        - Flows
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: flowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicFlowEdgeDeleteInput'
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowGraph'
  /public/v1/agents/{agentId}/analytics:
    get:
      summary: Get agent analytics
      operationId: getAgentAnalytics
      description: >-
        Returns credit usage, conversation counts, and conversations breakdown
        by channel for a specific agent.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Agent Builder
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            nullable: true
            example: '2024-01-01'
          required: false
          name: startDate
          in: query
        - schema:
            type: string
            nullable: true
            example: '2024-01-01'
          required: false
          name: endDate
          in: query
      responses:
        '200':
          description: Agent analytics data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentAnalytics'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/workflows:
    get:
      summary: List all workflows
      operationId: listWorkflows
      description: >-
        Returns a list of workflows associated with the account. Nodes and logic
        are excluded.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: string
            enum:
              - ACTIVE
              - DELETED
              - DRAFT
            example: ACTIVE
          required: false
          name: status
          in: query
      responses:
        '200':
          description: A list of workflows
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Workflow'
                required:
                  - results
                description: Standard list response
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create a workflow
      operationId: createWorkflow
      description: Creates an automation workflow and an empty graph snapshot.
      security:
        - userApiKey: []
      tags:
        - Workflows
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowCreateInput'
      responses:
        '201':
          description: Created workflow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetail'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/workflows/{workflowId}:
    get:
      summary: Get workflow details
      operationId: getWorkflow
      description: >-
        Returns a workflow automation. Pass includeNodes=true to include graph
        nodes.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
        - schema:
            anyOf:
              - type: boolean
                example: false
              - type: string
                example: example
          required: false
          name: includeNodes
          in: query
      responses:
        '200':
          description: Workflow details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update workflow
      operationId: updateWorkflow
      description: Updates workflow metadata or status.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowUpdateInput'
      responses:
        '200':
          description: Updated workflow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete workflow
      operationId: deleteWorkflow
      description: Soft deletes a workflow automation and cleans up trigger side effects.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      responses:
        '204':
          description: Workflow deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/workflows/{workflowId}/graph:
    get:
      summary: Get workflow graph
      operationId: getWorkflowGraph
      description: Returns the workflow snapshot with nodes and edges.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      responses:
        '200':
          description: Workflow graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraph'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/workflows/{workflowId}/run:
    post:
      summary: Run workflow
      operationId: runWorkflow
      description: >-
        Manually triggers a scheduled (SCHEDULED_TRIGGER) workflow automation by
        enqueueing an execution. Only available for ACTIVE scheduled workflows;
        event-triggered workflows run from their trigger.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      responses:
        '202':
          description: Workflow run enqueued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRunResult'
        '400':
          description: Workflow is not a scheduled workflow or is not ACTIVE
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/playbooks:
    get:
      summary: List agent playbooks
      operationId: listAgentPlaybooks
      description: >-
        Lists reusable agent playbooks (instruction sets) visible to the caller.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Playbooks
      parameters:
        - schema:
            type: boolean
            example: false
          required: false
          name: isActive
          in: query
        - schema:
            type: string
            example: example
          required: false
          name: filterText
          in: query
        - schema:
            type: string
            enum:
              - PRIVATE
              - ACCOUNT
            example: PRIVATE
          required: false
          name: visibility
          in: query
      responses:
        '200':
          description: Paginated playbooks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentPlaybookList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create agent playbook
      operationId: createAgentPlaybook
      description: Creates a reusable agent playbook. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Playbooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentPlaybookCreateInput'
      responses:
        '201':
          description: Created playbook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentPlaybook'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/playbooks/{playbookId}:
    get:
      summary: Get agent playbook details
      operationId: getAgentPlaybook
      description: Returns an agent playbook by ID. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Playbooks
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: playbookId
          in: path
      responses:
        '200':
          description: Playbook details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentPlaybook'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update agent playbook
      operationId: updateAgentPlaybook
      description: >-
        Updates an agent playbook. Only the creator (or an OWNER/ADMIN) can
        update it. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Playbooks
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: playbookId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentPlaybookUpdateInput'
      responses:
        '200':
          description: Updated playbook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentPlaybook'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete agent playbook
      operationId: deleteAgentPlaybook
      description: >-
        Deletes an agent playbook. Only the creator can delete it. Requires a
        USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Playbooks
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 42
          required: true
          name: playbookId
          in: path
      responses:
        '200':
          description: Playbook deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentPlaybookDeleteResult'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/playbooks:
    get:
      summary: List playbooks assigned to an agent
      operationId: listAssignedAgentPlaybooks
      description: Lists playbooks assigned to a specific agent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Playbooks
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: boolean
            example: false
          required: false
          name: isActive
          in: query
        - schema:
            type: string
            example: example
          required: false
          name: filterText
          in: query
        - schema:
            type: string
            enum:
              - PRIVATE
              - ACCOUNT
            example: PRIVATE
          required: false
          name: visibility
          in: query
      responses:
        '200':
          description: Paginated assigned playbooks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentPlaybookList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases:
    get:
      summary: List knowledge bases
      operationId: listKnowledgeBases
      description: >-
        Lists knowledge bases for the account. Filter by shared/private and
        search text. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            example: 'true'
          required: false
          name: isShared
          in: query
        - schema:
            type: string
            example: example
          required: false
          name: searchText
          in: query
      responses:
        '200':
          description: Paginated knowledge bases
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeBaseList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      summary: Create knowledge base
      operationId: createKnowledgeBase
      description: Creates a knowledge base. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeBaseCreateInput'
      responses:
        '201':
          description: Created knowledge base
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeBase'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}:
    get:
      summary: Get knowledge base details
      operationId: getKnowledgeBase
      description: Returns a knowledge base by ID. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      responses:
        '200':
          description: Knowledge base details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeBase'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update knowledge base
      operationId: updateKnowledgeBase
      description: Updates a knowledge base's name or description. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeBaseUpdateInput'
      responses:
        '200':
          description: Updated knowledge base
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeBase'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete knowledge base
      operationId: deleteKnowledgeBase
      description: >-
        Deletes a knowledge base and all of its sources. Default knowledge bases
        cannot be deleted. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      responses:
        '204':
          description: Knowledge base deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/search:
    post:
      summary: Search a knowledge base
      operationId: searchKnowledgeBase
      description: >-
        Semantic search over a knowledge base's indexed content. Returns
        matching chunks with similarity scores. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeSearchInput'
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeSearchResult'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/sources:
    get:
      summary: List knowledge base sources
      operationId: listKnowledgeSources
      description: >-
        Lists all sources (files, URLs, web pages) in a knowledge base. Requires
        a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
        - schema:
            type: string
            example: example
          required: false
          name: filterText
          in: query
        - schema:
            type: string
            enum:
              - NONE
              - PROCESSING
              - COMPLETED
              - FAILED
              - DELETING
              - DELETED
              - SYNCING
              - REJECTED
            example: NONE
          required: false
          name: status
          in: query
        - schema:
            type: string
            enum:
              - UNKNOWN
              - FILE
              - URL
              - ARTICLE
              - QNA
              - WEBPAGE
              - FOLDER
            example: UNKNOWN
          required: false
          name: sourceType
          in: query
        - schema:
            type: string
            example: example
          required: false
          name: fileTypes
          in: query
      responses:
        '200':
          description: Paginated sources
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeSourceList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Remove knowledge sources
      operationId: removeKnowledgeSources
      description: >-
        Removes the given sources from a knowledge base. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeSourceRemoveInput'
      responses:
        '204':
          description: Sources removed
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/sources/{sourceId}:
    get:
      summary: Get knowledge source details
      operationId: getKnowledgeSource
      description: Returns a single knowledge source by ID. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 340
          required: true
          name: sourceId
          in: path
      responses:
        '200':
          description: Source details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeSource'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/sources/urls:
    post:
      summary: Add URL sources
      operationId: addKnowledgeUrlSource
      description: >-
        Adds one or more URL sources to a knowledge base. The URLs are fetched
        and indexed asynchronously. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeUrlSourceInput'
      responses:
        '201':
          description: Created sources
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublicKnowledgeSource'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/website-crawls:
    post:
      summary: Add a website crawl source
      operationId: addKnowledgeWebsiteCrawl
      description: >-
        Starts a website crawl that discovers and indexes pages under the given
        URL. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeWebsiteCrawlInput'
      responses:
        '201':
          description: Created website crawl source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeWebsiteCrawl'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/sources/resync:
    post:
      summary: Resync knowledge sources
      operationId: resyncKnowledgeSources
      description: >-
        Re-fetches and re-indexes the given URL/web-page sources. Requires a
        USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeSourceResyncInput'
      responses:
        '200':
          description: Resync result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeSourceResyncResult'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/website-crawls/{websiteSourceId}/resync:
    post:
      summary: Resync a website crawl
      operationId: resyncKnowledgeWebsiteCrawl
      description: >-
        Re-crawls a website source, optionally overriding crawl configuration.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 88
          required: true
          name: websiteSourceId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeWebsiteResyncInput'
      responses:
        '204':
          description: Resync queued
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/knowledge-bases/{knowledgeBaseId}/website-crawls/{websiteSourceId}/sync-history:
    get:
      summary: Get website crawl sync history
      operationId: getKnowledgeWebsiteSyncHistory
      description: >-
        Lists sync summaries (crawl runs) for a website source. Requires a USER
        API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: knowledgeBaseId
          in: path
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 88
          required: true
          name: websiteSourceId
          in: path
        - schema:
            type: string
            enum:
              - INITIAL_SYNC
              - MANUAL_RESYNC
              - AUTO_RESYNC
            example: INITIAL_SYNC
          required: false
          name: syncType
          in: query
        - schema:
            type: string
            enum:
              - PROCESSING
              - SYNCING
              - COMPLETED
              - FAILED
              - DELETING
              - DELETED
            example: PROCESSING
          required: false
          name: status
          in: query
        - schema:
            type: number
            default: 20
            example: 1
          required: false
          name: pageSize
          in: query
        - schema:
            type: number
            default: 1
            example: 1
          required: false
          name: pageNum
          in: query
        - schema:
            anyOf:
              - type: number
                nullable: true
                example: 1
              - type: string
                example: example
              - nullable: true
                type: object
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: Paginated sync summaries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeSyncSummaryList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/knowledge-bases:
    get:
      summary: List knowledge bases assigned to an agent
      operationId: listAssignedKnowledgeBases
      description: >-
        Lists knowledge bases assigned to a specific agent. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: string
            example: asst_123
          required: true
          name: agentId
          in: path
      responses:
        '200':
          description: Assigned knowledge bases
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeBaseAssignmentList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Assign knowledge bases to an agent
      operationId: assignKnowledgeBases
      description: >-
        Sets the full list of shared knowledge bases assigned to an agent
        (replaces existing assignments). Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Knowledge Bases
      parameters:
        - schema:
            type: string
            example: asst_123
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicKnowledgeBaseAssignInput'
      responses:
        '200':
          description: Updated assignments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgeBaseAssignmentList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/workflows/{workflowId}/nodes:
    post:
      summary: Create workflow node
      operationId: createWorkflowNode
      description: >-
        Creates a node in an automation workflow graph. The server assigns
        `nodeId` and `alias`; use the 201 response when adding edges or updates.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowNodeCreateInput'
      responses:
        '201':
          description: Created node
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicWorkflowNodeCreated'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/workflows/{workflowId}/nodes/{nodeId}:
    put:
      summary: Update workflow node
      operationId: updateWorkflowNode
      description: Updates a node and returns the updated workflow graph.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
        - schema:
            type: string
            example: api_1
          required: true
          name: nodeId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowNodeUpdateInput'
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraph'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete workflow node
      operationId: deleteWorkflowNode
      description: Deletes a node and removes all incoming and outgoing edges.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
        - schema:
            type: string
            example: api_1
          required: true
          name: nodeId
          in: path
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraph'
  /public/v1/workflows/{workflowId}/edges:
    post:
      summary: Create workflow edge
      operationId: createWorkflowEdge
      description: Adds or replaces the outgoing edge for a node.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowEdgeInput'
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraph'
        '409':
          description: Invalid graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete workflow edge
      operationId: deleteWorkflowEdge
      description: Removes an edge from the workflow graph.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWorkflowEdgeDeleteInput'
      responses:
        '200':
          description: Updated graph
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraph'
  /public/v1/workflows/{workflowId}/analytics:
    get:
      summary: Get workflow analytics
      operationId: getWorkflowAnalytics
      description: >-
        Returns analytics for a specific workflow, including runs by date and
        summary.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: workflowId
          in: path
        - schema:
            type: string
            nullable: true
            example: '2024-01-01'
          required: false
          name: startDate
          in: query
        - schema:
            type: string
            nullable: true
            example: '2024-01-01'
          required: false
          name: endDate
          in: query
      responses:
        '200':
          description: Workflow analytics data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowAnalytics'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing:
    get:
      summary: Get billing plan details
      operationId: getBillingPlan
      description: >-
        Returns billing plan information including plan name, credits per month,
        credits used, and subscription renewal date.
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Billing
      responses:
        '200':
          description: Billing plan details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPlan'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing/usage:
    get:
      summary: Get Studio usage details
      operationId: getStudioUsage
      description: >-
        Returns Studio (account-level) usage: credits used vs limit, counts of
        agents, workflows, flows, users and knowledge bases, current plan,
        subscription details, and upcoming plan changes. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Billing
      responses:
        '200':
          description: Studio usage details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicStudioUsage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing/credits/history:
    get:
      summary: Get credit consumption history
      operationId: getCreditHistory
      description: >-
        Returns daily credit consumption broken down by AI model. Optionally
        filter with start_date and end_date (ISO dates).
      security:
        - accountApiKey: []
        - userApiKey: []
      tags:
        - Billing
      parameters:
        - schema:
            type: string
            nullable: true
            example: '2026-05-01'
          required: false
          name: start_date
          in: query
        - schema:
            type: string
            nullable: true
            example: '2026-05-31'
          required: false
          name: end_date
          in: query
      responses:
        '200':
          description: Credit history grouped by date and model
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicCreditHistory'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing/max/usage:
    get:
      summary: Get Max usage details
      operationId: getMaxUsage
      description: >-
        Returns Max plan details: plan name and features, subscription status
        and renewal, seat totals, feature limits (knowledge sources, playbooks,
        custom labels, tasks, WhatsApp), and upcoming plan changes. Requires a
        USER API key.
      security:
        - userApiKey: []
      tags:
        - Billing
      responses:
        '200':
          description: Max usage details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMaxUsage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing/max/seats:
    get:
      summary: List Max seat assignments
      operationId: getMaxSeats
      description: >-
        Returns total/available Max seat counts plus the users currently holding
        a seat and the users without one. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Billing
      responses:
        '200':
          description: Seat overview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMaxSeats'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing/max/seats/assign:
    post:
      summary: Assign a Max seat to a user
      operationId: assignMaxSeat
      description: >-
        Assigns a Max seat to the given user. Fails if no seats are available or
        the user already holds one. Requires a USER API key belonging to an
        OWNER or ADMIN.
      security:
        - userApiKey: []
      tags:
        - Billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicMaxSeatInput'
      responses:
        '200':
          description: Seat assigned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMaxSeatResult'
        '400':
          description: Bad Request (no Max profile / already has a seat)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found, or caller is not an OWNER/ADMIN of the account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/billing/max/seats/unassign:
    post:
      summary: Unassign a user's Max seat
      operationId: unassignMaxSeat
      description: >-
        Removes the Max seat from the given user, freeing it for someone else.
        Requires a USER API key belonging to an OWNER or ADMIN.
      security:
        - userApiKey: []
      tags:
        - Billing
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicMaxSeatInput'
      responses:
        '200':
          description: Seat unassigned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicMaxSeatResult'
        '400':
          description: Bad Request (user has no active seat)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found, or caller is not an OWNER/ADMIN of the account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/agents/{agentId}/messages:
    post:
      summary: Run an agent (send a message)
      operationId: runAgent
      description: >-
        Sends a message to an agent and returns its reply — the same way the
        in-app Overview/Playground tests an agent and its flow (runs over the
        OVERVIEW channel, against the active OR draft flow). Omit `message` on a
        new conversation to just open it and run the Start flow; pass
        `conversation_id` + `message` to continue. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicAgentMessageInput'
      responses:
        '201':
          description: The agent's reply messages and the conversation id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentRunOutput'
  /public/v1/agents/{agentId}/conversations/{conversationId}/close:
    post:
      summary: Close an agent conversation
      operationId: closeAgentConversation
      description: >-
        Closes a conversation (e.g. one started via the run endpoint). Requires
        a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: conversationId
          in: path
      responses:
        '200':
          description: The conversation was closed
  /public/v1/agents/{agentId}/conversations:
    get:
      summary: List agent conversations
      operationId: listAgentConversations
      description: >-
        Lists conversations for an agent, including the latest rolling summary
        and linked CRM contact. Supports full-text search (`search`), channel
        and feedback filters, and date ranges. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            example: 'true'
          required: false
          name: is_closed
          in: query
        - schema:
            type: string
            nullable: true
            example: '2026-01-01'
          required: false
          name: start_date
          in: query
        - schema:
            type: string
            nullable: true
            example: '2026-12-31'
          required: false
          name: end_date
          in: query
        - schema:
            type: string
            description: Full-text search over message content and conversation name.
            example: refund policy
          required: false
          name: search
          in: query
        - schema:
            type: string
            description: >-
              Comma-separated channels to filter by. Valid values: LIVE_CHAT,
              SHARED, OVERVIEW, API, WHATSAPP, INSTAGRAM, MESSENGER, SLACK,
              MAX_EXTENSION, MAX_WEB, MAX_API.
            example: WHATSAPP,API
          required: false
          name: channels
          in: query
        - schema:
            type: string
            enum:
              - POSITIVE
              - NEGATIVE
            description: >-
              Only conversations containing a message with this feedback rating.
              Valid values: POSITIVE, NEGATIVE.
            example: POSITIVE
          required: false
          name: feedback
          in: query
      responses:
        '200':
          description: A list of conversations
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/PublicConversation'
                required:
                  - results
                description: Standard list response
  /public/v1/agents/{agentId}/conversations/{conversationId}:
    get:
      summary: Get a conversation transcript
      operationId: getAgentConversation
      description: >-
        Returns a conversation with its message transcript, latest summary, and
        linked CRM contact. By default the transcript is clean (user-facing
        messages only); pass `include_events=true` for a debug view that adds
        non-message events (flow enter/exit, triggered intents, tool calls,
        errors) — each carrying `audit_log_id` for trace drill-down. Requires a
        USER API key.
      security:
        - userApiKey: []
      tags:
        - Agents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: conversationId
          in: path
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              When true, the transcript includes non-message events (flow
              enter/exit, triggered intents, tool calls, errors, etc.) alongside
              conversational messages. Each item carries `audit_log_id` for
              drill-down. Default false returns only user-facing messages.
            example: 'true'
          required: false
          name: include_events
          in: query
      responses:
        '200':
          description: The conversation transcript
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicConversationTranscript'
  /public/v1/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/trace:
    get:
      summary: Get a message's execution trace
      operationId: getAgentMessageTrace
      description: >-
        Returns the full LLM/tool execution trace (audit log) for a single
        message. Look up audit_log_id from the conversation transcript. Requires
        a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agents
      parameters:
        - schema:
            type: string
            example: uuid-xxxx-xxxx
          required: true
          name: agentId
          in: path
        - schema:
            type: number
            nullable: true
            example: 42
          required: false
          name: conversationId
          in: path
        - schema:
            type: number
            nullable: true
            example: 1001
          required: false
          name: messageId
          in: path
      responses:
        '200':
          description: The message execution trace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicExecutionTrace'
  /public/v1/workflows/{workflowId}/logs:
    get:
      summary: List workflow run logs
      operationId: listWorkflowLogs
      description: >-
        Lists the run history (executions) of a workflow. Requires a USER API
        key.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: string
            enum:
              - COMPLETED
              - PENDING
              - FAILED
            example: COMPLETED
          required: false
          name: status
          in: query
        - schema:
            type: string
            nullable: true
            example: '2026-01-01'
          required: false
          name: start_date
          in: query
        - schema:
            type: string
            nullable: true
            example: '2026-12-31'
          required: false
          name: end_date
          in: query
      responses:
        '200':
          description: A list of runs
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/PublicWorkflowLog'
                required:
                  - results
                description: Standard list response
  /public/v1/workflows/{workflowId}/logs/{logId}:
    get:
      summary: Get a workflow run log
      operationId: getWorkflowLog
      description: Returns one run with its per-node results. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: number
            nullable: true
            example: 9001
          required: false
          name: logId
          in: path
      responses:
        '200':
          description: The run log with node results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicWorkflowLogDetail'
  /public/v1/workflows/{workflowId}/logs/{logId}/nodes/{nodeResultId}/trace:
    get:
      summary: Get a node's execution trace
      operationId: getWorkflowNodeTrace
      description: >-
        Returns the full execution trace (audit log) for a single node within a
        run. Look up the node-result id and audit_log_id from the run log.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Workflows
      parameters:
        - schema:
            type: number
            nullable: true
            example: 501
          required: false
          name: workflowId
          in: path
        - schema:
            type: number
            nullable: true
            example: 9001
          required: false
          name: logId
          in: path
        - schema:
            type: number
            nullable: true
            example: 7001
          required: false
          name: nodeResultId
          in: path
      responses:
        '200':
          description: The node execution trace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicExecutionTrace'
  /public/v1/users:
    get:
      summary: List account users
      operationId: listUsers
      description: >-
        Lists the users in your account. Use to resolve user IDs for
        user-relation fields and task assignment. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Users
      responses:
        '200':
          description: A list of users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserList'
  /public/v1/tasks:
    get:
      summary: List user tasks
      operationId: listTasks
      description: >-
        Lists user tasks — the account 'To-dos' inbox. Filter by
        `assigned_to_me`, `completed`, `object_name` (tasks linked to an
        object), or `people_ids`/`team_ids`. Each task includes assignees and
        the linked object record (if any). Requires a USER API key. Distinct
        from object-row tasks (`/objects/{object}/rows/{rowId}/tasks`) and from
        Max tasks.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      parameters:
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Only tasks assigned to the calling user.
            example: 'true'
          required: false
          name: assigned_to_me
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Filter by completion state.
            example: 'false'
          required: false
          name: completed
          in: query
        - schema:
            type: string
            minLength: 1
            description: Only tasks linked to this object.
            example: companies
          required: false
          name: object_name
          in: query
        - schema:
            type: string
            description: CSV of People record IDs linked to the task.
            example: 12,15
          required: false
          name: people_ids
          in: query
        - schema:
            type: string
            description: CSV of team IDs the task is shared with.
            example: '3'
          required: false
          name: team_ids
          in: query
      responses:
        '200':
          description: A list of tasks
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/PublicUserTask'
                required:
                  - results
                description: Standard list response
    post:
      summary: Create a user task
      operationId: createTask
      description: >-
        Creates a user task (to-do). Optionally link it to an object record by
        passing `object_name` + `row_id` together. `assignee_ids` are user IDs
        (see GET /users). Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicUserTaskCreateInput'
      responses:
        '201':
          description: Created task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserTask'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tasks/{taskId}:
    get:
      summary: Get a user task
      operationId: getTask
      description: Returns a single user task by ID. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      parameters:
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: taskId
          in: path
      responses:
        '200':
          description: Task details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserTask'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    patch:
      summary: Update a user task
      operationId: updateTask
      description: >-
        Updates a task. Send only the fields to change. Pass `due_date: null` to
        clear the due date, or `object_name: null` + `row_id: null` to unlink
        the related object record. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      parameters:
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: taskId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicUserTaskUpdateInput'
      responses:
        '200':
          description: Updated task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserTask'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      summary: Delete a user task
      operationId: deleteTask
      description: Permanently deletes a user task. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      parameters:
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: taskId
          in: path
      responses:
        '200':
          description: Deletion result
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  id:
                    type: number
                    example: 1
                required:
                  - success
                  - id
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tasks/{taskId}/complete:
    post:
      summary: Complete a user task
      operationId: completeTask
      description: >-
        Marks a task as completed. Only a user assigned to the task can complete
        it. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      parameters:
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: taskId
          in: path
      responses:
        '200':
          description: Completed task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserTask'
        '400':
          description: Bad Request (not an assignee, or already completed)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /public/v1/tasks/{taskId}/uncomplete:
    post:
      summary: Uncomplete a user task
      operationId: uncompleteTask
      description: Clears the completed state of a task. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - User Tasks
      parameters:
        - schema:
            type: number
            nullable: true
            example: 101
          required: false
          name: taskId
          in: path
      responses:
        '200':
          description: Reopened task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUserTask'
  /public/v1/channels/whatsapp/numbers/{phoneNumberId}/business-info:
    get:
      summary: Get WhatsApp number business info
      operationId: getWhatsAppNumberBusinessInfo
      description: >-
        Returns the live WhatsApp Business profile (about, address, websites,
        category) for a connected number. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      parameters:
        - schema:
            type: string
            example: '109876543210123'
          required: true
          name: phoneNumberId
          in: path
      responses:
        '200':
          description: The WhatsApp business profile
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicWhatsAppBusinessInfo'
  /public/v1/channels/whatsapp/{integrationId}/numbers/{phoneNumberId}:
    put:
      summary: Update WhatsApp number (profile + agent)
      operationId: updateWhatsAppNumber
      description: >-
        Updates a WhatsApp number's business profile and/or binds it to an
        agent. Pass `agentId` to bind, null to unbind, or omit to leave the
        binding unchanged. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: integrationId
          in: path
        - schema:
            type: string
            example: '109876543210123'
          required: true
          name: phoneNumberId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicWhatsAppNumberUpdateInput'
      responses:
        '200':
          description: The updated WhatsApp number
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicWhatsAppNumber'
  /public/v1/channels/whatsapp/{integrationId}/numbers/{phoneNumberId}/register:
    post:
      summary: Register WhatsApp number
      operationId: registerWhatsAppNumber
      description: >-
        Registers a connected WhatsApp number with Meta (generates a PIN and
        completes registration). Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: integrationId
          in: path
        - schema:
            type: string
            example: '109876543210123'
          required: true
          name: phoneNumberId
          in: path
      responses:
        '204':
          description: Registered
  /public/v1/channels/whatsapp/{integrationId}/numbers/{phoneNumberId}/disconnect:
    post:
      summary: Disconnect WhatsApp number
      operationId: disconnectWhatsAppNumber
      description: >-
        Disconnects a single WhatsApp number from the integration. Requires a
        USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 12
          required: true
          name: integrationId
          in: path
        - schema:
            type: string
            example: '109876543210123'
          required: true
          name: phoneNumberId
          in: path
      responses:
        '204':
          description: Disconnected
  /public/v1/channels/instagram/accounts/{instagramAccountId}:
    put:
      summary: Assign Instagram account to agent
      operationId: assignInstagramAccount
      description: >-
        Binds (or, with null, unbinds) a connected Instagram account to an
        agent. Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 5
          required: true
          name: instagramAccountId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicChannelAssignInput'
      responses:
        '200':
          description: The updated Instagram account
  /public/v1/channels/messenger/pages/{messengerPageId}:
    put:
      summary: Assign Messenger page to agent
      operationId: assignMessengerPage
      description: >-
        Binds (or, with null, unbinds) a connected Messenger page to an agent.
        Requires a USER API key.
      security:
        - userApiKey: []
      tags:
        - Agent Channels
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            example: 7
          required: true
          name: messengerPageId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicChannelAssignInput'
      responses:
        '200':
          description: The updated Messenger page
