> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getsales.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Search agent runs

> The "why did the AI SDR do that" ledger and the Analyzer's log. filter.outcome lists replies by what became of them, approved_by_user_sid is_null splits the written into sent itself and approved, q finds one by its words or the lead's; include reply, trigger, lead, scenario, then (what the lead did next). conversation_sid with kind classify: a thread's classification history; plan_sid a plan's trail; state failed the failure review; state pending the queue. page_size 0 returns counts alone.

Contract:
- MCP tool `search_agent_runs`, registry package `mcp.unibox/agent_runs`, mount `unibox.agent`.
- Operation `search`, response envelope `search`.
- Flags: read only.



## OpenAPI

````yaml /api-reference/unibox/openapi.yaml post /api/agent-runs/search
openapi: 3.0.3
info:
  title: 'GetSales public contract: gs.service.unibox'
  description: >-
    The team inbox and the AI SDR: every LinkedIn and email thread in one place
    (conversations, messages, the timeline events), the manual tasks a thread
    spawns, the sender profiles the team speaks through with their LinkedIn
    account and mailboxes, and the one agent per team with its scenarios, plans
    and runs.


    GENERATED. This document is projected from the Zod MCP tool registry in
    `product/mcp/gs.mcp` (one tool per public endpoint, 1:1). Do not edit it by
    hand; edit the tool definition and regenerate with `pnpm openapi:public`.


    Surface: the public `/api` contract of `gs.service.unibox`, 125 operations.
    This is the only OpenAPI document the platform publishes. Internal
    (`/internal`) and health endpoints are deliberately absent: they are not
    part of any contract, they can change without notice, and the service source
    is their only description.


    Conventions:

    - Auth is a bearer JWT, optionally narrowed by the `Team-SID` header.

    - Every success body is an MCP envelope: `success: true` plus one typed
    `operation` shape (`search`, `get`, `create`, `update`, `delete`, `metrics`,
    `group_by`, `action`), and a `meta` block with `trace_id` for support.

    - Every failure is the same `McpError` envelope with a code from a fixed
    16-code taxonomy, so a client maps errors once.

    - Lists page with `page_size` (0 to 500, default 50) plus an opaque forward
    `cursor`; `page_size: 0` returns counts only.

    - On `GET` and `DELETE`, object-valued query parameters (`filter`, `sort`)
    travel as JSON text and array-valued ones repeat as `name[]=value`.

    - The MCP-only `_meta` field (usage analytics) never reaches the backend and
    is not part of this contract.
  version: '1.0'
  contact:
    name: GetSales
    url: https://getsales.io
    email: support@getsales.io
  license:
    name: Proprietary
    url: https://getsales.io/terms
servers:
  - url: https://beta.getsales.io/unibox/v1
    description: >-
      Production (the gateway path on the beta ring; the origin is provisioned
      per DEPLOY_MAP.md)
security:
  - BearerJwt: []
    TeamSid: []
tags:
  - name: agent_answers
    description: >-
      Registry package `mcp.unibox/agent_answers`, served on MCP mount
      `unibox.knowledge`.
  - name: agent_conversation_uploads
    description: >-
      Registry package `mcp.unibox/agent_conversation_uploads`, served on MCP
      mount `unibox.agent-memory`.
  - name: agent_examples
    description: >-
      Registry package `mcp.unibox/agent_examples`, served on MCP mount
      `unibox.agent-memory`.
  - name: agent_hints
    description: >-
      Registry package `mcp.unibox/agent_hints`, served on MCP mount
      `unibox.agent-memory`.
  - name: agent_plans
    description: >-
      Registry package `mcp.unibox/agent_plans`, served on MCP mount
      `unibox.agent`.
  - name: agent_runs
    description: >-
      Registry package `mcp.unibox/agent_runs`, served on MCP mount
      `unibox.agent-memory`.
  - name: agent_scenarios
    description: >-
      Registry package `mcp.unibox/agent_scenarios`, served on MCP mount
      `unibox.agent`.
  - name: agent_source_parses
    description: >-
      Registry package `mcp.unibox/agent_source_parses`, served on MCP mount
      `unibox.knowledge`.
  - name: agent_sources
    description: >-
      Registry package `mcp.unibox/agent_sources`, served on MCP mount
      `unibox.knowledge`.
  - name: agent_tests
    description: >-
      Registry package `mcp.unibox/agent_tests`, served on MCP mount
      `unibox.agent-memory`.
  - name: agents
    description: >-
      Registry package `mcp.unibox/agents`, served on MCP mount
      `unibox.website`.
  - name: conversation_events
    description: >-
      Registry package `mcp.unibox/conversation_events`, served on MCP mount
      `unibox.inbox`.
  - name: conversations
    description: >-
      Registry package `mcp.unibox/conversations`, served on MCP mount
      `unibox.inbox`.
  - name: messages
    description: >-
      Registry package `mcp.unibox/messages`, served on MCP mount
      `unibox.inbox`.
  - name: sender_profiles
    description: >-
      Registry package `mcp.unibox/sender_profiles`, served on MCP mount
      `unibox.sender-profiles`.
  - name: tasks
    description: Registry package `mcp.unibox/tasks`, served on MCP mount `unibox.inbox`.
  - name: timeline
    description: >-
      Registry package `mcp.unibox/timeline`, served on MCP mount
      `unibox.inbox`.
paths:
  /api/agent-runs/search:
    post:
      tags:
        - agent_runs
      summary: Search agent runs
      description: >-
        The "why did the AI SDR do that" ledger and the Analyzer's log.
        filter.outcome lists replies by what became of them,
        approved_by_user_sid is_null splits the written into sent itself and
        approved, q finds one by its words or the lead's; include reply,
        trigger, lead, scenario, then (what the lead did next). conversation_sid
        with kind classify: a thread's classification history; plan_sid a plan's
        trail; state failed the failure review; state pending the queue.
        page_size 0 returns counts alone.


        Contract:

        - MCP tool `search_agent_runs`, registry package
        `mcp.unibox/agent_runs`, mount `unibox.agent`.

        - Operation `search`, response envelope `search`.

        - Flags: read only.
      operationId: search_agent_runs
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchAgentRunsRequest'
      responses:
        '200':
          description: '`search` success envelope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchAgentRunsResponse'
        4XX:
          $ref: '#/components/responses/McpClientError'
        5XX:
          $ref: '#/components/responses/McpServerError'
components:
  schemas:
    SearchAgentRunsRequest:
      type: object
      description: Request body of `search_agent_runs`.
      properties:
        filter:
          type: object
          properties:
            q:
              type: string
              maxLength: 255
              description: >-
                Words of the reply or of the lead's message it answered, up to
                255 chars (the Analyzer's search).
            sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_rn_
                  description: Agent run sid (ub_rn_…).
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^ub_rn_
                    description: Agent run sid (ub_rn_…).
              additionalProperties: false
              description: Run sid(s), ub_rn_ prefix; one run in full is get_agent_run.
            agent_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_ag_
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^ub_ag_
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                The AI SDR the turns ran as (ub_ag_…, block 10, 2026-10-30): one
                agent's ledger; { is_null: true } = the rows from before the
                agents were many.
            conversation_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_cv_
                in:
                  type: array
                  items:
                    type: string
                    minLength: 18
                    maxLength: 18
                    pattern: ^ub_cv_
              additionalProperties: false
              description: >-
                Thread(s), ub_cv_ prefix: the whole run trail of one
                conversation.
            kind:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - classify
                    - plan
                    - execute_step
                    - dialog_reply
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - classify
                      - plan
                      - execute_step
                      - dialog_reply
              additionalProperties: false
              description: '{ eq: "classify" } is the classification history of a thread.'
            state:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - pending
                    - running
                    - done
                    - failed
                    - canceled
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - running
                      - done
                      - failed
                      - canceled
              additionalProperties: false
              description: >-
                { eq: "failed" } is the failure review; { eq: "pending" } is the
                queue.
            scenario_key:
              type: object
              properties:
                eq:
                  type: string
                  maxLength: 64
                in:
                  type: array
                  items:
                    type: string
                    maxLength: 64
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                Platform scenario key; { is_null: true } = runs that matched
                none (including every non-classify run).
            plan_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_pl_
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                One plan's execution trail, ub_pl_ prefix: the run that built it
                and every step run under it.
            outcome:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - written
                    - edited
                    - unsure
                    - waiting
                    - handed
                    - test
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - written
                      - edited
                      - unsure
                      - waiting
                      - handed
                      - test
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                The Analyzer's log: { is_null: false } is every row of it, { in:
                ["written", "edited", "unsure"] } the replies that went, { eq:
                "waiting" } the drafts, { eq: "test" } the rewrites.
            answer_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_an_
              additionalProperties: false
              description: >-
                The runs whose pack carried a Knowledge answer (ub_an_…,
                2026-10-26): an answer's "All in the Analyzer".
            example_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                  pattern: ^ub_eg_
              additionalProperties: false
              description: >-
                The runs that read a kept dialogue of the Golden set before
                their reply (ub_eg_…, 2026-10-27, block AC5): the dialogue's
                "the replies it was read before".
            approved_by_user_sid:
              type: object
              properties:
                eq:
                  type: string
                  minLength: 18
                  maxLength: 18
                is_null:
                  type: boolean
              additionalProperties: false
              description: >-
                The reply's approver (2026-10-27, block AC8): with outcome
                written, { is_null: true } is a reply that went out on its own
                (Sent itself), { is_null: false } one a person approved as
                written (Approved); { eq } one person's approvals.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 range; combine bounds in one object.
          description: >-
            Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt |
            lt | is_null}}; q inside it is free text. Omit for every row.
        include:
          type: array
          items:
            type: string
            enum:
              - reply
              - trigger
              - lead
              - scenario
              - hints
              - then
          description: >-
            reply (the message the run stands for: its text, the agent's
            original when a person changed it, state, who approved it), trigger
            (the lead's message it answered), lead (name, company, person),
            scenario (what it was read as), hints (what it lacked).
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - execute_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchAgentRunsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Agent run sid (ub_rn_…).
                  team_sid:
                    type: string
                    description: Owning team (ts_tm_…, external - gs.service.id).
                  agent_sid:
                    type: string
                    nullable: true
                    description: >-
                      The AI SDR the turn ran as (ub_ag_…), frozen at the
                      dispatch (block 10, 2026-10-30); null on a row from
                      before.
                  conversation_sid:
                    type: string
                    description: The thread this work ran on (ub_cv_…).
                  kind:
                    type: string
                    enum:
                      - classify
                      - plan
                      - execute_step
                      - dialog_reply
                    description: >-
                      classify = one debounced classification of an inbound
                      burst; plan = a strategize turn that builds or replaces
                      the thread plan; execute_step = one due plan step;
                      dialog_reply = one goal-led live-dialog reply.
                  state:
                    type: string
                    enum:
                      - pending
                      - running
                      - done
                      - failed
                      - canceled
                    description: >-
                      pending = armed, waiting for execute_at or a queue slot;
                      running = claimed; done / failed / canceled are terminal.
                      A turn that reports a failure after its message or its
                      plan was written is done, not tried again: the work
                      stands. canceled = the work was no longer wanted (the lead
                      wrote again, the plan was canceled or replaced, or a
                      person rewrote the step the run was working for). failed
                      means the retries were exhausted and the escalation policy
                      fired.
                  execute_at:
                    type: string
                    nullable: true
                    description: >-
                      ISO 8601 UTC the run is due at (the debounce or timer
                      clock); null = run now. Sort ascending over pending rows
                      to see what fires next.
                  trigger_message_sid:
                    type: string
                    nullable: true
                    description: >-
                      The newest inbound message that armed a classify or
                      dialog_reply (ub_ms_…). It is the freshness anchor: a
                      newer inbound cancels the run at claim time.
                  trigger_signal:
                    type: string
                    nullable: true
                    enum:
                      - awaiting_reply
                      - opened_not_replied
                      - clicked_not_replied
                      - multi_opened
                      - accepted_not_replied
                      - note_read_not_replied
                      - reacted_not_replied
                      - invited_us
                      - followed_us
                      - lead_messaged_first
                      - unanswered_inbound
                      - draft_pending
                      - escalated_open
                      - task_overdue
                      - went_quiet
                      - reactivated
                      - invite_pending
                      - connection_removed
                      - blocked_us
                      - deleted_message
                      - bounced
                      - bounced_hard
                      - complained
                      - booking_link_sent
                      - objective_reached
                      - viewed_our_profile
                      - visited_our_site
                      - visited_not_replied
                      - visited_key_page
                      - multi_visited
                      - submitted_form
                      - company_visited_our_site
                      - no_people
                      - thin_coverage
                      - nobody_reached
                      - no_engagement
                      - no_reply
                      - exhausted
                      - dormant
                      - dm_missing
                    description: >-
                      The signal that armed a plan run when no reply did
                      (accepted_not_replied, reacted_not_replied or
                      clicked_not_replied): the thread gained the name and the
                      agent owes it a move, strategized under the
                      signal_followup behavior. Null on every other run; a
                      classify landing on the thread re-arms the run and clears
                      it.
                  scenario_key:
                    type: string
                    nullable: true
                    description: >-
                      The platform scenario the classify matched, max 64 chars
                      (the vocabulary is owned by conversations). null on
                      non-classify runs.
                  confidence:
                    type: number
                    nullable: true
                    minimum: 0
                    maximum: 1
                    description: >-
                      Classification confidence, 0..1. Below the platform floor
                      it trips the low_confidence escalation.
                  extracted:
                    type: object
                    nullable: true
                    properties:
                      return_date:
                        type: string
                        description: 'Out of office: the ISO 8601 date the prospect is back.'
                      resume_date:
                        type: string
                        description: >-
                          Not now: the ISO 8601 date the prospect said to come
                          back.
                      proposed_time:
                        type: string
                        description: >-
                          Meeting or reschedule ask: the time the prospect
                          proposed, in their own words ("next week", "Thursday
                          15:00 CET"), never converted to a timestamp.
                      referred_contact:
                        type: object
                        properties:
                          name:
                            type: string
                            description: Their name, as the reply gave it.
                          role:
                            type: string
                            description: Their role or title, as the reply gave it.
                          email:
                            type: string
                            description: Their email address, as the reply gave it.
                          ln_nickname:
                            type: string
                            description: >-
                              LinkedIn vanity slug, the name after
                              linkedin.com/in/, lowercased.
                          ln_id:
                            type: string
                            description: >-
                              LinkedIn profile URN (ACoAA…), when the reply
                              linked the profile by it.
                          sn_id:
                            type: string
                            description: >-
                              Sales Navigator URN (ACwAA…), from a Sales
                              Navigator link.
                          recruiter_id:
                            type: string
                            description: Recruiter URN (AEMAA…), from a Recruiter link.
                          ln_member_id:
                            type: string
                            description: >-
                              The member id a URN decodes to, digits only: one
                              person across the three URNs.
                        description: >-
                          Referral or wrong person: the person the prospect
                          pointed at. A LinkedIn link is never stored, only the
                          identity it resolves to.
                      objection_topic:
                        type: string
                        description: >-
                          Objection: what the prospect objected to, in a few
                          words of their own.
                      objection_kind:
                        type: string
                        enum:
                          - price
                          - timing
                          - has_solution
                          - other
                        description: >-
                          Objection family (AgentRunObjectionKindEnum), when one
                          clearly fits. Logged for analysis; it is not a
                          scenario of its own.
                    description: >-
                      Entities the classify pulled out of the reply; null when
                      nothing was extracted.
                  reason:
                    type: string
                    nullable: true
                    description: >-
                      The model's own explanation of the decision, max 512
                      chars. This is what the thread timeline pill renders, and
                      what to quote when a user disputes a classification.
                  custom_scenario_sid:
                    type: string
                    nullable: true
                    description: >-
                      The custom scenario that matched (ub_sc_…), which takes
                      precedence over the built-in behavior; null when none did.
                  behavior:
                    type: string
                    nullable: true
                    enum:
                      - answer_interested
                      - meeting_request_book
                      - answer_info_request
                      - referral_capture
                      - not_now_defer
                      - ooo_delay_ping
                      - auto_reply_skip
                      - wrong_person_referral
                      - reschedule_meeting
                      - cancel_meeting
                      - return_to_orchestration
                      - close_not_interested
                      - handle_objection
                      - stoplist_do_not_contact
                      - vendor_pitch_skip
                      - acknowledge_low_signal
                      - followup_no_reply
                      - signal_followup
                      - followup_after_person
                    description: >-
                      The built-in competence module driving a plan or execute
                      run; null on classify runs and on custom-scenario-driven
                      work.
                  behavior_version:
                    type: integer
                    nullable: true
                    minimum: 1
                    description: >-
                      Version of that module at run time: the audit stamp that
                      makes a past decision reproducible.
                  playbook_source:
                    type: string
                    nullable: true
                    enum:
                      - platform
                      - edited
                      - custom
                    description: >-
                      Whose playbook the run planned under (2026-10-12):
                      platform (the seed as it ships), edited (the team's
                      version of it) or custom (a scenario of the team's own
                      with steps of its own). Stamped on a classify run that
                      planned a mechanical playbook by rule and on a plan run
                      whose pack resolved one; null on every other run.
                  playbook_version:
                    type: integer
                    nullable: true
                    minimum: 1
                    description: >-
                      That playbook's version: the seed's, or 1 on a custom
                      scenario's own steps. With behavior_version, the audit
                      says which version of whose playbook planned.
                  plan_sid:
                    type: string
                    nullable: true
                    description: >-
                      The plan created (kind plan) or executed (kind
                      execute_step), ub_pl_…; null otherwise.
                  step_id:
                    type: integer
                    nullable: true
                    minimum: 1
                    description: >-
                      Which step of plan_sid this run executed, or the
                      use_playbook step a Playbook turn rides; null on a run
                      outside a plan.
                  dialog_turn:
                    type: string
                    nullable: true
                    enum:
                      - reply
                      - stall
                      - followup
                    description: >-
                      What a Playbook dialog turn is for (2026-10-19,
                      ConversationDialogTurnEnum): reply, the reply to the
                      lead's message; stall, the offer the stall rule forces
                      after days of silence; followup, a follow-up after the
                      offer with a new angle (or the one nudge after a yes).
                      Null on every other run.
                  guidance:
                    type: string
                    nullable: true
                    description: >-
                      The user's "try again, but..." steering on a regenerate,
                      max 1024 chars. It rides the turn's context pack.
                  regenerates_message_sid:
                    type: string
                    nullable: true
                    description: >-
                      The draft the user discarded (ub_ms_…); its body joins the
                      context pack as the previous draft.
                  llm_log_ref:
                    type: string
                    nullable: true
                    description: >-
                      The runner's transcript of the turn (the SDK's stream, on
                      the runner's host), max 255 chars. It holds no context
                      pack: what a reader needs of the turn is record.
                  error_code:
                    type: string
                    nullable: true
                    description: >-
                      Terminal failure code once the retries are exhausted, max
                      64 chars; null otherwise. Group failures by it before
                      reading any transcript.
                  cost_usd:
                    type: number
                    nullable: true
                    description: >-
                      What the turn cost on the model in US dollars, as the
                      runner reported it (2026-10-19): the agent's meter. A
                      thread's spend is the sum over its runs, read in credits
                      (25 a dollar) against the agent's
                      credits_cap_per_conversation. Null on a run that never
                      reported and on rows from before.
                  example_sids:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: >-
                      The golden set rows the turn's pack carried (2026-10-20,
                      ub_eg_…, at most five, golden first): what the reply was
                      written from. Null on a turn that carried none.
                  words_caught:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        never:
                          type: string
                        times:
                          type: integer
                      required:
                        - never
                        - times
                    description: >-
                      The Words the send door refused this run's messages for
                      (2026-10-20), each with how often; the turn wrote the
                      sentence again. Null when none.
                  knowledge_miss:
                    type: string
                    nullable: true
                    description: >-
                      A classify run only: the lead's question the Knowledge
                      pick found nothing for above the floor, up to 500 chars.
                      Null otherwise.
                  outcome:
                    type: string
                    nullable: true
                    enum:
                      - written
                      - edited
                      - unsure
                      - waiting
                      - handed
                      - test
                    description: >-
                      What became of the reply the run stands for (2026-10-21,
                      the Analyzer's log): written, edited (a person changed its
                      words before it went), unsure (it went as written and the
                      lead's question found nothing in Knowledge), waiting (a
                      draft waits for an OK), handed (a hand-off took the thread
                      to a person instead), test (a rewrite, never sent). Null:
                      no row of the log.
                  approved_by_user_sid:
                    type: string
                    nullable: true
                    description: >-
                      The person who approved the reply the run stands for, as
                      its message carries it (2026-10-27, block AC8), stamped
                      with the outcome. Null on a reply that went out on its own
                      (the Analyzer's Sent itself) and on a run with no reply.
                  test_of_run_sid:
                    type: string
                    nullable: true
                    description: >-
                      A test run's original (ub_rn_…): the run whose reply
                      rewrite_agent_reply wrote again. Null on every live run.
                  test_sid:
                    type: string
                    nullable: true
                    description: >-
                      The test from a real reply this run is a turn of (ub_at_…,
                      start_agent_test on /mcp/unibox/agent-memory, 2026-10-28):
                      its classify of the lead's message or the reply written
                      after it. Null on every live run and on a rewrite's test
                      run.
                  record:
                    type: object
                    nullable: true
                    properties:
                      read:
                        type: object
                        additionalProperties: {}
                      gather:
                        type: object
                        additionalProperties: {}
                      decision:
                        type: object
                        additionalProperties: {}
                      write:
                        type: object
                        additionalProperties: {}
                      checks:
                        type: array
                        items:
                          type: object
                          additionalProperties: {}
                      tries:
                        type: integer
                      spans:
                        type: array
                        items:
                          type: object
                          additionalProperties: {}
                      mix:
                        type: object
                        additionalProperties:
                          type: number
                      made_by:
                        type: string
                        nullable: true
                      text:
                        type: string
                        nullable: true
                      edit_says:
                        type: object
                        nullable: true
                        additionalProperties: {}
                      files:
                        type: array
                        items:
                          type: object
                          properties:
                            answer_sid:
                              type: string
                            question:
                              type: string
                            name:
                              type: string
                          required:
                            - answer_sid
                            - question
                            - name
                        description: >-
                          The Knowledge files that went out with the reply
                          (block AC3, 2026-10-26): the answer each came with.
                    description: >-
                      What the turn read, decided, wrote and was checked by
                      (2026-10-21), every part optional: read (a classify's
                      ranking, signals, questions, model numbers, hand-off),
                      gather (the pack's inputs, used or only read), decision,
                      write (model, tokens, prompt parts, first draft), checks,
                      tries, spans and mix (what the reply's words came from),
                      made_by (the plan run that wrote a planned send), text (a
                      test run's reply), edit_says, files (the Knowledge files
                      that went out with the reply, block AC3). Null on older
                      runs.
                  hint_sids:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: >-
                      The Analyzer's hints the run opened or counted on its
                      completion (2026-10-26, ub_hn_…, at most ten;
                      search_agent_hints on /mcp/unibox/agent-memory): a
                      classify's missing answers, a writing turn's missing
                      dialogue. Null on a run that left none.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                required:
                  - sid
                  - team_sid
                  - agent_sid
                  - conversation_sid
                  - kind
                  - state
                  - execute_at
                  - trigger_message_sid
                  - trigger_signal
                  - scenario_key
                  - confidence
                  - extracted
                  - reason
                  - custom_scenario_sid
                  - behavior
                  - behavior_version
                  - playbook_source
                  - playbook_version
                  - plan_sid
                  - step_id
                  - dialog_turn
                  - guidance
                  - regenerates_message_sid
                  - llm_log_ref
                  - error_code
                  - cost_usd
                  - example_sids
                  - words_caught
                  - knowledge_miss
                  - outcome
                  - approved_by_user_sid
                  - test_of_run_sid
                  - test_sid
                  - record
                  - hint_sids
                  - created_at
                  - updated_at
              included:
                type: object
                properties:
                  hints:
                    type: array
                    items:
                      type: object
                      properties:
                        sid:
                          type: string
                          description: The hint (ub_hn_…).
                        kind:
                          type: string
                          description: >-
                            missing_answer (a question nothing in Knowledge
                            answers) or no_example (no close dialogue in the
                            Golden set).
                        subject:
                          type: string
                          description: What was missing, as the lead put it.
                        goes_to:
                          type: string
                          description: 'Where the fix lands: knowledge or golden_set.'
                        scenario_key:
                          type: string
                          nullable: true
                          description: The scenario of the reply that opened it.
                        status:
                          type: string
                          description: open, resolved or dismissed.
                        count:
                          type: integer
                          minimum: 1
                          description: The real replies that hit it.
                      required:
                        - sid
                        - kind
                        - subject
                        - goes_to
                        - scenario_key
                        - status
                        - count
                    description: >-
                      include hints: the hints the run hit, and the ones the
                      classify that read its trigger hit; absent where both left
                      none.
                  reply:
                    type: object
                    properties:
                      sid:
                        type: string
                        description: The message (ub_ms_…), a split reply's first part.
                      channel:
                        type: string
                        description: linkedin or email.
                      body_text:
                        type: string
                        description: >-
                          Its whole text as it went or waits, a split reply's
                          parts joined.
                      draft_body_text:
                        type: string
                        nullable: true
                        description: >-
                          The agent's own words when a person changed them
                          before it went; null when nobody did.
                      state:
                        type: string
                        description: >-
                          The message state: pending_approval, queued, sent,
                          delivered, failed or canceled.
                      parts:
                        type: integer
                        minimum: 1
                        description: How many messages it went as.
                      sent_at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC, when it went; null while it waits.
                      created_at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC, when it was written.
                      person_edited_at:
                        type: string
                        nullable: true
                        description: >-
                          ISO 8601 UTC, when a person changed it; null when
                          nobody did.
                      approved_by_user_sid:
                        type: string
                        nullable: true
                        description: The user who approved it; null when none did.
                    required:
                      - sid
                      - channel
                      - body_text
                      - draft_body_text
                      - state
                      - parts
                      - sent_at
                      - created_at
                      - person_edited_at
                      - approved_by_user_sid
                    description: 'include reply: the message the run stands for.'
                  trigger:
                    type: object
                    properties:
                      sid:
                        type: string
                        description: The lead's message (ub_ms_…).
                      body_text:
                        type: string
                        description: Its text.
                      sent_at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC.
                    required:
                      - sid
                      - body_text
                      - sent_at
                    description: >-
                      include trigger: the lead's message it answered (the run's
                      trigger, else the one of the classify that read it).
                  lead:
                    type: object
                    properties:
                      name:
                        type: string
                        nullable: true
                        description: The lead as the thread names them.
                      company:
                        type: string
                        nullable: true
                        description: >-
                          Their company, from the linked playtables person; null
                          when unlinked or unknown.
                      person_sid:
                        type: string
                        nullable: true
                        description: >-
                          The playtables person (cr_pp_…); null when the thread
                          is not linked.
                    required:
                      - name
                      - company
                      - person_sid
                    description: 'include lead: the thread''s lead.'
                  scenario:
                    type: object
                    properties:
                      run_sid:
                        type: string
                        description: The classify run (ub_rn_…).
                      scenario_key:
                        type: string
                        nullable: true
                        description: What the lead's message was read as.
                      confidence:
                        type: number
                        nullable: true
                        description: 0..1.
                    required:
                      - run_sid
                      - scenario_key
                      - confidence
                    description: 'include scenario: what the lead''s message was read as.'
                  then:
                    type: object
                    nullable: true
                    properties:
                      kind:
                        type: string
                        description: >-
                          booked, signed_up, registered (the Playbook's end),
                          their_link, confirmed_time, gave_contact (the lead's
                          own evidence), handed (a person took the thread),
                          replied (the lead wrote again), back_on (the lead
                          named a date and the plan waits until it: at is the
                          date), no_reply.
                      at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC of what happened; null on no_reply.
                    required:
                      - kind
                      - at
                    description: >-
                      include then (2026-10-27, block AC8): what the lead did
                      after the reply, the thread's outcome read from the
                      reply's send (a run with no reply, a hand-off's classify,
                      from its own time): booked, their_link, confirmed_time,
                      gave_contact, handed, replied, back_on or no_reply, with
                      when. The Analyzer's "The lead then" column. Null where
                      the thread is gone.
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: >-
                The team this call ran in (the token team, or the team_sid
                override). Null when unauthenticated; absent from pre-2026-08-20
                backends.
            actor_type:
              type: string
              nullable: true
              description: >-
                user | agent | api_key | system. Null when unauthenticated;
                absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: integer
              minimum: 0
              description: Runs matching the filter (full filter scope, not the page).
            groups:
              type: object
              properties:
                kind:
                  anyOf:
                    - type: object
                      properties:
                        classify:
                          type: integer
                          minimum: 0
                        plan:
                          type: integer
                          minimum: 0
                        execute_step:
                          type: integer
                          minimum: 0
                        dialog_reply:
                          type: integer
                          minimum: 0
                    - type: array
                      items: {}
                  description: Runs by kind; an absent key means zero.
                state:
                  anyOf:
                    - type: object
                      properties:
                        pending:
                          type: integer
                          minimum: 0
                        running:
                          type: integer
                          minimum: 0
                        done:
                          type: integer
                          minimum: 0
                        failed:
                          type: integer
                          minimum: 0
                        canceled:
                          type: integer
                          minimum: 0
                    - type: array
                      items: {}
                  description: >-
                    Runs by state; an absent key means zero. pending is queue
                    depth, failed is the health signal.
                outcome:
                  anyOf:
                    - type: object
                      properties:
                        written:
                          type: integer
                          minimum: 0
                        edited:
                          type: integer
                          minimum: 0
                        unsure:
                          type: integer
                          minimum: 0
                        waiting:
                          type: integer
                          minimum: 0
                        handed:
                          type: integer
                          minimum: 0
                        test:
                          type: integer
                          minimum: 0
                    - type: array
                      items: {}
                  description: >-
                    Runs by outcome (the Analyzer's log, 2026-10-21); an absent
                    key means zero, and a run with none is in no group.
                written:
                  anyOf:
                    - type: object
                      properties:
                        itself:
                          type: integer
                          minimum: 0
                        approved:
                          type: integer
                          minimum: 0
                    - type: array
                      items: {}
                  description: >-
                    The written replies within the filter split by the door's
                    approver (2026-10-27, block AC8): itself, nobody approved it
                    (it went out on its own); approved, a person approved it as
                    written. The Analyzer's Sent itself and Approved.
              required:
                - kind
                - state
                - outcome
                - written
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    McpError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
                - nothing_to_update
                - not_found
                - relation_not_found
                - invalid_transition
                - limit_exceeded
                - payment_required
                - duplicate_rejected
                - conflict
                - delete_blocked
                - unauthorized
                - forbidden
                - rate_limited
                - internal_error
                - service_unavailable
                - not_implemented
            message:
              type: string
            recoverable:
              type: boolean
            suggestion:
              type: string
            field_errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    rule:
                      type: string
                    message:
                      type: string
                  required:
                    - rule
                    - message
            blockers:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: >-
                      Machine-readable blocker type (active_flow, pending_tasks,
                      …).
                  severity:
                    type: string
                    enum:
                      - hard
                      - soft
                    description: >-
                      hard = external action required; soft = acknowledge is
                      enough.
                  description:
                    type: string
                  entity_sid:
                    type: string
                    nullable: true
                  count:
                    type: integer
                  resolution:
                    type: string
                    description: 'Hard: tool name to call. Soft: code for acknowledge[].'
                  resolution_hint:
                    type: string
                required:
                  - type
                  - severity
                  - description
                  - entity_sid
                  - resolution
                  - resolution_hint
            context:
              type: object
              additionalProperties: {}
          required:
            - code
            - message
            - recoverable
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: >-
                The team this call ran in (the token team, or the team_sid
                override). Null when unauthenticated; absent from pre-2026-08-20
                backends.
            actor_type:
              type: string
              nullable: true
              description: >-
                user | agent | api_key | system. Null when unauthenticated;
                absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - error
  responses:
    McpClientError:
      description: >-
        MCP error envelope. `error.code` is one of validation_failed,
        nothing_to_update, not_found, relation_not_found, invalid_transition,
        limit_exceeded, payment_required, duplicate_rejected, conflict,
        delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/McpError'
    McpServerError:
      description: >-
        MCP error envelope with `error.code` internal_error or
        service_unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/McpError'
  securitySchemes:
    BearerJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Access token issued by gs.service.id. Its `access_identity` claim
        carries `team_sid`, `actor_sid` and `actor_type`, and that team scope is
        authoritative.
    TeamSid:
      type: apiKey
      in: header
      name: Team-SID
      description: >-
        Team scope for tokens that do not carry one. Ignored when the token
        already names a team.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.