---
title: "Update golden set row"
method: PATCH
path: "/api/agent-examples/{sid}"
tags: ["agent_examples"]
---

# Update golden set row

`PATCH /api/agent-examples/{sid}`

## Request

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

Change a golden set row: keep true puts a proposed edit in the set as golden (From your edits), tier promotes or demotes, note says when it applies, and an edited situation or answer is embedded again.

Contract:
- MCP tool `update_agent_example`, registry package `mcp.unibox/agent_examples`, mount `unibox.agent-memory`.
- Operation `update`, response envelope `update`.
- Flags: none.

## Path parameters

- `sid` string, required: Golden set row sid (ub_eg_…).

## Request body

- UpdateAgentExampleRequest: Request body of `update_agent_example`.
  - `keep` boolean: true on a proposed edit (From your edits): it joins the set as golden.
  - `tier` 'golden' | 'auto': golden promotes (and keeps a proposed row), auto demotes.
  - `note` string, nullable: When the row applies, max 512 chars; null clears it.
  - `situation` string: The situation, rewritten: the thread's names are stored as placeholders again, and the row is embedded again.
  - `context_before` string, nullable: Our message before it; the row is embedded again.
  - `answer` string: The answer, rewritten: a name of the thread's lead, their company or the sender profile is stored as its placeholder again.
  - `scenario_key` string, nullable: The scenario it belongs to.
  - `channel` 'linkedin' | 'email', nullable: The channel it answers on; null for every channel.

## Response `200`

`update` success envelope.

- UpdateAgentExampleResponse
  - `success` true, required
  - `operation` 'update', required
  - `item` object, required
    - `sid` string, required: Golden set row sid (ub_eg_…).
    - `team_sid` string, required: Owning team (ts_tm_…, external - gs.service.id).
    - `agent_sid` string, nullable, required: The AI SDR whose Golden set the row is in (ub_ag_…, block 10, 2026-10-30); null on a row from before, read as the team's default's.
    - `tier` 'golden' | 'auto', required: golden: a person vouched for it (Remember, a pair by hand, a Keep, a promotion), picked ahead; auto: learned by rule from the team's own sends.
    - `source` 'history' | 'own_send' | 'approved_edit' | 'remembered' | 'document' | 'manual', required: history (the history walk's harvest), own_send (a person's reply in a live thread), approved_edit (an agent draft a person edited), remembered, manual (a pair typed by hand), document (kept from a conversations upload, block AC5).
    - `kind` 'reply' | 'followup', required: reply: the team's answer to the lead's message; followup: our message after the lead went quiet.
    - `situation` string, required: What the answer responds to: the lead's message(s), or our unanswered message for a follow-up. Names are placeholders: {lead}, {lead_company}, {sender}.
    - `answer` string, required: The team's answer as it went out (or as the person wrote it), names as placeholders.
    - `sender_profile_sid` string, nullable, required: The sender profile that answered (ub_sp_…); null on a pair typed by hand.
    - `conversation_sid` string, nullable, required: The thread the pair was read from (ub_cv_…); null on a pair typed by hand.
    - `message_sid` string, nullable, required: The outbound message the answer is (ub_ms_…); one row per message. Null on a pair typed by hand.
    - `document_sid` string, nullable, required: The conversations upload the dialogue was kept from (ub_cu_…, block AC5); null on every other source.
    - `channel` 'linkedin' | 'email', nullable, required: The channel the answer went on; null on a pair typed by hand (read on every channel).
    - `scenario_key` string, nullable, required: The classified scenario of the situation (interested, objection, ...) when known.
    - `context_before` string, nullable, required: Our message before the lead's, the context the situation reads against; null on a follow-up.
    - `draft_text` string, nullable, required: approved_edit only: the agent's draft before the person's edit, beside the answer they sent.
    - `note` string, nullable, required: A person's note on when the row applies, max 512 chars.
    - `seen_count` integer, required: How often the same answer was met across the team's threads.
    - `used_count` integer, required: How many agent turns the row was shown to.
    - `last_used_at` string, nullable, required: ISO 8601 UTC of the last turn that read it; null when none did.
    - `answered_at` string, nullable, required: ISO 8601 UTC, when the answer went out.
    - `embedding_state` 'pending' | 'ready' | 'failed', required: pending until the vector is written, ready when the pick can read it, failed after three tries (an edit of the situation sends it back to pending).
    - `embedding_model` string, nullable, required: provider/model that wrote the vector; null while pending.
    - `golden_by` object, nullable, required: Who made the row golden; null on an auto row.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `golden_at` string, nullable, required: ISO 8601 UTC, when it became golden; null on an auto row.
    - `proposed_at` string, nullable, required: Set while an edited draft waits for a person's Keep (From your edits): such a row is never picked. Null once in the set.
    - `created_by` object, required: The actor whose write bore the row (the system for the harvest).
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `deleted_by` object, nullable, required: Who forgot it; null on a live row.
      - `actor_type` 'user' | 'support' | 'api_key' | 'system' | 'agent', required
      - `actor_sid` string, nullable, required
      - `team_sid` string, required
      - `actor_name` string, nullable: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
      - `oauth_client_sid` string, nullable: The acting OAuth client (id_oc_*); null off the OAuth path.
      - `reason` string, nullable: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
      - `permissions` object, required: Internal audit context: the grant set the actor held at write time. Not a contract.
      - `cluster_id` integer, nullable: Internal audit context: the cluster that served the write.
      - `trace_id` string, nullable: Internal audit context: the trace id of the request that wrote the row.
    - `created_at` string, required: ISO 8601 UTC.
    - `updated_at` string, required: ISO 8601 UTC.
    - `deleted_at` string, nullable, required: ISO 8601 UTC once forgotten; null on a live row.
  - `updated_fields` string[], required
  - `previous_values` object, required
  - `kept_fields` string[]: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
  - `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)
