Partially update the mutable agent draft
agents:updateAuthenticationMerge-patches one mutable draft. Omitted fields are preserved. Same-value patches return updated false and retain the aggregate revision. A stale If-Match fails before any persistence.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
id*stringuuidIf-Match?stringOptional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.
application/json- body
Merge-style patch of the one mutable draft. Omitted fields are preserved.
prompt?stringNon-blank prompt template. Omit it to preserve current content; null is invalid and an empty string cannot erase runnable content.
1 <= length <= 500000pipeline_topology?stringLegacy engine selector; prefer pipeline_mode, which overrides it when both are sent. three_stage is accepted only when the deployment capability enables it, except that three_stage sent for a draft whose pipeline_mode is cascaded is the reported label being echoed back and is ignored. Most realtime STT integrations require two_stage_speechlm; the server validates the selected model's published capabilities.
"three_stage""two_stage_speechlm"pipeline_mode?stringSource-of-truth runtime pipeline selector. speech_model feeds the brain raw caller audio; cascaded feeds a realtime STT transcript to a text brain then TTS. Both modes run on the v2 turn engine, so the stored engine selector stays two_stage_speechlm; reads report pipeline_topology three_stage for cascaded and two_stage_speechlm for speech_model. Omit to preserve the current value.
"speech_model""cascaded"endpointing_mode?stringLegacy version-level turn endpointing selector; prefer behavior.turn_taking.endpointing_mode. auto uses the engine's default endpointing; stt uses STT-driven turn endpointing, which takes effect only on a cascaded pipeline with a transcriber whose stt_capabilities.endpointing in GET /providers reports capable and reliable; otherwise it falls back to auto at runtime rather than being rejected. Ignored when the same request supplies behavior: the value is then derived from behavior.turn_taking.endpointing_mode (absent means auto). Omit to preserve the current value. audio always uses the agent's own audio endpointer; auto lets Kejue pick (on the self-hosted speech recognizer that is the recognizer's own turn detection).
"auto""stt""audio"stt_language?string^[A-Za-z0-9_-]*$length <= 64stt_language_hints?array<string>Languages the caller is expected to speak, for transcribers whose auto-detection takes a hint list (providers with stt_capabilities.language_hints: true in GET /providers). Each entry is a 2–3 letter language code with an optional two-letter region, such as ar, en, or pt-br; the server trims, lower-cases, and de-duplicates the list and drops blank entries, and at most 10 distinct codes may remain (code too_many). Every code must be in the selected provider's stt_capabilities.languages catalog. Send an empty array to clear; omit to preserve. Setting a non-empty list on a transcriber without the capability is rejected with code incompatible_model; a stored list survives an STT switch and is simply not forwarded.
stt_vocabulary?|Per-agent recognition vocabulary: custom terms, free-text context notes, key/value hints, and spoken-to-written translations the recognizer should favor. Accepted when the selected transcriber advertises stt_capabilities.vocabulary: true in GET /providers (already resolved for the selected model). Send null or an empty object to clear; omit to preserve. Rejected with code incompatible_model otherwise.
behavior?Complete version-scoped behavior document. Supplying behavior replaces the previous behavior document on the mutable draft; omitted behavior leaves it unchanged. Omitted blocks and fields use the runtime defaults documented on their schemas. New writes use only this canonical shape; supported legacy inactivity and transfer rows are normalized before public responses are emitted.
llm_provider_model_id?|UUID of an enabled compatible catalog resource, or an empty string to clear the optional reference.
stt_provider_model_id?|UUID of an enabled compatible catalog resource, or an empty string to clear the optional reference.
tts_provider_model_id?|UUID of an enabled compatible catalog resource, or an empty string to clear the optional reference.
tts_voice_id?|UUID of an enabled compatible catalog resource, or an empty string to clear the optional reference.
speechlm_provider_model_id?|UUID of an enabled compatible catalog resource, or an empty string to clear the optional reference.
tts_voice_settings?Writable provider-specific override layered over the selected voice's catalog settings. The selected connector permits only its advertised subset and can impose narrower ranges; inspect voice_settings_schema in GET /providers before authoring. Send {} to clear every per-agent override. Dialect is intentionally absent because it belongs to the selected voice catalog entry.
Success
application/json- response
id*stringuuidagent_id*stringuuidupdated*booleanFalse only when the patch was a semantic no-op.
revision*integerint641 <= valueupdated_at*stringAggregate update timestamp corresponding to revision.
date-timedraft*|Full draft or immutable snapshot. Drafts have is_draft=true and omit version; immutable snapshots have is_draft=false and require their positive version number. prompt and workflow are mutually exclusive. Modern runnable rows have exactly one of them; neither is allowed only so a versionless or migrated legacy empty row remains readable and can be repaired through draft authoring.
curl -X PATCH 'https://api.kejue.co/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/draft' \ -H 'Content-Type: application/json' \ -d '{ "prompt": "You are a billing-triage assistant. Keep answers concise for {{vars.customer_tier}} callers in call {{system.call_id}}.", "pipeline_topology": "two_stage_speechlm"}'{ "id": "22222222-2222-4222-8222-222222222222", "agent_id": "11111111-1111-4111-8111-111111111111", "updated": true, "revision": 3, "updated_at": "2026-07-20T09:08:00Z", "draft": { "id": "22222222-2222-4222-8222-222222222222", "is_draft": true, "prompt": "You are a billing-triage assistant. Keep answers concise for {{vars.customer_tier}} callers in call {{system.call_id}}.", "pipeline_topology": "two_stage_speechlm", "pipeline_mode": "speech_model", "endpointing_mode": "auto", "created_at": "2026-07-20T09:00:00Z" }}