Update agent

PATCH/v2/agents/{agentId}

Change the name, instructions, model, language or settings of an agent by sending only the fields you want to change.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

Changes one or more fields of an agent. Call it when you edit instructions or greetings from your own tooling, or when you roll a new tone of voice out to several agents.

Request

PATCH /v2/agents/{agentId}

Path parameters:

Name Type Required Description
agentId string Yes The ID of the agent, starting with agt_.

Body fields. Send only the ones you want to change, and at least one:

Name Type Required Description
name string No New display name.
instructions string No New instructions. They replace the old text in full.
model string No The model the agent answers with.
language string No Main reply language as a two-letter code.
settings object No Any of visibility, rateLimit, initialMessages and suggestedMessages.

Fields you leave out keep their value. Inside settings, the keys you send replace the stored ones and the other keys stay. Arrays such as initialMessages are replaced in full, so send an empty array to clear a list. The agent type cannot be changed after creation.

To change the look of the chat bubble, use Update agent styles.

Example request

curl -X PATCH https://api.askocto.co/v2/agents/agt_8f3k2m \
  -H "Authorization: Bearer $OCTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instructions": "Answer questions about orders, shipping and returns. Offer a return label when an item is damaged.",
    "settings": { "suggestedMessages": ["Where is my order?", "Start a return"] }
  }'
const response = await fetch("https://api.askocto.co/v2/agents/agt_8f3k2m", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.OCTO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    instructions:
      "Answer questions about orders, shipping and returns. Offer a return label when an item is damaged.",
    settings: { suggestedMessages: ["Where is my order?", "Start a return"] },
  }),
})

const agent = await response.json()
console.log(agent.updatedAt)

Example response

A successful call returns 200 OK with the updated agent.

{
  "id": "agt_8f3k2m",
  "name": "Store support",
  "type": "support",
  "status": "live",
  "model": "octo-balanced",
  "instructions": "Answer questions about orders, shipping and returns. Offer a return label when an item is damaged.",
  "language": "en",
  "createdAt": "2026-03-14T09:30:00Z",
  "updatedAt": "2026-03-21T08:12:00Z",
  "settings": {
    "visibility": "public",
    "rateLimit": {
      "enabled": true,
      "message": "You are sending messages quickly. Please wait a moment."
    },
    "initialMessages": ["Hi, how can I help?"],
    "suggestedMessages": ["Where is my order?", "Start a return"]
  }
}

Response fields

The response is the full agent object after the change. See the Agents overview for every field. updatedAt moves forward with each successful call.

Errors

Status Code When
400 invalid_request The body is empty, a field has the wrong type, or type is present.
401 unauthorized The API key is missing, malformed or deleted.
404 not_found No agent has this ID in your workspace.
429 rate_limited Too many requests. Wait for the number of seconds in the Retry-After header.

Something unclear or missing? Tell us and we will fix the page.