Update an agent

Change an agent's name, description, instructions, context, welcome
message, sample tasks or model.

Send only the fields you want to change; everything else stays as it is.
Changes take effect for everyone using the agent right away. Sending
values the agent already has changes nothing.

API key: updating needs a key that acts as a user who can edit the
agent in elvex.

Avoiding lost updates: read the agent first and send its ETag
header back as If-Match:

GET /v0/agents/2qHnV8xWcT5rLm3KpZ9dYb7FsJe
→ ETag: "5d41402abc4b2a76b9719d911017c592"

PATCH /v0/agents/2qHnV8xWcT5rLm3KpZ9dYb7FsJe
If-Match: "5d41402abc4b2a76b9719d911017c592"
{"instructions": "Answer in the newsroom's style guide."}

If someone changed the agent in between, you get 412 and nothing is
saved. The response carries the new ETag for your next update.

Model: pick a model id from GET /v0/models. temperature goes
up to 1, or 2 for Google models; a higher value is refused with 422. It
is ignored, not refused, for models that don't take one, and a
temperature too high for a newly chosen model is cleared; the response
then shows temperature: null.

Sharing, Slack, Teams, integrations and data sources can't be changed
through the API. Besides plan limits, 403 means the key doesn't act as a
user, that user can't edit this agent, or your company's model access
list blocks the model for them.

Path Params
string
required

The agent's id: the last part of its address in elvex, e.g. app.elvex.ai/acme/agents/2qHnV8xWcT5rLm3KpZ9dYb7FsJe.

Body Params

Fields to change. Omitted (or null) fields keep their current values.

length ≤ 500000

Background the agent should know.

length ≤ 10000
length ≤ 500000

What the agent should do and how (shown as Rules in elvex).

UpdateAgentModel | null

The model to run on, and its temperature.

length ≤ 255
array | null

Replaces the whole list; send [] to remove them all.

length ≤ 500000
Headers

Optional. The ETag response header of the agent as you last read it (from
GET /v0/agents/{agent_id} or a previous update), sent back unchanged,
quotes included.

When present, the update only happens if nobody has changed the agent since
that read; otherwise it fails with 412 and nothing is saved. Without it, the
update always applies, even over someone else's newer change. Several
comma-separated ETags match any of them; * matches any version.

Responses

If-Match came from. Get the agent again, reapply your change and retry with the new ETag.

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json