Set this agent's system prompt
Set or edit the agent’s system prompt. A new version only if it changed.
Always 200 on success — callers read action, not the status code.
action: "unchanged" is the most important field in this API. The whole
reason Phase 3c exists is that the same edit through the manifest hashed
identically, deduped, and returned 200 having discarded the write. A no-op
that reports itself is fine; a change that reports success and does nothing
is the failure mode.
pinned_warning does the same job for the pin case: editing while pinned
writes the version, KEEPS the pin, and says so — rather than silently
un-pinning (breaking version stability) or silently no-op’ing.
Authorizations
Enter your API key (e.g. dai_sk_test_key_001)
Path Parameters
Cookies
Body
Body of PUT /api/v1/agents/{agent_name}/prompt.
system_prompt is Optional[str] here despite being REQUIRED, for the same
reason CreateAgentRequest.agent_name is (:517-524): declaring it str
would make an ABSENT field a 422 while an EMPTY one is a 400, so a caller
would have to handle two error shapes for one mistake. Optional plus an
explicit check routes absent, empty and whitespace-only through one 400.
The agent's system prompt. A byte-identical write is accepted and reported as action: "unchanged" rather than creating a version.
Optional note on this version, e.g. 'tightened refund wording'.
200Optimistic concurrency. Supply the content_hash you last read and the write is refused with 409 if someone else has since changed the prompt. Omit for last-write-wins.
Response
Successful Response
The response is of type Response Set Agent Prompt Api V1 Agents Agent Name Prompt Put · object.