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

# Rewrite agent reply as a test

> Write an AI SDR reply again as a test, after a fix: a turn of the kind that made it, over its kept context with the Knowledge and the golden set picked again for the same message, checked like any reply and never sent. result.run is the test run (outcome test): read it with get_agent_run until it is done (its words in record.text) or failed. 409 rewrite_unavailable (written before turns were kept, or 90 days ago), rewrite_of_test; 503 runtime_unavailable.

Contract:
- MCP tool `rewrite_agent_reply`, registry package `mcp.unibox/agent_runs`, mount `unibox.agent-memory`.
- Operation `action`, response envelope `action`.
- Flags: none.



## OpenAPI

````yaml /api-reference/unibox/openapi.yaml post /api/agent-runs/{sid}/rewrite
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/{sid}/rewrite:
    post:
      tags:
        - agent_runs
      summary: Rewrite agent reply as a test
      description: >-
        Write an AI SDR reply again as a test, after a fix: a turn of the kind
        that made it, over its kept context with the Knowledge and the golden
        set picked again for the same message, checked like any reply and never
        sent. result.run is the test run (outcome test): read it with
        get_agent_run until it is done (its words in record.text) or failed. 409
        rewrite_unavailable (written before turns were kept, or 90 days ago),
        rewrite_of_test; 503 runtime_unavailable.


        Contract:

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

        - Operation `action`, response envelope `action`.

        - Flags: none.
      operationId: rewrite_agent_reply
      parameters:
        - name: sid
          in: path
          required: true
          description: >-
            The run whose reply is written again (ub_rn_…), a row of the
            Analyzer's log; a test run is 409 rewrite_of_test.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ub_rn_
            description: >-
              The run whose reply is written again (ub_rn_…), a row of the
              Analyzer's log; a test run is 409 rewrite_of_test.
      responses:
        '200':
          description: '`action` success envelope.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RewriteAgentReplyResponse'
        4XX:
          $ref: '#/components/responses/McpClientError'
        5XX:
          $ref: '#/components/responses/McpServerError'
components:
  schemas:
    RewriteAgentReplyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            run:
              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
              description: >-
                The test run as it stands after the dispatch: the maker's kind
                on the same thread, outcome test, test_of_run_sid the run asked
                about, born running. Read it back with get_agent_run until it is
                done (its words in record.text) or failed (error_code).
          required:
            - run
        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
        - operation
        - action
        - item
        - result
        - 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.