---
title: "Add agent reply fix"
method: POST
path: "/api/agent-runs/{sid}/apply-fix"
tags: ["agent_runs"]
---

# Add agent reply fix

`POST /api/agent-runs/{sid}/apply-fix`

## Request

- Base URL: `https://beta.getsales.io/unibox/v1`
- URL: `https://beta.getsales.io/unibox/v1/api/agent-runs/{sid}/apply-fix`
- Auth: HTTP bearer and API key in header `Team-SID`

Add the fix route_agent_fix drafted, as drafted or edited, through its place's own verb: the answer to Knowledge, the golden reply, the Brief line, the voice line, the Rules field, the line under the step's instructions. result.applied says what was added and what stood before (for Undo through the place's own verb); result.hints_resolved the reply's open hints it resolved. 409 brief_section_missing, scenario_missing, scenario_step_missing, scenario_step_full; 422 a Rules value out of range.

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

## Path parameters

- `sid` string, required: The run whose reply the fix is about (ub_rn_…): a row of the Analyzer's log, from search_agent_runs.

## Request body

- ApplyAgentFixRequest: Request body of `apply_agent_fix`.
  - `proposal` union, required: route_agent_fix's proposal, as the person left it: { place: "knowledge", title, text }, { "golden_set", situation, answer }, { "brief", section, line }, { "voice", line, text }, { "rules", field, value }, { "scenario", scenario, step, line }
    - object
      - `place` 'knowledge', required
      - `title` string, required: The question leads ask, as they put it, which the answer answers (1..120 chars).
      - `text` string, required: The answer: plain sentences that stand on their own (1..1200 chars).
    - object
      - `place` 'golden_set', required
      - `situation` string, required: What the lead wrote, the message the reply answered (1..2000 chars).
      - `answer` string, required: The reply as it should have gone, exactly as it would go out (1..2000 chars).
    - object
      - `place` 'brief', required
      - `section` string, required: The Brief's section the line goes under, by its own heading as route_agent_fix named it.
      - `line` string, required: The line added at the end of that section, one or two plain sentences (1..300 chars).
    - object
      - `place` 'voice', required
      - `line` string, required: Which of the voice's four lines the fix sets: length, questions, register or sign_off (AgentVoiceValue::LINES, a list on the Value, not an enum).
      - `text` string, required: The whole line as it should read from now on, in a few words to the agent (1..160 chars); set and pinned as update_agent_voice sets it.
    - object
      - `place` 'rules', required
      - `field` string, required: The Rules field by its dotted path as route_agent_fix named it: reply_words.linkedin.max, meeting_ask, reply_delay_minutes.min, quiet_hours.from, weekends, followups, followup_days, checks.stop_words and the rest of get_agent_rules.
      - `value` union, required: The new value within what the field takes (a whole number in its range, true or false, a choice of the enum, a time as HH:MM); the Rules refuse one outside it (422).
        - string
        - number
        - boolean
    - object
      - `place` 'scenario', required
      - `scenario` string, required: The scenario the line goes on: a platform scenario's key (info_request) or the team's own scenario's sid (ub_sc_…), as route_agent_fix named it.
      - `step` string, required: The id of the step the line goes on (reply, playbook, nudge…), one of the scenario's steps as route_agent_fix listed them.
      - `line` string, required: The instruction added under the step's instructions, one or two plain sentences to the agent (1..300 chars).

## Response `200`

`action` success envelope.

- ApplyAgentFixResponse
  - `success` true, required
  - `operation` 'action', required
  - `action` string, required: kebab-case verb; matches the route segment.
  - `item` unknown, required
  - `result` object, required
    - `applied` object, required: What was added. It is taken back through the place's own verbs: delete_agent_answer, delete_agent_example, update_agent with the Brief, update_agent_voice, update_agent_rules, update_agent_scenario with the step's instructions without the line.
      - `place` 'knowledge' | 'golden_set' | 'brief' | 'voice' | 'rules' | 'scenario', required: Where it was added.
      - `sid` string, nullable, required: The answer (ub_an_…) or the golden row (ub_eg_…) it became; scenario: the scenario's key or sid the line went on; null for a Brief line, a voice line and a Rules field.
      - `section` string, nullable, required: Where inside the place: brief: the section the line went under, by its heading; voice: the line set (length, questions, register, sign_off); rules: the field's path; scenario: the step's id; null otherwise.
      - `line` string, nullable, required: What was added, as words: brief and scenario: the line; voice: the line's text; rules: the value (on or off for a switch); null otherwise.
      - `was` union, required: What stood before, for Undo: voice: the line's text (null when none, so Undo lets the line go with update_agent_voice); rules: the value before (put back with update_agent_rules); null otherwise.
        - string
        - number
        - boolean
        - unknown
    - `hints_resolved` string[], required: The hints (ub_hn_…) the fix resolved (block AC7, 2026-10-27): the open ones of the place the reply hit, Knowledge for a missing answer, the Golden set for a missing dialogue, resolved by what the fix became with this run named on the hint's history; [] otherwise.
  - `meta` object, required
    - `trace_id` string, required: UUID v7; same 128-bit value as the X-Trace-Id header.
    - `span_id` string, required: 16 hex chars, root span of this request.
    - `timestamp` string, required: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
    - `duration_ms` integer, required: Server-side wall clock.
    - `team_sid` string, nullable: 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` string, nullable: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.

## Other responses

- `4XX`: 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.
- `5XX`: MCP error envelope with `error.code` internal_error or service_unavailable.

---

[API](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-unibox.md) - [All operations](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-unibox/llms.txt) - [OpenAPI document](https://skmtc.dev/getsales/apis/getsales-public-contract-gs-service-unibox/revisions/8f1bc317897f?raw)
