Skip to content
QwryAI
Documentation
Pages

Endpoints

Update agent

Change an agent's instructions, model, guardrails, notifications and voice through reviewed tool calls

Each area of an agent's settings has its own update tool, matching a page of the dashboard. Send only the fields you want to change; everything else keeps its value. An update never applies on the first call: it returns a review listing each change with its value before and after. Nothing changes until you apply the review with POST /public/v1/reviews/{reviewId}/apply.

This page shows update_instructions. The other update tools work the same way.

POSThttps://api.qwryai.com/public/v1/tools/update_instructions

Authentication

Send your API key as Authorization: Bearer <api-key>, or in an x-api-key header. The key needs Change agent settings. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from List agents.
expectedUpdatedAtstringYesThe updatedAt you just read from agent_configuration or get_chat_interface. If the agent changed since, the review is refused.
changesarrayOne of changes or channel_specific_instructionsUp to 20 { "field", "value" } items, one per field. See the fields below.
channel_specific_instructionsarrayOne of changes or channel_specific_instructionsUp to 9 { "channel", "instructions", "voice_instructions" } items that give one channel its own instructions.

changes fields:

fieldvalue
systemPromptThe agent's instructions, up to 12,000 characters. Send the complete new text.
behaviorSystemPromptBehavior instructions, up to 12,000 characters.
guardrailsUp to 20 rules, each up to 1,000 characters. Send the whole list.
requiredDisclaimersUp to 20 disclaimers, each up to 1,000 characters. Send the whole list.

channel_specific_instructions items:

FieldDescription
channelchat_widget, center_stage, slack, whatsapp, messenger, instagram, zendesk, zendesk_messaging, api, phone, android_sdk or ios_sdk.
instructionsThe channel's own instructions, up to 20,000 characters, used instead of the agent's instructions on that channel. null makes the channel use the agent's instructions again.
voice_instructionschat_widget and center_stage only: instructions for voice mode. null makes voice use the chat instructions again.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/update_instructions' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatbotId": "YOUR_AGENT_ID",
    "expectedUpdatedAt": "2026-11-30T21:14:08.512Z",
    "channel_specific_instructions": [
      { "channel": "whatsapp", "instructions": "Keep answers under three sentences and never use tables." }
    ]
  }'

# Apply the review it returns
curl -X POST 'https://api.qwryai.com/public/v1/reviews/REVIEW_ID/apply' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

The update tool returns the review:

JSON
{
  "success": true,
  "data": {
    "status": "review_required",
    "reviewId": "4e1d7b0a-6c2f-4f93-8a15-2b9e0d3c7a64",
    "tool": "update_instructions",
    "changes": [
      { "title": "WhatsApp: use global instructions", "before": null, "after": false },
      { "title": "WhatsApp instructions", "before": null, "after": "Keep answers under three sentences and never use tables." }
    ],
    "unchanged": [],
    "expiresAt": "2026-12-01T10:15:00.000Z",
    "next": "Show these changes to the user. Call apply_change with this reviewId only after they approve; the review expires in 15 minutes."
  }
}

Applying it returns what was saved:

JSON
{
  "success": true,
  "data": {
    "status": "succeeded",
    "reviewId": "4e1d7b0a-6c2f-4f93-8a15-2b9e0d3c7a64",
    "tool": "update_instructions",
    "data": {
      "operationId": "4e1d7b0a-6c2f-4f93-8a15-2b9e0d3c7a64",
      "chatbotId": "YOUR_AGENT_ID",
      "updatedAt": "2026-11-30T21:14:08.512Z",
      "fields": [],
      "applied": true,
      "drafted": ["ui.channels.whatsapp.syncGlobalInstructions", "ui.channels.whatsapp.instructions"],
      "coverage": "Saved to the agent draft. Customers keep the live settings until the draft is published."
    },
    "receipt": {
      "applied": true,
      "drafted": ["ui.channels.whatsapp.syncGlobalInstructions", "ui.channels.whatsapp.instructions"],
      "current": {
        "exists": true,
        "fields": {
          "ui.channels.whatsapp.syncGlobalInstructions": false,
          "ui.channels.whatsapp.instructions": "Keep answers under three sentences and never use tables."
        }
      },
      "matchesApprovedFields": true,
      "coverage": "Saved to the agent draft. Customers keep the live settings until the draft is published."
    }
  }
}
FieldDescription
changesEach change's title, before and after, for a person to approve.
unchangedFields you sent that already had that value.
expiresAtThe review works once, for this key, until this time: 15 minutes.
data.draftedSettings saved to the agent's draft. Customers get them once you publish the draft with publish_draft or in the dashboard.

Instructions, guardrails, the model, channel instructions and the Chat bubble's text and look save to the draft, as they do in the dashboard. behaviorSystemPrompt, requiredDisclaimers, the rate limit, spam detection, blocked countries, notification emails and Voice page settings go live as soon as the review is applied. See Drafts and publishing.

Other update tools

Each takes chatbotId and needs Change agent settings. All but the notification and voice tools also need expectedUpdatedAt.

ToolChangesArguments
update_modelThe model and how it answerschanges: responseModel, temperature (0 to 2), maxTokens (1 to 32,000), citationsEnabled, backstageModel, apiChannelModel, androidSdkModel, iosSdkModel. Model values come from list_available_models.
update_chat_interfaceThe Chat bubble's text and behaviourchanges such as displayName, messagePlaceholder, welcomeMessages, suggestions, aiChat and the centerStage* fields.
update_stylesThe Chat bubble's lookSee Update agent styles.
update_rate_limitGuardrails › Rate limitrate_limit: messages (1 to 200), seconds (1 to 3,600) and message.
update_spam_detectionGuardrails spam detectionspam_settings: { "enabled", "prompt" }, or null to turn it off.
update_country_blockingGuardrails blocked countriesblocked_countries: the complete list of ISO country codes, such as ["RU"]; null or [] unblocks all.
update_notification_settingsSettings › Notifications daily emailsdaily_conversations, daily_leads: each { "active", "emails" }, with up to 10 recipients.
update_voice_settingsThe Voice pagepipeline, voice, transcriber_model, initial_message, error_message, allow_interruptions, recordings and more. Needs a plan with voice.
Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/update_model' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatbotId": "YOUR_AGENT_ID",
    "expectedUpdatedAt": "2026-11-30T21:14:08.512Z",
    "changes": [{ "field": "temperature", "value": 0.5 }]
  }'

Errors

HTTP statusCodeWhen
400INVALID_ARGUMENTSA field is unknown, repeated or out of range, or neither changes nor channel_specific_instructions was sent. issues lists each problem.
400CHATBOT_ID_REQUIREDThe body has no valid chatbotId.
400TOO_MANY_CHANGESMore than 20 changes in one review.
401API_KEY_REQUIRED / INVALID_API_KEYNo credential, or an unknown, deleted or expired one.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Change agent settings.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.
404REVIEW_NOT_FOUNDApplying: no review with that id for this key.
409NOTHING_TO_CHANGEEvery value you sent is already set.
409STALE_CONFIGURATIONexpectedUpdatedAt isn't the agent's current updatedAt. Read it again.
409STALE_REVIEWApplying: the agent changed after the review. Call the tool again.
409REVIEW_EXPIRED / REVIEW_ALREADY_USEDApplying: the review is over 15 minutes old, or was already applied.
429INTEGRATION_RATE_LIMIT_EXCEEDEDMore than 2,000 requests in 15 minutes.

See Error Handling for every code.

Explore the documentation