openapi: 3.1.0
info:
  title: Funkel AI API
  version: 2026-09-19
  description: >-
    Manage products, discovery agents, leads, campaigns, and your inbox from your own code.


    ## Authentication


    Create a personal access token in the Funkel AI app under **Settings → Security**. Send it in the `Authorization`
    header of every request. MCP OAuth tokens work only with the MCP server. See [Authentication](/doc/authentication).


    ```bash

    curl https://api.funkel.ai/api/apps \
      -H "Authorization: Bearer YOUR_API_TOKEN"
    ```


    ## Before you write


    Write operations can create records, use credits, or send messages from your connected accounts. Plan limits,
    workspace permissions, and credit balances apply to every request. See [Usage and limits](/doc/usage-and-limits).


    Manage payments and subscriptions in the Funkel AI app.
servers:
  - url: https://api.funkel.ai
tags:
  - name: Products
  - name: Discovery agents
  - name: Discovered leads
  - name: Lead lists
  - name: Contacts
  - name: Campaigns
  - name: Message review
  - name: Inbox
  - name: Analytics
  - name: Account usage
  - name: API tokens
  - name: Outbound webhooks
paths:
  /api/agents/{agentId}:
    delete:
      description: Delete a discovery agent.
      operationId: delete_api_agents_agentId
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
          description: OK
        "204":
          description: No content.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid agent ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Delete a discovery agent
      tags:
        - Discovery agents
    get:
      description: Get one discovery agent and its settings.
      operationId: get_api_agents_agentId
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid agent ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a discovery agent
      tags:
        - Discovery agents
    put:
      description: Update a discovery agent.
      operationId: put_api_agents_agentId
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                b2b:
                  anyOf:
                    - type: boolean
                    - type: "null"
                config:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                icp_description:
                  anyOf:
                    - type: string
                    - type: "null"
                icp_filters:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                list_id:
                  anyOf:
                    - type: string
                    - type: "null"
                max_signals:
                  anyOf:
                    - type: integer
                    - type: "null"
                name:
                  anyOf:
                    - type: string
                    - type: "null"
                require_current_employer:
                  anyOf:
                    - type: boolean
                    - type: "null"
                status:
                  anyOf:
                    - type: string
                    - type: "null"
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/Agent"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_icp_filters: 

            invalid_id: invalid agent ID

            invalid_linkedin_accounts: Select connected LinkedIn accounts from this workspace

            invalid_list_id: invalid list ID

            invalid_list_id: list must belong to the agent app

            invalid_transition: 

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_assigned: this app is not assigned to you

            subscription_required: Start your subscription to use this feature. Visit Settings → Billing to continue.
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: agent not found

            not_found: agent not found or update failed
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Update a discovery agent
      tags:
        - Discovery agents
  /api/agents/{agentId}/discovery-funnel:
    get:
      description: Get discovery counts for an agent.
      operationId: get_api_agents_agentId_discovery_funnel
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDiscoveryFunnelResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid agent ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get discovery results
      tags:
        - Discovery agents
  /api/agents/{agentId}/signals:
    get:
      description: List the buying signals an agent watches and whether each one is on.
      operationId: get_api_agents_agentId_signals
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AgentSignal"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid agent ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List agent signals
      tags:
        - Discovery agents
    put:
      description: Turn buying signals on or off for an agent.
      operationId: put_api_agents_agentId_signals
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                signals:
                  items:
                    properties:
                      config:
                        description: JSON value stored by the server; shape depends on this resource's configuration.
                      description:
                        type: string
                      enabled:
                        type: boolean
                      estimated_matches:
                        type: integer
                      label:
                        type: string
                      platform:
                        type: string
                      signal_category:
                        type: string
                      signal_key:
                        type: string
                    type: object
                  type: array
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - items:
                      $ref: "#/components/schemas/AgentSignal"
                    type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_id: invalid agent ID

            invalid_signal: 

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Update agent signals
      tags:
        - Discovery agents
  /api/agents/{agentId}/sources:
    get:
      description: List the lead sources an agent uses and their settings.
      operationId: get_api_agents_agentId_sources
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AgentSourceResponse"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid agent ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List agent sources
      tags:
        - Discovery agents
  /api/agents/{agentId}/sources/{source}:
    put:
      description: Change the settings of one lead source for an agent.
      operationId: put_api_agents_agentId_sources_source
      parameters:
        - in: path
          name: agentId
          required: true
          schema:
            type: string
        - in: path
          name: source
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                auto_resolve_linkedin:
                  type: boolean
                enabled:
                  type: boolean
                queries:
                  items:
                    type: string
                  type: array
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/AgentSourceResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid agent ID

            invalid_user_id: invalid user ID

            invalid_body: invalid request body

            invalid_source: unknown source: only 'x' and 'hackernews' are supported

            no_queries: add at least one search before enabling the source

            too_many_queries: an agent can listen on at most 10 searches per source; remove some before adding more
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: agent not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Update an agent source
      tags:
        - Discovery agents
  /api/analytics/daily:
    get:
      description: Get outreach activity by day.
      operationId: get_api_analytics_daily
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/DailyActivityRow"
                type: array
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: "
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get daily activity
      tags:
        - Analytics
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/analytics/funnel:
    get:
      description: Get funnel conversion for a period.
      operationId: get_api_analytics_funnel
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FunnelAnalysisResponse"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: "
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get the outreach funnel
      tags:
        - Analytics
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/analytics/overview:
    get:
      description: Get outreach totals for a period.
      operationId: get_api_analytics_overview
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AnalyticsOverviewResponse"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: "
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get an analytics overview
      tags:
        - Analytics
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/analytics/steps:
    get:
      description: Get results for each campaign step.
      operationId: get_api_analytics_steps
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/StepStatsRow"
                type: array
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: "
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get step performance
      tags:
        - Analytics
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/apps:
    get:
      description: List the products in your workspace.
      operationId: get_api_apps
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AppResponse"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List products
      tags:
        - Products
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
    post:
      description: Create a product to run discovery agents and campaigns for.
      operationId: post_api_apps
      requestBody:
        content:
          application/json:
            schema:
              properties:
                description:
                  type: string
                icp_description:
                  type: string
                icp_filters:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                language:
                  type: string
                logo_url:
                  type: string
                name:
                  type: string
                product_brain:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                setup_product:
                  type: boolean
                url:
                  type: string
              type: object
              required:
                - name
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/App"
          description: OK
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/App"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_icp_filters: 

            invalid_language: unsupported outreach language

            invalid_product_brain: product_brain must be a JSON object

            invalid_user_id: invalid user ID

            missing_name: name is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "owner_only: only the workspace owner can create apps"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Create a product
      tags:
        - Products
      x-required-input-fields:
        - name
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/apps/analyze-url:
    post:
      description: Read a product website and return a suggested name, description, and ideal customer profile. Nothing is saved.
      operationId: post_api_apps_analyze_url
      requestBody:
        content:
          application/json:
            schema:
              properties:
                url:
                  type: string
              type: object
              required:
                - url
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/AppSuggestion"
                  - type: "null"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            missing_url: url is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Analyze a website
      tags:
        - Products
      x-required-input-fields:
        - url
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/apps/{appId}/agents:
    get:
      description: List the discovery agents for a product.
      operationId: get_api_apps_appId_agents
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AgentResponse"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List discovery agents
      tags:
        - Discovery agents
    post:
      description: Create a discovery agent that finds leads for a product.
      operationId: post_api_apps_appId_agents
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                config:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                max_signals:
                  anyOf:
                    - type: integer
                    - type: "null"
                name:
                  type: string
                type:
                  type: string
              type: object
              required:
                - name
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
          description: OK
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Agent"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_icp_filters: 

            invalid_id: invalid app ID

            invalid_linkedin_accounts: Select connected LinkedIn accounts from this workspace

            invalid_type: type must be 'signal' or 'lookalike'

            invalid_user_id: invalid user ID

            missing_name: name is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: app not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Create a discovery agent
      tags:
        - Discovery agents
      x-required-input-fields:
        - name
  /api/apps/{appId}/campaigns:
    get:
      description: List the campaigns for a product.
      operationId: get_api_apps_appId_campaigns
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CampaignWithStats"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List campaigns
      tags:
        - Campaigns
    post:
      description: Create a campaign for a product.
      operationId: post_api_apps_appId_campaigns
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                account_assignments:
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: "null"
                  type: object
                account_id:
                  type: string
                agent_id:
                  type: string
                clone_from_list:
                  type: boolean
                cold_outreach_mode:
                  type: string
                creation_idempotency_key:
                  type: string
                list_id:
                  type: string
                message_review_mode:
                  type: string
                name:
                  type: string
                settings:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                workflow_steps:
                  items:
                    properties:
                      delay_unit:
                        type: string
                      delay_value:
                        type: integer
                      is_final:
                        type: boolean
                      message_mode:
                        type: string
                      message_template:
                        type: string
                      step_type:
                        type: string
                      subject_template:
                        type: string
                    type: object
                  type: array
              type: object
              required:
                - name
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/CreateCampaignResponse"
          description: OK
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateCampaignResponse"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            account_mismatch: account_id must match the primary sender assignment

            account_not_connected: 

            account_not_connected: x sender must have valid OAuth tokens

            agent_app_mismatch: agent does not belong to the selected app

            contact_route_mismatch: list contact route does not match cold_outreach_mode

            invalid_account_id: 

            invalid_account_id: invalid account ID

            invalid_agent_id: invalid agent ID

            invalid_body: invalid request body

            invalid_cold_outreach_mode: cold_outreach_mode must be 'invite', 'inmail', or 'email'

            invalid_creation_idempotency_key: 

            invalid_id: invalid app ID

            invalid_list_id: invalid list ID

            invalid_mode: invalid message review mode

            invalid_platform: 

            invalid_settings: 

            invalid_user_id: invalid user ID

            invalid_workflow_steps: 

            list_app_mismatch: list does not belong to the selected app

            missing_list_id: list_id is required when clone_from_list is true

            missing_name: name is required

            platform_mismatch: 
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: 

            not_found: agent not found

            not_found: app not found

            not_found: list not found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "idempotency_key_reused: creation_idempotency_key was already used for different campaign intent"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "missing_sender_channels: "
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Create a campaign
      tags:
        - Campaigns
      x-required-input-fields:
        - name
  /api/apps/{appId}/lists:
    get:
      description: List the lead lists for one product.
      operationId: get_api_apps_appId_lists
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/LeadListWithReviewState"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List lead lists for a product
      tags:
        - Lead lists
    post:
      description: Create an empty lead list for a product.
      operationId: post_api_apps_appId_lists
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                description:
                  type: string
                name:
                  type: string
              type: object
              required:
                - name
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
          description: OK
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LeadList"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_id: invalid app ID

            invalid_list: list name or description is invalid

            invalid_user_id: invalid user ID

            missing_name: name is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: app not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Create a lead list
      tags:
        - Lead lists
      x-required-input-fields:
        - name
  /api/apps/{appId}/lists/import-drafts/preview:
    post:
      description: Upload a CSV of people and get a preview of the mapped rows. Nothing is imported until you commit the preview.
      operationId: post_api_apps_appId_lists_import_drafts_preview
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                campaign_id:
                  type: string
                file:
                  format: binary
                  type: string
                list_id:
                  type: string
                name:
                  type: string
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/PeopleCSVResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_body: file too large

            invalid_body: file too large or invalid multipart form

            invalid_csv: 

            invalid_csv: CSV has no rows

            invalid_csv: duplicate CSV header

            invalid_csv: malformed CSV row

            invalid_csv: missing CSV header

            invalid_csv: missing linkedin_url or email

            invalid_csv: too many rows

            invalid_destination: provide exactly one of name or list_id and no campaign_id

            invalid_list_id: invalid list ID

            missing_file: file field is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: app not found

            not_found: list not found
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Preview a CSV import
      tags:
        - Lead lists
  /api/apps/{appId}/lists/import-drafts/{importId}:
    get:
      description: Get the state and rows of a CSV import preview.
      operationId: get_api_apps_appId_lists_import_drafts_importId
      parameters:
        - in: query
          name: offset
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: string
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - in: path
          name: importId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PeopleCSVResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_id: invalid import ID

            invalid_page: invalid limit

            invalid_page: invalid offset
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: import not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a CSV import preview
      tags:
        - Lead lists
  /api/apps/{appId}/lists/import-drafts/{importId}/commit:
    post:
      description: Import the previewed rows into a lead list.
      operationId: post_api_apps_appId_lists_import_drafts_importId_commit
      parameters:
        - in: path
          name: appId
          required: true
          schema:
            type: string
        - in: path
          name: importId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                campaign_id:
                  type: string
                selection_fingerprint:
                  type: string
              type: object
              required:
                - selection_fingerprint
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PeopleCSVResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_id: invalid import ID

            invalid_request: selection_fingerprint is required; campaign_id is not accepted
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: app not found

            not_found: import not found

            not_found: list not found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "stale_selection: selection fingerprint changed"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Commit a CSV import
      tags:
        - Lead lists
      x-required-input-fields:
        - selection_fingerprint
  /api/apps/{id}:
    get:
      description: Get one product, including its ideal customer profile.
      operationId: get_api_apps_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AppResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid app ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: app not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a product
      tags:
        - Products
    put:
      description: Update a product.
      operationId: put_api_apps_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                clear_logo_url:
                  type: boolean
                clear_url:
                  type: boolean
                description:
                  anyOf:
                    - type: string
                    - type: "null"
                icp_description:
                  anyOf:
                    - type: string
                    - type: "null"
                icp_filters:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                language:
                  anyOf:
                    - type: string
                    - type: "null"
                logo_url:
                  anyOf:
                    - type: string
                    - type: "null"
                name:
                  anyOf:
                    - type: string
                    - type: "null"
                product_brain:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                propagate_icp_to_agent_ids:
                  items:
                    type: string
                  type: array
                url:
                  anyOf:
                    - type: string
                    - type: "null"
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - anyOf:
                      - $ref: "#/components/schemas/Response"
                      - $ref: "#/components/schemas/App"
                  - $ref: "#/components/schemas/App"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_agent_selection: 

            invalid_agent_selection: icp_filters is required when updating selected agents

            invalid_agent_selection: selected agent ID is invalid

            invalid_body: invalid request body

            invalid_icp_filters: 

            invalid_id: invalid app ID

            invalid_language: unsupported outreach language

            invalid_product_brain: product_brain must be a JSON object

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: app not found

            not_found: app not found or update failed
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Update a product
      tags:
        - Products
  /api/apps/{id}/generate-icp:
    post:
      description: Generate an ideal customer profile for a product from its description.
      operationId: post_api_apps_id_generate_icp
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                description:
                  type: string
              type: object
              required:
                - description
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/ICPSuggestion"
                  - type: "null"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            missing_description: description is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Generate an ideal customer profile
      tags:
        - Products
      x-required-input-fields:
        - description
  /api/billing/catalog:
    get:
      description: Get credit pack options and your credit balance.
      operationId: get_api_billing_catalog
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreditCatalogResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "user_not_found: user not found"
      security:
        - bearerAuth: []
      summary: Get the credit catalog
      tags:
        - Account usage
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/billing/current-plan:
    get:
      description: Get the current plan, credit balances, capacity, usage, subscription state, and next billing date. Requires
        the workspace owner or the Manage Billing capability when acting for another workspace. Other members can use
        /api/me/entitlement. This read does not change the subscription. Use the Funkel AI app for payments and
        subscription changes.
      operationId: get_api_billing_current_plan
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CurrentPlanResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: >-
            billing_admin_required: this workspace's billing is owner/admin-only. Switch to your own workspace or ask
            the owner to grant you the Manage Billing capability.


            demo_external_read_blocked: external reads are unavailable in the Demo workspace
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "user_not_found: user not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Get the current plan
      tags:
        - Account usage
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/campaigns/{campaignId}/enroll-list-contacts:
    post:
      description: Enroll selected contacts from a lead list in a campaign. Returns an operation you can check for progress.
      operationId: post_api_campaigns_campaignId_enroll_list_contacts
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                member_ids:
                  items:
                    type: string
                  type: array
                operation_id:
                  type: string
              type: object
              required:
                - member_ids
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_operation_id: operation_id must be a UUID

            too_many_members: member_ids exceeds 500

            invalid_body: member_ids is required

            invalid_id: invalid campaign ID

            invalid_operation_id: operation_id must be a UUID

            invalid_user_id: invalid user ID

            too_many_members: member_ids exceeds 500
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "operation_conflict: operation_id has a different selection"
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "no_sender_account: This campaign has no sender account assigned yet. Assign one before importing leads
            directly into it."
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SelectedEnrollmentResult"
          description: ""
      security:
        - bearerAuth: []
      summary: Enroll list contacts
      tags:
        - Campaigns
      x-required-input-fields:
        - member_ids
  /api/campaigns/{campaignId}/enroll-list-contacts/operations/{operationId}:
    get:
      description: Get the progress and result of a list enrollment.
      operationId: get_api_campaigns_campaignId_enroll_list_contacts_operations_operationId
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - in: path
          name: operationId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SelectedEnrollmentResult"
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: receipt not found"
      security:
        - bearerAuth: []
      summary: Get an enrollment result
      tags:
        - Campaigns
  /api/campaigns/{campaignId}/leads:
    get:
      description: List the leads enrolled in a campaign and where each one is in the sequence.
      operationId: get_api_campaigns_campaignId_leads
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CampaignContactsResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List campaign leads
      tags:
        - Campaigns
    post:
      description: Enroll one lead in a campaign.
      operationId: post_api_campaigns_campaignId_leads
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                company:
                  type: string
                first_name:
                  type: string
                headline:
                  type: string
                last_name:
                  type: string
                metadata:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
                platform_account_id:
                  type: string
                profile_picture_url:
                  type: string
                profile_url:
                  type: string
                provider_id:
                  type: string
              type: object
              required:
                - provider_id
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Lead"
          description: OK
        "201":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Lead"
                  - type: "null"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            country_restricted: 

            invalid_body: invalid request body

            invalid_id: invalid campaign ID

            invalid_id: invalid platform_account_id

            invalid_user_id: invalid user ID

            missing_provider_id: provider_id is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "lead_owned_by_other_rep: "
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "ownership_check_failed: "
      security:
        - bearerAuth: []
      summary: Add a lead to a campaign
      tags:
        - Campaigns
      x-required-input-fields:
        - provider_id
  /api/campaigns/{campaignId}/leads/{leadId}:
    delete:
      description: Remove a lead from a campaign.
      operationId: delete_api_campaigns_campaignId_leads_leadId
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - in: path
          name: leadId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  cancelled_count:
                    type: integer
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_id: invalid lead ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Remove a lead from a campaign
      tags:
        - Campaigns
  /api/campaigns/{campaignId}/message-review:
    get:
      description: List AI-written messages waiting for review in a campaign.
      operationId: get_api_campaigns_campaignId_message_review
      parameters:
        - in: query
          name: page
          schema:
            type: string
        - in: query
          name: page_size
          schema:
            type: string
        - in: query
          name: step_id
          schema:
            type: string
        - in: query
          name: status
          schema:
            type: string
        - in: query
          name: channel
          schema:
            type: string
        - in: query
          name: q
          schema:
            type: string
        - in: query
          name: item_id
          schema:
            type: string
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  eligible_people:
                    type: integer
                  examples:
                    items:
                      additionalProperties:
                        description: Arbitrary JSON value.
                      type: object
                    type: array
                  items:
                    items:
                      additionalProperties:
                        description: Arbitrary JSON value.
                      type: object
                    type: array
                  mode:
                    type: string
                  page:
                    type: integer
                  page_size:
                    type: integer
                  revision:
                    type: integer
                  status_counts:
                    properties:
                      approved:
                        type: integer
                      changed:
                        type: integer
                      failed:
                        type: integer
                      needs_review:
                        type: integer
                      sent:
                        type: integer
                    type: object
                  step_total:
                    type: integer
                  total_items:
                    type: integer
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_campaign: invalid campaign ID

            invalid_channel: invalid review channel

            invalid_item: invalid review item ID

            invalid_page: page must be a positive number

            invalid_page_size: page_size must be between 1 and 50

            invalid_search: search must be 100 characters or fewer

            invalid_status: invalid review status

            invalid_step: invalid workflow step ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List messages to review
      tags:
        - Message review
  /api/campaigns/{campaignId}/message-review/drafts/generate:
    post:
      description: Generate or revise campaign messages for the selected records. The server reserves credits, settles
        completed generation, and releases unused credits. A repeated request key returns the existing operation; a
        different selection returns 409. A still-running operation returns 202. Inspect settled_credits,
        released_credits, and maximum_credits in the response.
      operationId: post_api_campaigns_campaignId_message_review_drafts_generate
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                idempotency_key:
                  type: string
                  minLength: 8
                  maxLength: 200
                  description: Reuse only for the same selection. Replays return the stored result. Use a new key after
                    generation_expired.
                revision_instruction:
                  type: string
                selected_ids:
                  items:
                    type: string
                  type: array
                  minItems: 1
                  maxItems: 8
                selection_fingerprint:
                  type: string
                step_id:
                  type: string
              type: object
              required:
                - idempotency_key
                - selection_fingerprint
                - selected_ids
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - properties:
                      maximum_credits:
                        type: integer
                      released_credits:
                        type: integer
                      replayed:
                        type: boolean
                      results:
                        description: JSON value stored by the server; shape depends on this resource's configuration.
                      settled_credits:
                        type: integer
                    type: object
                  - properties:
                      maximum_credits:
                        type: integer
                      released_credits:
                        type: integer
                      results:
                        items:
                          $ref: "#/components/schemas/ReviewGenerationResult"
                        type: array
                      settled_credits:
                        type: integer
                      wallet_balance:
                        type: integer
                    type: object
          description: OK
        "202":
          content:
            application/json:
              schema:
                properties:
                  retry_after_seconds:
                    type: integer
                  status:
                    type: string
                type: object
          description: Accepted
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_campaign: invalid campaign ID

            invalid_request: invalid request body

            invalid_request: select messages and provide a request key

            invalid_selection: select 3 or 4 contacts
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "insufficient_credits: not enough credits for selected messages"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "demo_no_effect: generation is unavailable in Demo workspace"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: campaign not found

            not_found: message selection not found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            generation_expired: generation expired; retry with a new request key

            request_key_reused: request key has a different selection

            stale_quote: get a new credit quote
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Generate messages
      tags:
        - Message review
      x-required-input-fields:
        - selected_ids
  /api/campaigns/{campaignId}/message-review/drafts/{itemID}/approve:
    post:
      description: Approve a reviewed message so it can be sent.
      operationId: post_api_campaigns_campaignId_message_review_drafts_itemID_approve
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - in: path
          name: itemID
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                body:
                  type: string
                context_fingerprint:
                  type: string
                expected_version_id:
                  type: string
                subject:
                  type: string
              type: object
              required:
                - context_fingerprint
        required: true
      responses:
        "204":
          description: No content.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_campaign: invalid campaign ID

            invalid_request: invalid request body

            invalid_message: message text is required

            invalid_approval: version and context are required

            invalid_item: invalid message ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_ready: message is not ready for approval

            stale_context: message context changed

            not_ready: assign a sender before approval

            not_ready: email subject and recipient are required

            not_ready: message is not ready for approval

            not_ready: message route changed

            stale_context: message context changed

            stale_version: message version changed
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Approve a message
      tags:
        - Message review
      x-required-input-fields:
        - context_fingerprint
  /api/campaigns/{campaignId}/message-review/drafts/{itemID}/edit:
    put:
      description: Change the text of a message before it is sent.
      operationId: put_api_campaigns_campaignId_message_review_drafts_itemID_edit
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - in: path
          name: itemID
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                body:
                  type: string
                expected_version_id:
                  type: string
                subject:
                  type: string
              type: object
              required:
                - body
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  context_fingerprint:
                    type: string
                  version:
                    type: integer
                  version_id:
                    format: uuid
                    type:
                      - string
                      - "null"
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_campaign: invalid campaign ID

            invalid_request: invalid request body

            invalid_item: invalid message ID

            invalid_message: message text is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            stale_context: message context changed

            stale_version: message version changed
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Edit a message
      tags:
        - Message review
      x-required-input-fields:
        - body
  /api/campaigns/{campaignId}/steps:
    get:
      description: List the workflow steps of a campaign in order.
      operationId: get_api_campaigns_campaignId_steps
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/WorkflowStep"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List campaign steps
      tags:
        - Campaigns
    post:
      description: Add a workflow step, such as an invitation, message, or wait, to a campaign.
      operationId: post_api_campaigns_campaignId_steps
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                delay_unit:
                  type: string
                delay_value:
                  type: integer
                message_template:
                  type: string
                step_type:
                  type: string
                subject_template:
                  type: string
              type: object
              required:
                - step_type
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
          description: OK
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WorkflowStep"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID

            invalid_user_id: invalid user ID

            invalid_user_id: invalid user ID

            invalid_body: invalid request body

            invalid_delay_unit: delay_unit must be hours or days

            invalid_delay_value: delay_value must be non-negative

            invalid_step_type: 

            invalid_step_type: step_type must be invite, message, follow_up, inmail, email, or follow

            missing_subject: manual email steps require a subject
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: >-
            channel_fallback_linkedin_invite_required: 


            channel_fallback_step_type_unsupported: Channel fallback supports only email and LinkedIn invitation or
            message steps.


            channel_fallback_track_empty: 


            invalid_channel_fallback_workflow: 


            channel_fallback_repair_required: The channel fallback configuration needs repair before this change.


            channel_fallback_repair_required: The channel fallback configuration needs repair before this change.
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Add a campaign step
      tags:
        - Campaigns
      x-required-input-fields:
        - step_type
  /api/campaigns/{campaignId}/steps/reorder:
    put:
      description: Change the order of a campaign's workflow steps.
      operationId: put_api_campaigns_campaignId_steps_reorder
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                step_ids:
                  items:
                    type: string
                  type: array
              type: object
              required:
                - step_ids
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - items:
                      $ref: "#/components/schemas/WorkflowStep"
                    type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID

            invalid_user_id: invalid user ID

            invalid_body: invalid request body

            invalid_id: 

            invalid_permutation: 

            invalid_permutation: step_ids must be an exact permutation of the campaign's active steps

            invalid_user_id: invalid user ID

            missing_step_ids: step_ids array is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: >-
            channel_fallback_linkedin_invite_required: 


            channel_fallback_step_type_unsupported: Channel fallback supports only email and LinkedIn invitation or
            message steps.


            channel_fallback_track_empty: 


            invalid_channel_fallback_workflow: 


            channel_fallback_cross_divider: Steps cannot move across the IF SILENT divider.


            channel_fallback_repair_required: The channel fallback configuration needs repair before this change.
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Reorder campaign steps
      tags:
        - Campaigns
      x-required-input-fields:
        - step_ids
  /api/campaigns/{campaignId}/steps/{stepId}:
    delete:
      description: Delete a workflow step. Pending sends for that step are cancelled.
      operationId: delete_api_campaigns_campaignId_steps_stepId
      parameters:
        - in: query
          name: expected_pending
          schema:
            type: string
        - in: query
          name: confirmed
          schema:
            type: string
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - in: path
          name: stepId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - anyOf:
                      - anyOf:
                          - $ref: "#/components/schemas/Response"
                          - properties:
                              already_deleted:
                                type: boolean
                              cancelled:
                                type: integer
                              executing_left:
                                type: integer
                              history_preserved:
                                type: integer
                              soft_deleted:
                                type: boolean
                            type: object
                      - properties:
                          error:
                            type: string
                          executing:
                            type: integer
                          history:
                            type: integer
                          message:
                            type: string
                          pending:
                            type: integer
                        type: object
                  - properties:
                      cancelled:
                        type: integer
                      executing_left:
                        type: integer
                      history_preserved:
                        type: integer
                      soft_deleted:
                        type: boolean
                    type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID

            invalid_user_id: invalid user ID

            invalid_id: invalid step ID

            invalid_params: confirmed must be 'true' when provided

            invalid_params: expected_pending and confirmed must both be provided or both omitted

            invalid_params: expected_pending must be a non-negative integer

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: campaign not found

            not_found: step not found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: >-
            channel_fallback_linkedin_invite_required: 


            channel_fallback_step_type_unsupported: Channel fallback supports only email and LinkedIn invitation or
            message steps.


            channel_fallback_track_empty: 


            invalid_channel_fallback_workflow: 


            channel_fallback_repair_required: The channel fallback configuration needs repair before this change.


            channel_fallback_track_empty: Each channel track must keep at least one step.


            required_step: the first invitation or follow step cannot be removed
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Delete a campaign step
      tags:
        - Campaigns
    put:
      description: Update a workflow step.
      operationId: put_api_campaigns_campaignId_steps_stepId
      parameters:
        - in: path
          name: campaignId
          required: true
          schema:
            type: string
        - in: path
          name: stepId
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                delay_unit:
                  anyOf:
                    - type: string
                    - type: "null"
                delay_value:
                  anyOf:
                    - type: integer
                    - type: "null"
                message_mode:
                  anyOf:
                    - type: string
                    - type: "null"
                message_review_mode:
                  type: string
                message_template:
                  anyOf:
                    - type: string
                    - type: "null"
                step_type:
                  anyOf:
                    - type: string
                    - type: "null"
                subject_template:
                  anyOf:
                    - type: string
                    - type: "null"
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/WorkflowStep"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID

            invalid_user_id: invalid user ID

            invalid_mode: 

            invalid_body: invalid request body

            invalid_delay_unit: delay_unit must be hours or days

            invalid_delay_value: delay_value must be non-negative

            invalid_id: invalid step ID

            invalid_message_mode: message_mode must be manual or ai_personalized

            invalid_step_type: 

            invalid_step_type: step_type must be invite, message, follow_up, inmail, email, or follow

            invalid_user_id: invalid user ID

            missing_subject: manual email steps require a subject
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: campaign not found

            not_found: step not found

            not_found: step not found or update failed
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: >-
            channel_fallback_linkedin_invite_required: 


            channel_fallback_step_type_unsupported: Channel fallback supports only email and LinkedIn invitation or
            message steps.


            channel_fallback_track_empty: 


            invalid_channel_fallback_workflow: 


            campaign_must_be_paused: 


            review_mode_already_chosen: 


            channel_fallback_cross_divider: Steps cannot move across the IF SILENT divider.


            channel_fallback_repair_required: The channel fallback configuration needs repair before this change.
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Update a campaign step
      tags:
        - Campaigns
  /api/campaigns/{id}:
    get:
      description: Get one campaign and its settings.
      operationId: get_api_campaigns_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CampaignWithAssignments"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
      security:
        - bearerAuth: []
      summary: Get a campaign
      tags:
        - Campaigns
    put:
      description: Update campaign settings.
      operationId: put_api_campaigns_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                account_assignments:
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: "null"
                  type: object
                agent_id:
                  anyOf:
                    - type: string
                    - type: "null"
                detach_agent:
                  anyOf:
                    - type: boolean
                    - type: "null"
                enroll_members:
                  anyOf:
                    - type: boolean
                    - type: "null"
                list_id:
                  anyOf:
                    - type: string
                    - type: "null"
                name:
                  anyOf:
                    - type: string
                    - type: "null"
                settings:
                  description: JSON value stored by the server; shape depends on this resource's configuration.
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - anyOf:
                      - $ref: "#/components/schemas/Response"
                      - $ref: "#/components/schemas/Campaign"
                  - $ref: "#/components/schemas/UpdateCampaignResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            agent_app_mismatch: agent does not belong to the campaign app

            contact_route_mismatch: list contact route does not match cold_outreach_mode

            invalid_account_id: 

            invalid_agent_id: invalid agent ID

            invalid_body: detach_agent cannot be combined with agent_id

            invalid_body: invalid request body

            invalid_id: invalid campaign ID

            invalid_list_id: invalid list ID

            invalid_platform: 

            invalid_settings: 

            invalid_user_id: invalid user ID

            list_app_mismatch: list does not belong to the campaign app

            missing_name: name cannot be empty

            no_list_to_enroll: campaign has no list to enroll from

            platform_mismatch: 
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: 

            not_found: agent not found

            not_found: campaign not found

            not_found: campaign not found or update failed

            not_found: list not found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            campaign_must_be_draft: Only a draft campaign can change its lead source.

            use_channel_fallback_endpoint: channel_fallback changes must use the channel fallback endpoint

            use_channel_fallback_endpoint: channel_fallback must be repaired through the channel fallback endpoint

            use_channel_fallback_endpoint: cold_outreach_mode must match the enabled channel fallback direction
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "no_sender_account: This campaign has no sender account assigned yet. Assign one before enrolling members."
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            workspace_policy_unavailable: workspace policy is unavailable

            enrollment_failed: Could not add the selected people. Try again.

            enrollment_failed: Could not confirm the selected people. Try again.

            update_failed: Could not update the campaign. Try again.
      security:
        - bearerAuth: []
      summary: Update a campaign
      tags:
        - Campaigns
  /api/campaigns/{id}/duplicate:
    post:
      description: Copy a campaign with its workflow steps.
      operationId: post_api_campaigns_id_duplicate
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Campaign"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Duplicate a campaign
      tags:
        - Campaigns
  /api/campaigns/{id}/stats:
    get:
      description: Get performance counts for a campaign.
      operationId: get_api_campaigns_id_stats
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/CampaignStatsResponse"
                  - type: "null"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid campaign ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get campaign stats
      tags:
        - Campaigns
  /api/campaigns/{id}/status:
    patch:
      description: Start or pause a campaign. Starting a campaign sends messages from your connected accounts.
      operationId: patch_api_campaigns_id_status
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                status:
                  type: string
              type: object
              required:
                - status
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Campaign"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_id: invalid campaign ID

            invalid_transition: 

            invalid_user_id: invalid user ID

            missing_status: status is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_assigned: this app is not assigned to you

            subscription_required: Start your subscription to use this feature. Visit Settings → Billing to continue.
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: campaign not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Start or pause a campaign
      tags:
        - Campaigns
      x-required-input-fields:
        - status
  /api/contacts:
    get:
      description: List contacts in your workspace with search and filters.
      operationId: get_api_contacts
      parameters:
        - in: query
          name: status
          schema:
            type: string
        - in: query
          name: search
          schema:
            type: string
        - in: query
          name: app_id
          schema:
            type: string
        - in: query
          name: campaign_id
          schema:
            type: string
        - in: query
          name: list_id
          schema:
            type: string
        - in: query
          name: pinned
          schema:
            type: string
        - in: query
          name: fit_status
          schema:
            type: string
        - in: query
          name: min_score
          schema:
            type: string
        - in: query
          name: max_score
          schema:
            type: string
        - in: query
          name: has_email
          schema:
            type: string
        - in: query
          name: sort_by
          schema:
            type: string
        - in: query
          name: sort_dir
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: string
        - in: query
          name: offset
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContactListResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_app_id: invalid app_id

            invalid_campaign_id: invalid campaign_id

            invalid_has_email: has_email must be true or false

            invalid_list_id: invalid list_id

            invalid_max_score: max_score must be an integer

            invalid_min_score: min_score must be an integer

            invalid_pinned: pinned must be true or false

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List contacts
      tags:
        - Contacts
  /api/contacts/export:
    get:
      description: Download contacts as CSV.
      operationId: get_api_contacts_export
      parameters:
        - in: query
          name: status
          schema:
            type: string
        - in: query
          name: app_id
          schema:
            type: string
        - in: query
          name: campaign_id
          schema:
            type: string
        - in: query
          name: pinned
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                contact_ids:
                  items:
                    type: string
                  type: array
              type: object
              required:
                - contact_ids
        required: true
      responses:
        "200":
          description: CSV export of the selected contacts.
          content:
            text/csv:
              schema:
                type: string
                format: binary
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_app_id: invalid app_id

            invalid_body: invalid request body

            invalid_campaign_id: invalid campaign_id

            invalid_id: 

            invalid_pinned: pinned must be true or false

            invalid_user_id: invalid user ID

            no_ids: contact_ids must be non-empty

            too_many: 
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Export contacts
      tags:
        - Contacts
      x-required-input-fields:
        - contact_ids
    post:
      description: Download selected contacts as CSV.
      operationId: post_api_contacts_export
      parameters:
        - in: query
          name: status
          schema:
            type: string
        - in: query
          name: app_id
          schema:
            type: string
        - in: query
          name: campaign_id
          schema:
            type: string
        - in: query
          name: pinned
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                contact_ids:
                  items:
                    type: string
                  type: array
              type: object
              required:
                - contact_ids
        required: true
      responses:
        "200":
          description: CSV export of the selected contacts.
          content:
            text/csv:
              schema:
                type: string
                format: binary
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_app_id: invalid app_id

            invalid_body: invalid request body

            invalid_campaign_id: invalid campaign_id

            invalid_id: 

            invalid_pinned: pinned must be true or false

            invalid_user_id: invalid user ID

            no_ids: contact_ids must be non-empty

            too_many: 
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Export selected contacts
      tags:
        - Contacts
      x-required-input-fields:
        - contact_ids
  /api/contacts/{id}:
    get:
      description: Get one contact.
      operationId: get_api_contacts_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContactDetailResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid contact ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: contact not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a contact
      tags:
        - Contacts
  /api/contacts/{id}/fit:
    patch:
      description: Mark whether a contact fits your ideal customer profile.
      operationId: patch_api_contacts_id_fit
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                fit_status:
                  type: string
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  fit_status:
                    type: string
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_id: invalid contact ID

            invalid_status: fit_status must be: fit, partial, unfit, or unreviewed

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: contact not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Set contact fit
      tags:
        - Contacts
  /api/discovered-leads:
    get:
      description: List leads found by your discovery agents.
      operationId: get_api_discovered_leads
      parameters:
        - in: query
          name: status
          schema:
            type: string
        - in: query
          name: search
          schema:
            type: string
        - in: query
          name: app_id
          schema:
            type: string
        - in: query
          name: campaign_id
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: string
        - in: query
          name: offset
          schema:
            type: string
        - in: query
          name: fit
          schema:
            type: string
        - in: query
          name: signal
          schema:
            type: string
        - in: query
          name: sort
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DiscoveredLeadListResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_fit: invalid fit

            invalid_signal: invalid signal

            invalid_app_id: invalid app_id

            invalid_campaign_id: invalid campaign_id

            invalid_sort: invalid sort

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List discovered leads
      tags:
        - Discovered leads
  /api/discovered-leads/batch-approve:
    post:
      description: Approve several discovered leads in one request.
      operationId: post_api_discovered_leads_batch_approve
      requestBody:
        content:
          application/json:
            schema:
              properties:
                campaign_id:
                  type: string
                ids:
                  items:
                    type: string
                  type: array
              type: object
              required:
                - campaign_id
                - ids
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - properties:
                      approved:
                        type: integer
                    type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_campaign_id: invalid campaign ID

            invalid_user_id: invalid user ID

            missing_campaign_id: campaign_id is required

            missing_ids: ids array is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: campaign not found

            not_found: no discovered leads found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            lead_excluded: 

            linkedin_identity_unavailable: a verified LinkedIn profile URL is required for this sender
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            workspace_policy_unavailable: workspace policy is unavailable

            ownership_check_failed: 
      security:
        - bearerAuth: []
      summary: Approve discovered leads
      tags:
        - Discovered leads
      x-required-input-fields:
        - campaign_id
        - ids
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/discovered-leads/batch-reject:
    post:
      description: Reject several discovered leads in one request.
      operationId: post_api_discovered_leads_batch_reject
      requestBody:
        content:
          application/json:
            schema:
              properties:
                ids:
                  items:
                    type: string
                  type: array
              type: object
              required:
                - ids
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - properties:
                      rejected:
                        type: integer
                    type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_user_id: invalid user ID

            missing_ids: ids array is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: no discovered leads found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Reject discovered leads
      tags:
        - Discovered leads
      x-required-input-fields:
        - ids
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/discovered-leads/counts:
    get:
      description: Count discovered leads by review status.
      operationId: get_api_discovered_leads_counts
      parameters:
        - in: query
          name: app_id
          schema:
            type: string
        - in: query
          name: campaign_id
          schema:
            type: string
        - in: query
          name: fit
          schema:
            type: string
        - in: query
          name: signal
          schema:
            type: string
        - in: query
          name: search
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                additionalProperties:
                  type: integer
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_fit: invalid fit

            invalid_signal: invalid signal

            invalid_app_id: invalid app_id

            invalid_campaign_id: invalid campaign_id

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
      security:
        - bearerAuth: []
      summary: Count discovered leads
      tags:
        - Discovered leads
  /api/discovered-leads/{id}:
    get:
      description: Get one discovered lead.
      operationId: get_api_discovered_leads_id
      parameters:
        - in: query
          name: app_id
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DiscoveredLeadOwnerRow"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_id: valid lead and app IDs are required"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: lead not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a discovered lead
      tags:
        - Discovered leads
  /api/discovered-leads/{id}/approve:
    post:
      description: Approve a discovered lead so it can be contacted.
      operationId: post_api_discovered_leads_id_approve
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                campaign_id:
                  type: string
              type: object
              required:
                - campaign_id
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/Lead"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            country_restricted: 

            invalid_body: invalid request body

            invalid_campaign_id: invalid campaign ID

            invalid_id: invalid discovered lead ID

            invalid_user_id: invalid user ID

            missing_campaign_id: campaign_id is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            not_found: campaign not found

            not_found: discovered lead not found
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            lead_owned_by_other_rep: 

            lead_excluded: 

            linkedin_identity_unavailable: a verified LinkedIn profile URL is required for this sender

            no_send_route: 

            no_send_route: assign a connected LinkedIn sender to this campaign before approving leads
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            workspace_policy_unavailable: workspace policy is unavailable

            ownership_check_failed: 
      security:
        - bearerAuth: []
      summary: Approve a discovered lead
      tags:
        - Discovered leads
      x-required-input-fields:
        - campaign_id
  /api/discovered-leads/{id}/reject:
    post:
      description: Reject a discovered lead.
      operationId: post_api_discovered_leads_id_reject
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
          description: OK
        "204":
          description: No content.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid discovered lead ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: discovered lead not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Reject a discovered lead
      tags:
        - Discovered leads
  /api/inbox/conversations:
    get:
      description: List conversations from your connected accounts.
      operationId: get_api_inbox_conversations
      parameters:
        - in: query
          name: scope
          schema:
            type: string
        - in: query
          name: rep
          schema:
            type: string
        - in: query
          name: app_id
          schema:
            type: string
        - in: query
          name: q
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ConversationResponse"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_rep: rep must be a user ID

            invalid_scope: scope must be mine or team

            invalid_app_id: invalid app_id

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List conversations
      tags:
        - Inbox
  /api/inbox/conversations/{id}:
    get:
      description: Get one conversation with its messages.
      operationId: get_api_inbox_conversations_id
      parameters:
        - in: query
          name: scope
          schema:
            type: string
        - in: query
          name: rep
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversationDetailResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_rep: rep must be a user ID

            invalid_scope: scope must be mine or team

            invalid_id: invalid conversation ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: conversation not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a conversation
      tags:
        - Inbox
  /api/inbox/conversations/{id}/read:
    post:
      description: Mark a conversation as read.
      operationId: post_api_inbox_conversations_id_read
      parameters:
        - in: query
          name: scope
          schema:
            type: string
        - in: query
          name: rep
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "204":
          description: No content.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_rep: rep must be a user ID

            invalid_scope: scope must be mine or team

            invalid_id: invalid conversation ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: conversation not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Mark a conversation read
      tags:
        - Inbox
  /api/inbox/conversations/{id}/reply:
    post:
      description: Send a reply from the connected account that owns the conversation.
      operationId: post_api_inbox_conversations_id_reply
      parameters:
        - in: query
          name: scope
          schema:
            type: string
        - in: query
          name: rep
          schema:
            type: string
        - description: Idempotency key for this request.
          in: header
          name: Idempotency-Key
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                attachment:
                  format: binary
                  type: string
                body:
                  type: string
                reply_as_confirmed:
                  type: string
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_rep: rep must be a user ID

            invalid_scope: scope must be mine or team

            file_too_large: attachment must be 10MB or less

            invalid_body: failed to parse multipart form (max 10MB)

            invalid_body: invalid request body

            invalid_id: invalid conversation ID

            invalid_user_id: invalid user ID

            missing_body: reply body is required

            read_error: failed to read attachment
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            unauthorized: not authenticated

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "reply_as_not_confirmed: Confirm that you are replying as this rep."
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: conversation not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            reply_delivery_uncertain: check the provider and thread before another send

            reply_changed: reply changed or already has an attempt
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            reply_unavailable: this reply is unavailable; check the sender, latest message, body, and product

            x_encrypted_chat_reply_unavailable: 

            x_encrypted_chat_reply_unavailable: 

            reply_unavailable: this reply is unavailable; check the sender, latest message, body, and product
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "reply_unavailable: reply service is unavailable"
      security:
        - bearerAuth: []
      summary: Reply to a conversation
      tags:
        - Inbox
  /api/inbox/unread-count:
    get:
      description: Count conversations with unread messages.
      operationId: get_api_inbox_unread_count
      parameters:
        - in: query
          name: scope
          schema:
            type: string
        - in: query
          name: rep
          schema:
            type: string
        - in: query
          name: leads_only
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  count:
                    type: integer
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_rep: rep must be a user ID

            invalid_scope: scope must be mine or team

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Count unread conversations
      tags:
        - Inbox
  /api/lists:
    get:
      description: List lead lists across all products in your workspace.
      operationId: get_api_lists
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/LeadList"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List all lead lists
      tags:
        - Lead lists
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/lists/{id}:
    delete:
      description: Delete a lead list.
      operationId: delete_api_lists_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - properties:
                      message:
                        type: string
                    type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid list ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: list not found"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "default_list_cannot_be_archived: the default list cannot be archived"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Delete a lead list
      tags:
        - Lead lists
    get:
      description: Get one lead list and its counts.
      operationId: get_api_lists_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  list:
                    $ref: "#/components/schemas/LeadListWithReviewState"
                  status_counts:
                    additionalProperties:
                      type: integer
                    type: object
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid list ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: list not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get a lead list
      tags:
        - Lead lists
    put:
      description: Update a lead list.
      operationId: put_api_lists_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                description:
                  type: string
                name:
                  type: string
              type: object
              required:
                - name
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/Response"
                  - $ref: "#/components/schemas/LeadList"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_body: invalid request body

            invalid_id: invalid list ID

            invalid_user_id: invalid user ID

            missing_name: name is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            Missing, invalid, expired, or revoked bearer credential.

            unauthorized: not authenticated
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: list not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
        "503":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "workspace_policy_unavailable: workspace policy is unavailable"
      security:
        - bearerAuth: []
      summary: Update a lead list
      tags:
        - Lead lists
      x-required-input-fields:
        - name
  /api/lists/{id}/leads:
    get:
      description: List the people in a lead list.
      operationId: get_api_lists_id_leads
      parameters:
        - in: query
          name: limit
          schema:
            type: string
        - in: query
          name: offset
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ListLeadsByListRow"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_id: invalid list ID

            invalid_user_id: invalid user ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_assigned: this app is not assigned to you"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: list not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List leads in a list
      tags:
        - Lead lists
  /api/me/entitlement:
    get:
      description: Get the plan and features available to you in the current workspace.
      operationId: get_api_me_entitlement
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EntitlementResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "user_not_found: user not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Get your plan access
      tags:
        - Account usage
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/user/limits:
    get:
      description: Get your plan limits and current usage.
      operationId: get_api_user_limits
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - properties:
                      lead_source_credits_extra:
                        type: integer
                      lead_source_credits_monthly:
                        type: integer
                      max_agents_per_app:
                        type: integer
                      max_agents_total:
                        type: integer
                      max_apps:
                        type: integer
                      max_campaigns_per_app:
                        type: integer
                      max_x_accounts:
                        type: integer
                      unlimited:
                        type: boolean
                    type: object
                  - properties:
                      current_apps:
                        type: integer
                      lead_source_credits_extra:
                        type: integer
                      lead_source_credits_monthly:
                        type: integer
                      max_agents_per_app:
                        type: integer
                      max_agents_total:
                        type: integer
                      max_apps:
                        type: integer
                      max_campaigns_per_app:
                        type: integer
                      max_x_accounts:
                        type: integer
                      unlimited:
                        type: boolean
                    type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
      security:
        - bearerAuth: []
      summary: Get plan limits
      tags:
        - Account usage
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/users/me:
    get:
      description: Get the profile of the authenticated user.
      operationId: get_api_users_me
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserProfileResponse"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user id"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: user not found"
      security:
        - bearerAuth: []
      summary: Get your profile
      tags:
        - Account usage
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/users/me/api-tokens:
    get:
      description: List your personal access tokens. Token values are never returned after creation.
      operationId: get_api_users_me_api_tokens
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ApiTokenListItem"
                type: array
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user_id: invalid user id"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List API tokens
      tags:
        - API tokens
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
    post:
      description: >-
        Create a personal access token for the REST API.


        You can have at most 20 active tokens. The response returns the plaintext token once. Store it securely;
        subsequent list requests never return it.
      operationId: post_api_users_me_api_tokens
      requestBody:
        content:
          application/json:
            schema:
              properties:
                expires_in_days:
                  type: integer
                  enum:
                    - 0
                    - 7
                    - 30
                    - 60
                    - 90
                    - 180
                    - 365
                  default: 0
                  description: Zero means no expiry.
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: Non-empty name after trimming whitespace.
              type: object
              required:
                - name
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateAPITokenResponse"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_user_id: invalid user id

            invalid_body: invalid request body

            invalid_expiry: expires_in_days must be one of 0, 7, 30, 60, 90, 180, 365

            missing_name: name is required

            name_too_long: name must be 64 characters or fewer

            token_limit_reached: you have reached the maximum number of active tokens — revoke an existing one first
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Create an API token
      tags:
        - API tokens
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/users/me/api-tokens/{id}:
    delete:
      description: Revoke a personal access token.
      operationId: delete_api_users_me_api_tokens_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "204":
          description: No content.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_user_id: invalid user id

            invalid_id: invalid token id
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "unauthorized: not authenticated"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Revoke an API token
      tags:
        - API tokens
  /api/webhooks/outbound:
    get:
      description: List the webhooks that receive Funkel AI events.
      operationId: get_api_webhooks_outbound
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/WebhookSubscriptionSafe"
                type: array
          description: OK
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user: Invalid user ID"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: List webhooks
      tags:
        - Outbound webhooks
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
    post:
      description: Send Funkel AI events to your URL.
      operationId: post_api_webhooks_outbound
      requestBody:
        content:
          application/json:
            schema:
              properties:
                events:
                  items:
                    type: string
                  type: array
                integration_id:
                  type: string
                url:
                  type: string
              type: object
              required:
                - events
                - url
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookSubscription"
          description: Created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_event: 

            invalid_id: Invalid integration ID

            invalid_json: Invalid request body

            invalid_url: Webhook URL must be a public HTTPS URL

            missing_field: events is required (at least one event)

            missing_field: url is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user: Invalid user ID"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: Integration not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Create a webhook
      tags:
        - Outbound webhooks
      x-required-input-fields:
        - events
        - url
      parameters:
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
  /api/webhooks/outbound/sample-payload:
    get:
      description: Get an example of the JSON a webhook receives.
      operationId: get_api_webhooks_outbound_sample_payload
      parameters:
        - in: query
          name: event
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                additionalProperties:
                  description: Arbitrary JSON value.
                type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_event: 

            missing_param: event query param is required
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: Missing, invalid, expired, or revoked bearer credential.
      security:
        - bearerAuth: []
      summary: Get a sample payload
      tags:
        - Outbound webhooks
  /api/webhooks/outbound/{id}:
    delete:
      description: Delete a webhook. It stops receiving events.
      operationId: delete_api_webhooks_outbound_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "204":
          description: No content.
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_id: Invalid webhook ID"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user: Invalid user ID"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Delete a webhook
      tags:
        - Outbound webhooks
    put:
      description: Update a webhook.
      operationId: put_api_webhooks_outbound_id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  anyOf:
                    - type: boolean
                    - type: "null"
                events:
                  items:
                    type: string
                  type: array
                url:
                  anyOf:
                    - type: string
                    - type: "null"
              type: object
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookSubscriptionSafe"
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_event: 

            invalid_id: Invalid webhook ID

            invalid_json: Invalid request body

            invalid_url: Webhook URL must be a public HTTPS URL
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user: Invalid user ID"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: Webhook not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Update a webhook
      tags:
        - Outbound webhooks
  /api/webhooks/outbound/{id}/test:
    post:
      description: Send a sample event to a webhook.
      operationId: post_api_webhooks_outbound_id_test
      parameters:
        - in: query
          name: event
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - name: X-Acting-As
          in: header
          schema:
            type: string
            format: uuid
          description: Optional workspace-owner user ID. Requires current team membership and access to the requested product.
            Identity and token operations still use the authenticated user.
      responses:
        "200":
          content:
            application/json:
              schema:
                anyOf:
                  - properties:
                      error:
                        type: string
                      status_code:
                        type: integer
                      success:
                        type: boolean
                    type: object
                  - properties:
                      response_body:
                        type: string
                      status_code:
                        type: integer
                      success:
                        type: boolean
                    type: object
          description: OK
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: |-
            invalid_event: 

            invalid_id: Invalid webhook ID
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "invalid_user: Invalid user ID"
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "not_found: Webhook not found"
        "500":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: "internal: Something went wrong on our side. Retry later."
      security:
        - bearerAuth: []
      summary: Send a test event
      tags:
        - Outbound webhooks
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal access token (funkel_pat_ prefix) or valid session JWT. Use a placeholder in examples; never
        publish a live credential.
    sessionJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Logged-in browser session JWT with a valid session ID. Personal access tokens cannot call this operation.
    refreshCookie:
      type: apiKey
      in: cookie
      name: refresh_token
      description: The refresh cookie issued during login or signup. This operation rotates session tokens.
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        details:
          type: string
      required:
        - error
    AppSuggestion:
      properties:
        description:
          type: string
        icp:
          $ref: "#/components/schemas/ICPSuggestion"
        logo_url:
          type: string
        name:
          type: string
        product_brain:
          $ref: "#/components/schemas/ProductBrainSuggestion"
        website_url:
          type: string
      required:
        - name
        - description
        - logo_url
        - website_url
        - icp
        - product_brain
      type: object
    ICPSuggestion:
      properties:
        additional_criteria:
          type: string
        company_size:
          type: string
        company_sizes:
          items:
            type: string
          type: array
        company_types:
          items:
            type: string
          type: array
        description:
          type: string
        exclude_service_providers:
          type: boolean
        excluded_companies:
          items:
            type: string
          type: array
        excluded_keywords:
          items:
            type: string
          type: array
        industries:
          items:
            type: string
          type: array
        industry_inputs:
          items:
            type: string
          type: array
        industry_mapping:
          anyOf:
            - $ref: "#/components/schemas/IndustryMapping"
            - type: "null"
        job_titles:
          items:
            type: string
          type: array
        lead_matching_mode:
          type: string
        mandatory_keywords:
          items:
            type: string
          type: array
        regions:
          items:
            type: string
          type: array
      required:
        - description
        - job_titles
        - company_size
        - company_sizes
        - company_types
        - regions
        - industries
        - excluded_companies
        - excluded_keywords
        - mandatory_keywords
        - additional_criteria
        - lead_matching_mode
        - exclude_service_providers
      type: object
    IndustryMapping:
      properties:
        catalog_version:
          type: string
        records:
          items:
            $ref: "#/components/schemas/IndustryMappingRecord"
          type: array
      required:
        - catalog_version
        - records
      type: object
    IndustryMappingRecord:
      properties:
        confident:
          type: boolean
        input:
          type: string
        kind:
          type: string
        model:
          type: string
        provenance:
          type: string
        provider:
          type: string
        reason:
          type: string
        runtime_version:
          type: integer
        targets:
          items:
            $ref: "#/components/schemas/IndustryTarget"
          type: array
      required:
        - input
        - kind
        - confident
      type: object
    IndustryTarget:
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
      type: object
    MessageAgentRationale:
      properties:
        angle:
          type: string
        buyer_pain:
          type: string
        guardrail:
          type: string
        signal:
          type: string
      required:
        - angle
        - buyer_pain
        - signal
        - guardrail
      type: object
    ProductBrainSuggestion:
      properties:
        buyer_pain:
          type: string
        competitors:
          type: string
        differentiators:
          type: string
        guardrails:
          type: string
        learnings:
          type: string
        objections:
          type: string
        positioning:
          type: string
        proof_points:
          type: string
        voice_guidelines:
          type: string
      required:
        - positioning
        - buyer_pain
        - differentiators
        - competitors
        - proof_points
        - voice_guidelines
        - objections
        - guardrails
        - learnings
      type: object
    CreditCatalogDTO:
      properties:
        operations:
          items:
            $ref: "#/components/schemas/OperationPricingDTO"
          type: array
        packs:
          items:
            $ref: "#/components/schemas/CreditPackDTO"
          type: array
      required:
        - packs
        - operations
      type: object
    CreditPackDTO:
      properties:
        credits:
          type: integer
        discount_label:
          type: string
        discount_percent:
          type: integer
        label:
          type: string
        name:
          $ref: "#/components/schemas/PackName"
        price_cents:
          type: integer
        price_label:
          type: string
        recommended:
          type: boolean
        value_label:
          type: string
      required:
        - name
        - label
        - credits
        - price_cents
        - price_label
        - value_label
      type: object
    LeadBudgetView:
      properties:
        has_active_lead_pack:
          type: boolean
        lead_packs_purchasable:
          type: boolean
        lead_source_available:
          type: boolean
        people_included_estimate:
          type: integer
        people_left_estimate:
          type: integer
        people_per_day_estimate:
          type: integer
        people_today_left_estimate:
          type: integer
        resets_at:
          type: string
        used_percent:
          type: integer
        waiting_for_tomorrow:
          type: boolean
      required:
        - people_included_estimate
        - people_left_estimate
        - used_percent
        - resets_at
        - lead_source_available
        - lead_packs_purchasable
        - has_active_lead_pack
        - people_per_day_estimate
        - people_today_left_estimate
        - waiting_for_tomorrow
      type: object
    OperationKey:
      type: string
    OperationPricingDTO:
      properties:
        amounts:
          items:
            $ref: "#/components/schemas/PricingAmount"
          type: array
        base_credits:
          type: integer
        description:
          type: string
        key:
          $ref: "#/components/schemas/OperationKey"
        label:
          type: string
        miss_credits:
          type: integer
        per_result_credits:
          type: integer
        success_credits:
          type: integer
      required:
        - key
        - label
        - description
        - amounts
      type: object
    PackName:
      type: string
    PricingAmount:
      properties:
        credits:
          type: integer
        included_in_estimate:
          type: boolean
        included_in_maximum:
          type: boolean
        label:
          type: string
        settlement:
          $ref: "#/components/schemas/UsageStatus"
      required:
        - label
        - credits
        - settlement
        - included_in_estimate
        - included_in_maximum
      type: object
    UsageStatus:
      type: string
    WalletSummary:
      properties:
        admin_granted_available:
          type: integer
        appsumo_available:
          type: integer
        legacy_available:
          type: integer
        nearest_expiry:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        purchased_available:
          type: integer
        subscription_available:
          type: integer
        total_available:
          type: integer
      required:
        - total_available
        - legacy_available
        - subscription_available
        - appsumo_available
        - purchased_available
        - admin_granted_available
      type: object
    Envelope:
      properties:
        credits_spent:
          type: integer
        details:
          $ref: "#/components/schemas/SimulationDetails"
        external_calls:
          type: boolean
        message:
          type: string
        operation:
          $ref: "#/components/schemas/Operation"
        saved:
          type: boolean
        simulated:
          type: boolean
        work_enqueued:
          type: boolean
      required:
        - simulated
        - operation
        - saved
        - work_enqueued
        - external_calls
        - credits_spent
        - message
        - details
      type: object
    Operation:
      type: string
    Response:
      properties:
        demo_simulation:
          $ref: "#/components/schemas/Envelope"
      required:
        - demo_simulation
      type: object
    SimulationDetails:
      description: JSON value; the server permits arbitrary JSON at this field.
    OwnershipSkip:
      $ref: "#/components/schemas/Skip"
    SelectedEnrollmentOutcome:
      properties:
        display_name:
          type: string
        lead_id:
          type: string
        member_id:
          type: string
        message:
          type: string
        ownership_skip:
          anyOf:
            - $ref: "#/components/schemas/OwnershipSkip"
            - type: "null"
        reason:
          type: string
        source_company_domain:
          type: string
        source_company_name:
          type: string
        source_csv_row_number:
          anyOf:
            - type: integer
            - type: "null"
        source_kind:
          type: string
        status:
          type: string
      required:
        - member_id
        - display_name
        - status
      type: object
    SelectedEnrollmentResult:
      properties:
        added:
          type: integer
        failed:
          type: integer
        member_ids:
          items:
            type: string
          type: array
        operation_id:
          type: string
        outcomes:
          items:
            $ref: "#/components/schemas/SelectedEnrollmentOutcome"
          type: array
        ownership_skips:
          items:
            $ref: "#/components/schemas/OwnershipSkip"
          type: array
        processed_count:
          type: integer
        receipt_id:
          type: string
        resume_after:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        resume_available:
          type: boolean
        skipped:
          type: integer
        skipped_reasons:
          additionalProperties:
            type: integer
          type: object
        status:
          type: string
        total_requested:
          type: integer
      required:
        - status
        - added
        - skipped
        - failed
        - processed_count
        - total_requested
        - outcomes
        - skipped_reasons
      type: object
    CampaignContactsResponse:
      properties:
        actions:
          items:
            $ref: "#/components/schemas/ListCampaignContactActionsRow"
          type: array
        campaign_status:
          type: string
        leads:
          items:
            $ref: "#/components/schemas/ListCampaignContactLeadsRow"
          type: array
        timezone:
          type: string
      required:
        - campaign_status
        - timezone
        - leads
        - actions
      type: object
    OwnerSummary:
      properties:
        display_name:
          type: string
        member_user_id:
          type: string
        since_at:
          type: string
        status:
          type: string
      required:
        - status
      type: object
    AgentDiscoveryFunnelResponse:
      properties:
        campaign_enrollment_count:
          type: integer
        enabled_linkedin_signal_count:
          type: integer
        exhausted_linkedin_signals:
          items:
            $ref: "#/components/schemas/ExhaustedLinkedInSignal"
          type: array
        linked_campaign_count:
          type: integer
        list_count:
          type: integer
        list_id:
          type: string
        list_name:
          type: string
        pending:
          type: integer
        qualified:
          type: integer
        rejected:
          type: integer
        reviewed:
          type: integer
        window_days:
          type: integer
      required:
        - window_days
        - reviewed
        - rejected
        - qualified
        - pending
        - list_count
        - linked_campaign_count
        - campaign_enrollment_count
        - enabled_linkedin_signal_count
        - exhausted_linkedin_signals
      type: object
    AgentPassportResponse:
      properties:
        capabilities:
          items:
            type: string
          type: array
        status:
          type: string
      required:
        - status
      type: object
    AgentResponse:
      allOf:
        - $ref: "#/components/schemas/Agent"
        - properties:
            agent_passport:
              anyOf:
                - $ref: "#/components/schemas/AgentPassportResponse"
                - type: "null"
          type: object
    AgentSourceResponse:
      properties:
        auto_resolve_linkedin:
          type: boolean
        daily_read_budget:
          type: integer
        enabled:
          type: boolean
        queries:
          items:
            type: string
          type: array
        read_units_today:
          type: integer
        rules:
          items:
            $ref: "#/components/schemas/AgentSourceRuleResponse"
          type: array
        source:
          type: string
      required:
        - source
        - enabled
        - queries
        - read_units_today
        - auto_resolve_linkedin
      type: object
    AgentSourceRuleResponse:
      properties:
        api_errors_today:
          type: integer
        candidates_rejected_ai_error_today:
          type: integer
        candidates_rejected_score_today:
          type: integer
        candidates_scored_today:
          type: integer
        duplicates_today:
          type: integer
        id:
          type: string
        last_checked_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        last_error:
          type: string
        last_lead_created_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        last_matched_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        last_streamed_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        leads_created_today:
          type: integer
        query:
          type: string
        search_post_reads_today:
          type: integer
        status:
          type: string
        status_reason:
          type: string
        stream_post_reads_today:
          type: integer
        stream_recent_count:
          type: integer
        stream_recent_count_checked_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        stream_sync_error:
          type: string
        stream_sync_status:
          type: string
        stream_synced_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        user_reads_today:
          type: integer
      required:
        - id
        - query
        - status
        - stream_post_reads_today
        - search_post_reads_today
        - user_reads_today
        - candidates_scored_today
        - candidates_rejected_score_today
        - candidates_rejected_ai_error_today
        - leads_created_today
        - duplicates_today
        - api_errors_today
      type: object
    AnalyticsOverviewResponse:
      properties:
        accepted_count:
          type: integer
        accepted_rate:
          type: number
        hot_count:
          type: integer
        invited_count:
          type: integer
        low_fit_active_count:
          type: integer
        opted_out_count:
          type: integer
        replied_count:
          type: integer
        reply_rate:
          type: number
        total_leads:
          type: integer
        unfit_count:
          type: integer
      required:
        - invited_count
        - accepted_count
        - replied_count
        - hot_count
        - total_leads
        - accepted_rate
        - reply_rate
        - opted_out_count
        - unfit_count
        - low_fit_active_count
      type: object
    ApiTokenListItem:
      properties:
        created_at:
          type: string
        expires_at:
          anyOf:
            - type: string
            - type: "null"
        id:
          type: string
        last_used_at:
          anyOf:
            - type: string
            - type: "null"
        name:
          type: string
        prefix_preview:
          type: string
      required:
        - id
        - name
        - prefix_preview
        - last_used_at
        - expires_at
        - created_at
      type: object
    AppResponse:
      allOf:
        - $ref: "#/components/schemas/App"
        - properties:
            lead_finder_passport:
              anyOf:
                - $ref: "#/components/schemas/AgentPassportResponse"
                - type: "null"
            specialist_passports:
              additionalProperties:
                anyOf:
                  - $ref: "#/components/schemas/AgentPassportResponse"
                  - type: "null"
              type: object
          type: object
    AttachmentResponse:
      properties:
        file_name:
          type: string
        file_size:
          type: integer
        id:
          type: string
        mimetype:
          type: string
        type:
          type: string
        url:
          type: string
      required:
        - id
        - type
        - url
        - file_name
        - mimetype
        - file_size
      type: object
    CampaignEnrollmentSummary:
      properties:
        enrolled:
          type: integer
        ownership_skips:
          items:
            $ref: "#/components/schemas/OwnershipSkip"
          type: array
        planned_actions:
          type: integer
        skipped:
          type: integer
        skipped_reasons:
          additionalProperties:
            type: integer
          type: object
      required:
        - enrolled
        - skipped
        - planned_actions
        - skipped_reasons
      type: object
    CampaignPlatformStats:
      properties:
        accepted_count:
          type: integer
        contacted_count:
          type: integer
        followed_count:
          type: integer
        invited_count:
          type: integer
        platform:
          type: string
        replied_count:
          type: integer
        sent_count:
          type: integer
        total_leads:
          type: integer
      required:
        - platform
        - total_leads
        - contacted_count
        - sent_count
        - invited_count
        - followed_count
        - accepted_count
        - replied_count
      type: object
    CampaignStatsResponse:
      properties:
        accepted_count:
          type: integer
        accepted_rate:
          type: number
        by_platform:
          items:
            $ref: "#/components/schemas/CampaignPlatformStats"
          type: array
        contacted_count:
          type: integer
        invited_count:
          type: integer
        message_review:
          anyOf:
            - $ref: "#/components/schemas/ReviewSummary"
            - type: "null"
        next_launch_at:
          anyOf:
            - format: date-time
              type: string
            - type: "null"
        planned_actions:
          type: integer
        replied_count:
          type: integer
        reply_rate:
          type: number
        review_leads:
          type: integer
        sent_count:
          type: integer
        total_leads:
          type: integer
      required:
        - total_leads
        - review_leads
        - contacted_count
        - sent_count
        - invited_count
        - accepted_count
        - replied_count
        - accepted_rate
        - reply_rate
        - planned_actions
        - next_launch_at
      type: object
    CampaignWithAssignments:
      allOf:
        - $ref: "#/components/schemas/Campaign"
        - properties:
            account_assignments:
              additionalProperties:
                anyOf:
                  - type: string
                  - type: "null"
              type: object
            channel_readiness:
              anyOf:
                - $ref: "#/components/schemas/CampaignChannelReadiness"
                - type: "null"
            last_import_list_id:
              anyOf:
                - type: string
                - type: "null"
          required:
            - account_assignments
          type: object
    CampaignWithStats:
      allOf:
        - $ref: "#/components/schemas/Campaign"
        - properties:
            account_assignments:
              additionalProperties:
                anyOf:
                  - type: string
                  - type: "null"
              type: object
            stats:
              anyOf:
                - $ref: "#/components/schemas/CampaignStatsResponse"
                - type: "null"
          required:
            - stats
            - account_assignments
          type: object
    ContactDetailResponse:
      properties:
        contact:
          $ref: "#/components/schemas/ContactDetailRow"
        discovered_lead_id:
          type: string
        discovered_lead_source:
          type: string
        enrichment:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        import_notes:
          type: string
        linkedin_profile_url:
          type: string
        linkedin_provider_id:
          type: string
        sequence:
          items:
            $ref: "#/components/schemas/SequenceStep"
          type: array
        signal_metadata:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        signals:
          items:
            type: string
          type: array
      required:
        - contact
        - signals
        - enrichment
        - signal_metadata
        - sequence
      type: object
    ContactDetailRow:
      allOf:
        - $ref: "#/components/schemas/GetContactByIDRow"
        - properties:
            owner:
              $ref: "#/components/schemas/OwnerSummary"
          required:
            - owner
          type: object
    ContactListResponse:
      properties:
        contacts:
          items:
            $ref: "#/components/schemas/ContactListRow"
          type: array
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
      required:
        - contacts
        - total
        - limit
        - offset
      type: object
    ContactListRow:
      allOf:
        - $ref: "#/components/schemas/ListGlobalContactsRow"
        - properties:
            owner:
              $ref: "#/components/schemas/OwnerSummary"
          required:
            - owner
          type: object
    ConversationDetailResponse:
      properties:
        id:
          format: uuid
          type:
            - string
            - "null"
        last_message_at:
          format: date-time
          type:
            - string
            - "null"
        last_message_preview:
          type: string
        lead:
          anyOf:
            - $ref: "#/components/schemas/LeadContext"
            - type: "null"
        messages:
          items:
            $ref: "#/components/schemas/MessageResponse"
          type: array
        owner:
          $ref: "#/components/schemas/InboxOwnerDTO"
        participant_headline:
          type: string
        participant_name:
          type: string
        platform:
          type: string
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        sender:
          $ref: "#/components/schemas/InboxSenderDTO"
        unread_count:
          type: integer
        viewer_owns_conversation:
          type: boolean
        viewer_reply_permission:
          type: string
      required:
        - id
        - platform_account_id
        - participant_name
        - participant_headline
        - platform
        - last_message_preview
        - last_message_at
        - unread_count
        - lead
        - messages
        - owner
        - sender
        - viewer_owns_conversation
        - viewer_reply_permission
      type: object
    ConversationResponse:
      properties:
        app_id:
          format: uuid
          type:
            - string
            - "null"
        id:
          format: uuid
          type:
            - string
            - "null"
        last_message_at:
          format: date-time
          type:
            - string
            - "null"
        last_message_from:
          type: string
        last_message_preview:
          type: string
        lead:
          anyOf:
            - $ref: "#/components/schemas/LeadContext"
            - type: "null"
        owner:
          $ref: "#/components/schemas/InboxOwnerDTO"
        participant_headline:
          type: string
        participant_name:
          type: string
        platform:
          type: string
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        profile_picture_url:
          type: string
        provider_chat_id:
          type: string
        sender:
          $ref: "#/components/schemas/InboxSenderDTO"
        unread_count:
          type: integer
        viewer_owns_conversation:
          type: boolean
        viewer_reply_permission:
          type: string
      required:
        - id
        - platform_account_id
        - provider_chat_id
        - participant_name
        - participant_headline
        - profile_picture_url
        - platform
        - last_message_preview
        - last_message_at
        - unread_count
        - lead
        - app_id
        - owner
        - sender
        - viewer_owns_conversation
        - viewer_reply_permission
      type: object
    CreateAPITokenResponse:
      properties:
        created_at:
          type: string
        expires_at:
          anyOf:
            - type: string
            - type: "null"
        id:
          type: string
        name:
          type: string
        prefix_preview:
          type: string
        token:
          type: string
      required:
        - id
        - token
        - name
        - prefix_preview
        - expires_at
        - created_at
      type: object
    CreateCampaignResponse:
      properties:
        agent_id:
          format: uuid
          type:
            - string
            - "null"
        app_id:
          format: uuid
          type:
            - string
            - "null"
        created_at:
          format: date-time
          type:
            - string
            - "null"
        enrollment_summary:
          $ref: "#/components/schemas/CampaignEnrollmentSummary"
        id:
          format: uuid
          type:
            - string
            - "null"
        list_id:
          format: uuid
          type:
            - string
            - "null"
        name:
          type: string
        settings:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - app_id
        - user_id
        - name
        - status
        - settings
        - created_at
        - updated_at
        - agent_id
        - list_id
        - enrollment_summary
      type: object
    CreditCatalogResponse:
      allOf:
        - $ref: "#/components/schemas/CreditCatalogDTO"
        - properties:
            can_purchase:
              type: boolean
            credit_breakdown:
              anyOf:
                - $ref: "#/components/schemas/WalletSummary"
                - type: "null"
            credits:
              type: integer
            has_stripe_customer:
              type: boolean
            requires_billing_admin:
              type: boolean
          required:
            - credits
            - can_purchase
            - requires_billing_admin
            - has_stripe_customer
          type: object
    CurrentPlanResponse:
      properties:
        beta_discount:
          type: boolean
        beta_ends_at:
          type: integer
        beta_grandfather:
          type: boolean
        cadence:
          type: string
        cancel_at_period_end:
          type: boolean
        credits:
          type: integer
        current_period_end:
          type: integer
        current_price_id:
          type: string
        dm_sync_credits_extra:
          type: integer
        dm_sync_credits_monthly:
          type: integer
        dunning_state:
          type: string
        has_stripe_subscription:
          type: boolean
        included_credits:
          type: integer
        lead_budget:
          anyOf:
            - $ref: "#/components/schemas/LeadBudgetView"
            - type: "null"
        lead_source_credits_extra:
          type: integer
        lead_source_credits_monthly:
          type: integer
        max_agents_per_app:
          type: integer
        max_agents_total:
          type: integer
        max_apps:
          type: integer
        max_linkedin_accounts:
          type: integer
        max_sender_accounts:
          type: integer
        max_x_accounts:
          type: integer
        next_billing_date:
          type: integer
        next_charge_amount_cents:
          anyOf:
            - type: integer
            - type: "null"
        payment_method_brand:
          type: string
        payment_method_exp_month:
          type: integer
        payment_method_exp_year:
          type: integer
        payment_method_last4:
          type: string
        payment_method_type:
          type: string
        plan_name:
          type: string
        status:
          type: string
        trial_ends_at:
          type: integer
        used_agents:
          type: integer
        used_apps:
          type: integer
        used_linkedin_accounts:
          type: integer
        used_sender_accounts:
          type: integer
        used_x_accounts:
          type: integer
      required:
        - plan_name
        - cadence
        - current_price_id
        - has_stripe_subscription
        - cancel_at_period_end
        - dunning_state
        - credits
        - included_credits
        - beta_grandfather
        - beta_discount
        - status
        - max_linkedin_accounts
        - max_sender_accounts
        - max_agents_total
        - max_apps
        - max_x_accounts
        - lead_source_credits_monthly
        - lead_source_credits_extra
        - dm_sync_credits_monthly
        - dm_sync_credits_extra
        - used_linkedin_accounts
        - used_sender_accounts
        - used_x_accounts
        - used_agents
        - used_apps
      type: object
    DailyActivityRow:
      properties:
        action_count:
          type: integer
        action_type:
          type: string
        date:
          type: string
      required:
        - date
        - action_type
        - action_count
      type: object
    DiscoveredLeadListResponse:
      properties:
        counts:
          additionalProperties:
            type: integer
          type: object
        leads:
          items:
            $ref: "#/components/schemas/DiscoveredLeadOwnerRow"
          type: array
        total:
          type: integer
      required:
        - leads
        - counts
        - total
      type: object
    DiscoveredLeadOwnerRow:
      allOf:
        - $ref: "#/components/schemas/ListDiscoveredLeadsByUserWithListRow"
        - properties:
            owner:
              $ref: "#/components/schemas/OwnerSummary"
          required:
            - owner
          type: object
    EntitlementResponse:
      properties:
        beta_discount:
          type: boolean
        beta_ends_at:
          type: integer
        beta_grandfather:
          type: boolean
        cadence:
          type: string
        credits:
          type: integer
        current_price_id:
          type: string
        dunning_state:
          type: string
        has_stripe_subscription:
          type: boolean
        included_credits:
          type: integer
        plan_name:
          type: string
        status:
          type: string
        trial_ends_at:
          type: integer
      required:
        - plan_name
        - cadence
        - current_price_id
        - has_stripe_subscription
        - dunning_state
        - credits
        - included_credits
        - beta_grandfather
        - beta_discount
        - status
      type: object
    ExhaustedLinkedInSignal:
      properties:
        consecutive_empty_runs:
          type: integer
        id:
          type: string
        label:
          type: string
      required:
        - id
        - label
        - consecutive_empty_runs
      type: object
    FunnelAnalysisResponse:
      properties:
        ai_insight:
          type: string
        funnel:
          $ref: "#/components/schemas/AnalyticsOverviewResponse"
        steps:
          items:
            $ref: "#/components/schemas/StepStatsRow"
          type: array
      required:
        - funnel
        - steps
        - ai_insight
      type: object
    InboxOwnerDTO:
      properties:
        display_name:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        left_workspace:
          type: boolean
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - user_id
        - first_name
        - last_name
        - display_name
        - left_workspace
      type: object
    InboxSenderDTO:
      properties:
        connection_state:
          type: string
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        type:
          type: string
      required:
        - platform_account_id
        - type
        - connection_state
      type: object
    LeadContext:
      properties:
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        campaign_name:
          type: string
        company:
          type: string
        first_name:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        profile_picture_url:
          type: string
      required:
        - id
        - first_name
        - last_name
        - company
        - headline
        - profile_picture_url
      type: object
    LeadListWithReviewState:
      allOf:
        - $ref: "#/components/schemas/LeadList"
        - properties:
            pending_review_count:
              anyOf:
                - type: integer
                - type: "null"
            review_error_job_count:
              anyOf:
                - type: integer
                - type: "null"
            review_job_count:
              anyOf:
                - type: integer
                - type: "null"
            review_job_status:
              type: string
            review_running_job_count:
              anyOf:
                - type: integer
                - type: "null"
          type: object
    MessageResponse:
      properties:
        attachments:
          items:
            $ref: "#/components/schemas/AttachmentResponse"
          type: array
        body:
          type: string
        can_fetch_html:
          type: boolean
        created_at:
          format: date-time
          type:
            - string
            - "null"
        html_body:
          type: string
        id:
          type: string
        is_ai_generated:
          type: boolean
        rationale:
          anyOf:
            - $ref: "#/components/schemas/MessageAgentRationale"
            - type: "null"
        sender_name:
          type: string
        sender_type:
          type: string
        subject:
          type: string
      required:
        - id
        - sender_type
        - sender_name
        - body
        - is_ai_generated
        - created_at
      type: object
    PeopleCSVItem:
      properties:
        company:
          type: string
        created_member_id:
          type: string
        email:
          type: string
        first_name:
          type: string
        headline:
          type: string
        last_name:
          type: string
        linkedin_url:
          type: string
        ownership_skip:
          anyOf:
            - $ref: "#/components/schemas/Skip"
            - type: "null"
        reason:
          type: string
        row:
          type: integer
        status:
          type: string
      required:
        - row
        - first_name
        - last_name
        - company
        - headline
        - linkedin_url
        - email
        - status
        - reason
      type: object
    PeopleCSVResponse:
      properties:
        created:
          type: integer
        duplicate:
          type: integer
        failed:
          type: integer
        import_id:
          type: string
        invalid:
          type: integer
        items:
          items:
            $ref: "#/components/schemas/PeopleCSVItem"
          type: array
        limit:
          type: integer
        list_id:
          type: string
        offset:
          type: integer
        selection_fingerprint:
          type: string
        skipped_duplicate:
          type: integer
        skipped_owned:
          type: integer
        status:
          type: string
        total:
          type: integer
        valid:
          type: integer
      required:
        - import_id
        - selection_fingerprint
        - status
        - items
        - offset
        - limit
        - total
        - valid
        - duplicate
        - invalid
        - created
        - skipped_duplicate
        - skipped_owned
        - failed
      type: object
    ReviewGenerationResult:
      properties:
        body:
          type: string
        error:
          type: string
        id:
          type: string
        status:
          type: string
        subject:
          type: string
        version_id:
          type: string
      required:
        - id
        - status
      type: object
    ReviewSummary:
      properties:
        mode:
          type: string
        steps:
          items:
            $ref: "#/components/schemas/ReviewSummaryStep"
          type: array
      required:
        - mode
        - steps
      type: object
    ReviewSummaryStep:
      properties:
        approved:
          type: integer
        changed:
          type: integer
        failed:
          type: integer
        needs_review:
          type: integer
        sent:
          type: integer
        step_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - step_id
        - needs_review
        - approved
        - sent
        - changed
        - failed
      type: object
    SequenceStep:
      properties:
        action_type:
          type: string
        executed_at:
          format: date-time
          type:
            - string
            - "null"
        message_content:
          type: string
        scheduled_at:
          format: date-time
          type:
            - string
            - "null"
        status:
          type: string
        step_deleted_at:
          format: date-time
          type:
            - string
            - "null"
        step_order:
          type: integer
        step_type:
          type: string
      required:
        - step_type
        - step_order
        - action_type
        - status
        - message_content
        - scheduled_at
        - executed_at
        - step_deleted_at
      type: object
    StepStatsRow:
      properties:
        approved_actions:
          type: integer
        awaiting_approval_actions:
          type: integer
        cancelled_actions:
          type: integer
        completed_actions:
          type: integer
        configured_delay_hours:
          type: integer
        executing_actions:
          type: integer
        failed_actions:
          type: integer
        hot_replied:
          type: integer
        leads_replied:
          type: integer
        pending_actions:
          type: integer
        reply_rate:
          type: number
        skipped_actions:
          type: integer
        step_order:
          type: integer
        step_type:
          type: string
        total_actions:
          type: integer
        waiting_connection_actions:
          type: integer
      required:
        - step_order
        - step_type
        - total_actions
        - completed_actions
        - pending_actions
        - approved_actions
        - executing_actions
        - failed_actions
        - skipped_actions
        - leads_replied
        - hot_replied
        - reply_rate
        - configured_delay_hours
        - cancelled_actions
        - waiting_connection_actions
        - awaiting_approval_actions
      type: object
    UpdateCampaignResponse:
      allOf:
        - $ref: "#/components/schemas/Campaign"
        - properties:
            enrolled_count:
              anyOf:
                - type: integer
                - type: "null"
            ownership_skips:
              items:
                $ref: "#/components/schemas/OwnershipSkip"
              type: array
            skipped_count:
              anyOf:
                - type: integer
                - type: "null"
            skipped_reasons:
              additionalProperties:
                type: integer
              type: object
          type: object
    UserProfileResponse:
      properties:
        auth_provider:
          type: string
        booking_link:
          type: string
        digest_emails_enabled:
          type: boolean
        email:
          type: string
        first_name:
          type: string
        has_password:
          type: boolean
        id:
          type: string
        language:
          type: string
        last_name:
          type: string
        timezone:
          type: string
      required:
        - id
        - email
        - first_name
        - last_name
        - language
        - timezone
        - digest_emails_enabled
        - booking_link
        - auth_provider
        - has_password
      type: object
    WebhookSubscriptionSafe:
      properties:
        active:
          type: boolean
        created_at:
          format: date-time
          type:
            - string
            - "null"
        events:
          items:
            type: string
          type: array
        id:
          format: uuid
          type:
            - string
            - "null"
        integration_id:
          format: uuid
          type:
            - string
            - "null"
        secret:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        url:
          type: string
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - user_id
        - integration_id
        - url
        - secret
        - events
        - active
        - created_at
        - updated_at
      type: object
    Skip:
      properties:
        owner_display_name:
          type: string
        owner_member_id:
          format: uuid
          type:
            - string
            - "null"
        owner_since:
          type: string
        person_display_name:
          type: string
        person_key:
          type: string
        waiting_reassignment:
          type: boolean
      required:
        - person_key
        - person_display_name
        - owner_member_id
        - owner_display_name
        - owner_since
        - waiting_reassignment
      type: object
    CampaignChannelReadiness:
      properties:
        ready_channels:
          items:
            type: string
          type: array
        step_channels:
          items:
            type: string
          type: array
        usable_channels:
          items:
            type: string
          type: array
        warnings:
          items:
            $ref: "#/components/schemas/ChannelWarning"
          type: array
      required:
        - step_channels
        - usable_channels
        - ready_channels
        - warnings
      type: object
    ChannelWarning:
      properties:
        channel:
          type: string
        message:
          type: string
      required:
        - channel
        - message
      type: object
    Agent:
      properties:
        app_id:
          format: uuid
          type:
            - string
            - "null"
        b2b:
          type: boolean
        config:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        created_at:
          format: date-time
          type:
            - string
            - "null"
        icp_description:
          type:
            - string
            - "null"
        icp_filters:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        id:
          format: uuid
          type:
            - string
            - "null"
        last_lead_digest_at:
          format: date-time
          type:
            - string
            - "null"
        last_run_at:
          format: date-time
          type:
            - string
            - "null"
        leads_found:
          type: integer
        list_id:
          format: uuid
          type:
            - string
            - "null"
        max_signals:
          type: integer
        name:
          type: string
        next_run_at:
          format: date-time
          type:
            - string
            - "null"
        require_current_employer:
          type: boolean
        score_floor:
          type: integer
        status:
          type: string
        type:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - app_id
        - user_id
        - name
        - status
        - type
        - config
        - leads_found
        - max_signals
        - created_at
        - updated_at
        - list_id
        - last_run_at
        - next_run_at
        - icp_description
        - icp_filters
        - score_floor
        - last_lead_digest_at
        - b2b
        - require_current_employer
      type: object
    AgentSignal:
      properties:
        agent_id:
          format: uuid
          type:
            - string
            - "null"
        config:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        created_at:
          format: date-time
          type:
            - string
            - "null"
        description:
          type:
            - string
            - "null"
        discovery_state:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        enabled:
          type: boolean
        estimated_matches:
          type:
            - integer
            - "null"
        id:
          format: uuid
          type:
            - string
            - "null"
        label:
          type: string
        last_run_at:
          format: date-time
          type:
            - string
            - "null"
        manual_launch_cooldown_until:
          format: date-time
          type:
            - string
            - "null"
        next_run_at:
          format: date-time
          type:
            - string
            - "null"
        platform:
          type: string
        run_interval_hours:
          type: integer
        signal_category:
          type: string
        signal_key:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - agent_id
        - platform
        - signal_category
        - signal_key
        - label
        - description
        - enabled
        - config
        - estimated_matches
        - created_at
        - updated_at
        - last_run_at
        - next_run_at
        - run_interval_hours
        - manual_launch_cooldown_until
        - discovery_state
      type: object
    App:
      properties:
        created_at:
          format: date-time
          type:
            - string
            - "null"
        description:
          type:
            - string
            - "null"
        icp_description:
          type:
            - string
            - "null"
        icp_filters:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        id:
          format: uuid
          type:
            - string
            - "null"
        language:
          type: string
        logo_url:
          type:
            - string
            - "null"
        name:
          type: string
        product_brain:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        url:
          type:
            - string
            - "null"
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - user_id
        - name
        - url
        - description
        - icp_description
        - icp_filters
        - status
        - created_at
        - updated_at
        - logo_url
        - product_brain
        - language
      type: object
    Campaign:
      properties:
        agent_id:
          format: uuid
          type:
            - string
            - "null"
        app_id:
          format: uuid
          type:
            - string
            - "null"
        created_at:
          format: date-time
          type:
            - string
            - "null"
        creation_idempotency_key:
          type:
            - string
            - "null"
        creation_request_fingerprint:
          type:
            - string
            - "null"
        id:
          format: uuid
          type:
            - string
            - "null"
        list_id:
          format: uuid
          type:
            - string
            - "null"
        name:
          type: string
        settings:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        status:
          type: string
        status_changed_at:
          format: date-time
          type:
            - string
            - "null"
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - app_id
        - user_id
        - name
        - status
        - settings
        - created_at
        - updated_at
        - agent_id
        - list_id
        - creation_idempotency_key
        - creation_request_fingerprint
        - status_changed_at
      type: object
    GetContactByIDRow:
      properties:
        app_id:
          format: uuid
          type:
            - string
            - "null"
        app_name:
          type: string
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        campaign_name:
          type: string
        company:
          type: string
        created_at:
          format: date-time
          type:
            - string
            - "null"
        dedup_fingerprint:
          type: string
        derived_status:
          type: string
        enriched_email:
          type:
            - string
            - "null"
        first_name:
          type: string
        fit_status:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        linkedin_provider_id:
          type: string
        list_id:
          format: uuid
          type:
            - string
            - "null"
        list_name:
          type: string
        match_reasoning:
          type:
            - string
            - "null"
        match_score:
          type:
            - integer
            - "null"
        matched_signals:
          items:
            type: string
          type: array
        metadata:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        pinned_at:
          format: date-time
          type:
            - string
            - "null"
        platform:
          type: string
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        profile_picture_url:
          type: string
        profile_url:
          type: string
        provider_id:
          type: string
        provider_internal_id:
          type: string
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - campaign_id
        - platform_account_id
        - provider_id
        - first_name
        - last_name
        - company
        - headline
        - profile_url
        - profile_picture_url
        - status
        - metadata
        - dedup_fingerprint
        - created_at
        - updated_at
        - enriched_email
        - fit_status
        - match_score
        - match_reasoning
        - pinned_at
        - derived_status
        - campaign_name
        - app_id
        - app_name
        - platform
        - matched_signals
        - list_id
        - list_name
        - provider_internal_id
        - linkedin_provider_id
      type: object
    Lead:
      properties:
        already_connected:
          type: boolean
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        company:
          type: string
        connection_accepted_at:
          format: date-time
          type:
            - string
            - "null"
        contact_id:
          format: uuid
          type:
            - string
            - "null"
        created_at:
          format: date-time
          type:
            - string
            - "null"
        current_enrollment_id:
          format: uuid
          type:
            - string
            - "null"
        dedup_fingerprint:
          type: string
        enriched_email:
          type:
            - string
            - "null"
        first_name:
          type: string
        fit_status:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        linkedin_provider_id:
          type: string
        list_id:
          format: uuid
          type:
            - string
            - "null"
        match_reasoning:
          type:
            - string
            - "null"
        match_score:
          type:
            - integer
            - "null"
        metadata:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        mirrored_avatar_key:
          type: string
        person_key:
          type:
            - string
            - "null"
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        profile_picture_url:
          type: string
        profile_url:
          type: string
        provider_id:
          type: string
        provider_internal_id:
          type: string
        replied_at:
          format: date-time
          type:
            - string
            - "null"
        replied_at_step_id:
          format: uuid
          type:
            - string
            - "null"
        route_channel:
          type: string
        source_signal_id:
          format: uuid
          type:
            - string
            - "null"
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - campaign_id
        - platform_account_id
        - provider_id
        - first_name
        - last_name
        - company
        - headline
        - profile_url
        - status
        - metadata
        - created_at
        - updated_at
        - dedup_fingerprint
        - profile_picture_url
        - provider_internal_id
        - connection_accepted_at
        - enriched_email
        - fit_status
        - match_score
        - match_reasoning
        - replied_at
        - replied_at_step_id
        - already_connected
        - list_id
        - mirrored_avatar_key
        - contact_id
        - source_signal_id
        - route_channel
        - current_enrollment_id
        - linkedin_provider_id
        - person_key
      type: object
    LeadList:
      properties:
        app_id:
          format: uuid
          type:
            - string
            - "null"
        archived_at:
          format: date-time
          type:
            - string
            - "null"
        contact_route:
          type: string
        created_at:
          format: date-time
          type:
            - string
            - "null"
        description:
          type:
            - string
            - "null"
        id:
          format: uuid
          type:
            - string
            - "null"
        is_default:
          type: boolean
        is_review:
          type: boolean
        lead_count:
          type: integer
        name:
          type: string
        review_job_id:
          format: uuid
          type:
            - string
            - "null"
        shared_email_output_list_id:
          format: uuid
          type:
            - string
            - "null"
        shared_linkedin_output_list_id:
          format: uuid
          type:
            - string
            - "null"
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - app_id
        - user_id
        - name
        - description
        - is_default
        - lead_count
        - created_at
        - updated_at
        - is_review
        - review_job_id
        - contact_route
        - archived_at
        - shared_linkedin_output_list_id
        - shared_email_output_list_id
      type: object
    ListCampaignContactActionsRow:
      properties:
        action_type:
          type: string
        executed_at:
          format: date-time
          type:
            - string
            - "null"
        id:
          format: uuid
          type:
            - string
            - "null"
        lead_id:
          format: uuid
          type:
            - string
            - "null"
        scheduled_at:
          format: date-time
          type:
            - string
            - "null"
        status:
          type: string
        step_deleted:
          type: boolean
        step_order:
          type: integer
        workflow_step_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - lead_id
        - workflow_step_id
        - action_type
        - status
        - scheduled_at
        - executed_at
        - step_order
        - step_deleted
      type: object
    ListCampaignContactLeadsRow:
      properties:
        company:
          type: string
        created_at:
          format: date-time
          type:
            - string
            - "null"
        current_enrollment_id:
          format: uuid
          type:
            - string
            - "null"
        fallback_pending:
          type: boolean
        first_name:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        profile_picture_url:
          type: string
        profile_url:
          type: string
        provider_id:
          type: string
        replied_at:
          format: date-time
          type:
            - string
            - "null"
        replied_at_step_id:
          format: uuid
          type:
            - string
            - "null"
        status:
          type: string
      required:
        - id
        - first_name
        - last_name
        - company
        - headline
        - profile_url
        - profile_picture_url
        - provider_id
        - status
        - replied_at
        - replied_at_step_id
        - current_enrollment_id
        - created_at
        - fallback_pending
      type: object
    ListDiscoveredLeadsByUserWithListRow:
      properties:
        agent_id:
          format: uuid
          type:
            - string
            - "null"
        agent_name:
          type: string
        app_id:
          format: uuid
          type:
            - string
            - "null"
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        campaign_lead_id:
          format: uuid
          type:
            - string
            - "null"
        company:
          type: string
        contact_id:
          format: uuid
          type:
            - string
            - "null"
        created_at:
          format: date-time
          type:
            - string
            - "null"
        enrichment:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        first_name:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        linkedin_provider_id:
          type: string
        list_id:
          format: uuid
          type:
            - string
            - "null"
        list_name:
          type: string
        match_score:
          type: integer
        matched_signals:
          items:
            type: string
          type: array
        metadata:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        mirrored_avatar_key:
          type: string
        platform:
          type: string
        profile_picture_url:
          type: string
        profile_url:
          type: string
        provider_id:
          type: string
        provider_internal_id:
          type: string
        reviewed_at:
          format: date-time
          type:
            - string
            - "null"
        route_action:
          type: string
        route_channel:
          type: string
        route_reason:
          type: string
        source:
          type: string
        source_signal_id:
          format: uuid
          type:
            - string
            - "null"
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - agent_id
        - campaign_id
        - user_id
        - provider_id
        - platform
        - first_name
        - last_name
        - company
        - headline
        - profile_url
        - matched_signals
        - match_score
        - status
        - enrichment
        - metadata
        - reviewed_at
        - created_at
        - updated_at
        - list_id
        - profile_picture_url
        - provider_internal_id
        - mirrored_avatar_key
        - source
        - contact_id
        - source_signal_id
        - route_channel
        - route_action
        - route_reason
        - linkedin_provider_id
        - campaign_lead_id
        - list_name
        - agent_name
        - app_id
      type: object
    ListGlobalContactsRow:
      properties:
        agent_name:
          type: string
        app_id:
          format: uuid
          type:
            - string
            - "null"
        app_name:
          type: string
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        campaign_name:
          type: string
        company:
          type: string
        created_at:
          format: date-time
          type:
            - string
            - "null"
        dedup_fingerprint:
          type: string
        derived_status:
          type: string
        enriched_email:
          type:
            - string
            - "null"
        first_name:
          type: string
        fit_status:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        linkedin_provider_id:
          type: string
        list_name:
          type:
            - string
            - "null"
        match_score:
          type:
            - integer
            - "null"
        matched_signals:
          description: JSON value; the server permits arbitrary JSON at this field.
        metadata:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        pinned_at:
          format: date-time
          type:
            - string
            - "null"
        platform:
          type: string
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        profile_picture_url:
          type: string
        profile_url:
          type: string
        provider_id:
          type: string
        provider_internal_id:
          type: string
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - campaign_id
        - platform_account_id
        - provider_id
        - first_name
        - last_name
        - company
        - headline
        - profile_url
        - profile_picture_url
        - status
        - metadata
        - dedup_fingerprint
        - created_at
        - updated_at
        - enriched_email
        - fit_status
        - match_score
        - pinned_at
        - derived_status
        - campaign_name
        - app_id
        - app_name
        - platform
        - matched_signals
        - list_name
        - agent_name
        - provider_internal_id
        - linkedin_provider_id
      type: object
    ListLeadsByListRow:
      properties:
        already_connected:
          type: boolean
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        campaign_name:
          type: string
        campaign_status:
          type: string
        company:
          type: string
        connection_accepted_at:
          format: date-time
          type:
            - string
            - "null"
        contact_id:
          format: uuid
          type:
            - string
            - "null"
        created_at:
          format: date-time
          type:
            - string
            - "null"
        current_enrollment_id:
          format: uuid
          type:
            - string
            - "null"
        dedup_fingerprint:
          type: string
        enriched_email:
          type:
            - string
            - "null"
        first_name:
          type: string
        fit_status:
          type: string
        headline:
          type: string
        id:
          format: uuid
          type:
            - string
            - "null"
        last_name:
          type: string
        linkedin_provider_id:
          type: string
        list_id:
          format: uuid
          type:
            - string
            - "null"
        match_reasoning:
          type:
            - string
            - "null"
        match_score:
          type:
            - integer
            - "null"
        metadata:
          description: JSON value stored by the server; shape depends on this resource's configuration.
        mirrored_avatar_key:
          type: string
        person_key:
          type:
            - string
            - "null"
        platform_account_id:
          format: uuid
          type:
            - string
            - "null"
        profile_picture_url:
          type: string
        profile_url:
          type: string
        provider_id:
          type: string
        provider_internal_id:
          type: string
        replied_at:
          format: date-time
          type:
            - string
            - "null"
        replied_at_step_id:
          format: uuid
          type:
            - string
            - "null"
        route_channel:
          type: string
        source_signal_id:
          format: uuid
          type:
            - string
            - "null"
        status:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - campaign_id
        - platform_account_id
        - provider_id
        - first_name
        - last_name
        - company
        - headline
        - profile_url
        - status
        - metadata
        - created_at
        - updated_at
        - dedup_fingerprint
        - profile_picture_url
        - provider_internal_id
        - connection_accepted_at
        - enriched_email
        - fit_status
        - match_score
        - match_reasoning
        - replied_at
        - replied_at_step_id
        - already_connected
        - list_id
        - mirrored_avatar_key
        - contact_id
        - source_signal_id
        - route_channel
        - current_enrollment_id
        - linkedin_provider_id
        - person_key
        - campaign_name
        - campaign_status
      type: object
    WebhookSubscription:
      properties:
        active:
          type: boolean
        created_at:
          format: date-time
          type:
            - string
            - "null"
        events:
          items:
            type: string
          type: array
        id:
          format: uuid
          type:
            - string
            - "null"
        integration_id:
          format: uuid
          type:
            - string
            - "null"
        secret:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
        url:
          type: string
        user_id:
          format: uuid
          type:
            - string
            - "null"
      required:
        - id
        - user_id
        - integration_id
        - url
        - secret
        - events
        - active
        - created_at
        - updated_at
      type: object
    WorkflowStep:
      properties:
        attachment_content_type:
          type:
            - string
            - "null"
        attachment_filename:
          type:
            - string
            - "null"
        attachment_s3_key:
          type:
            - string
            - "null"
        campaign_id:
          format: uuid
          type:
            - string
            - "null"
        created_at:
          format: date-time
          type:
            - string
            - "null"
        delay_unit:
          type: string
        delay_value:
          type: integer
        deleted_at:
          format: date-time
          type:
            - string
            - "null"
        deleted_by:
          format: uuid
          type:
            - string
            - "null"
        id:
          format: uuid
          type:
            - string
            - "null"
        is_final:
          type: boolean
        message_mode:
          type: string
        message_template:
          type:
            - string
            - "null"
        step_order:
          type: integer
        step_type:
          type: string
        subject_template:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - "null"
      required:
        - id
        - campaign_id
        - step_order
        - step_type
        - message_template
        - delay_value
        - delay_unit
        - created_at
        - updated_at
        - message_mode
        - attachment_s3_key
        - attachment_filename
        - attachment_content_type
        - is_final
        - subject_template
        - deleted_at
        - deleted_by
      type: object
