Skip to main content
PUT
Set this agent's system prompt

Authorizations

Authorization
string
header
required

Enter your API key (e.g. dai_sk_test_key_001)

Headers

Authorization
string
X-Workspace-Id
string | null

Path Parameters

agent_name
string
required

Cookies

decimal_session
string | null

Body

application/json

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.

system_prompt
string | null

The agent's system prompt. A byte-identical write is accepted and reported as action: "unchanged" rather than creating a version.

label
string | null

Optional note on this version, e.g. 'tightened refund wording'.

Maximum string length: 200
if_match_content_hash
string | null

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