Diska
Agents

Update an agent

Changes the agent's draft: only the fields you send change, and null clears the optional texts.
PATCH https://api.diska.ai/v1/agents/{agent_id}

Scope: agents:write

Calls keep using the published version until you publish. Voice, engine and actions are edited in the backoffice. Flow Builder agents take their text from their flows, so prompt is refused. If two changes arrive at once, the last one wins.

Parameters

Path

NameTypeRequiredDescription
agent_idstringYesThe agent's ID.

Request body

application/json

FieldTypeRequiredDescription
namestring | nullNoNew name. Up to 120 characters.
descriptionstring | nullNoNew description; null clears it. Up to 2000 characters.
promptstring | nullNoNew instructions (prompt-mode agents only). Up to 60000 characters.
greetingobject | nullNoChanges the greeting; only the fields sent change.
greeting.modestring | nullNoagent_first or human_first.
greeting.messagestring | nullNoThe greeting; null clears it. Up to 500 characters.
languagestring | nullNoLanguage, in the pt-PT format.
personalitystring | nullNoPersonality and tone; null clears it. Up to 10000 characters.
objectionsstring | nullNoHow to handle objections; null clears it. Up to 10000 characters.
knowledge_notesstring | nullNoKnowledge notes; null clears them. Up to 10000 characters.
knowledge_base_idsarray | nullNoReplaces the assigned bases with the list sent.
{
  "prompt": "És a recepcionista da Clínica Sol. Marca consultas de segunda a sexta.",
  "greeting": {
    "mode": "agent_first",
    "message": "Clínica Sol, bom dia!"
  },
  "language": "pt-PT"
}

Examples

curl -X PATCH "https://api.diska.ai/v1/agents/<agent_id>" \
  -H "Authorization: Bearer $DISKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"És a recepcionista da Clínica Sol. Marca consultas de segunda a sexta.","greeting":{"mode":"agent_first","message":"Clínica Sol, bom dia!"},"language":"pt-PT"}'

Try it

Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need.

PATCHhttps://api.diska.ai/v1/agents/{agent_id}
Starts with dsk_. It stays in this browser tab only.
path
Enter an API key (dsk_…).

Response 200

FieldTypeDescription
idstringAgent ID.
namestringAgent name.
slugstringReadable agent identifier.
descriptionstring | nullDescription, or null.
statusstringdraft, active, inactive or archived. A published agent is active.
agent_typestringinbound, outbound, voice_widget or chat.
editing_modestringprompt or flow (Flow Builder). It does not change after creation. Default: prompt.
versionintegerAgent version number. Default: 1.
phone_numberstring | nullNumber assigned to the agent, or null.
public_channel_enabledbooleantrue when the agent's public link is on. Default: false.
created_atstringCreation date (ISO 8601).
updated_atstringLast change date (ISO 8601).
configurationobjectThe editable configuration (the draft).
configuration.promptstring | nullThe agent's instructions (prompt-mode agents only; null for Flow Builder agents).
configuration.greetingobjectHow the conversation opens.
configuration.greeting.modestringagent_first (the agent speaks first) or human_first (it waits for the person). Default: agent_first.
configuration.greeting.messagestring | nullThe greeting, or null.
configuration.languagestring | nullConversation language, for example pt-PT.
configuration.personalitystring | nullPersonality and tone.
configuration.objectionsstring | nullHow to handle objections.
configuration.knowledge_notesstring | nullKnowledge notes written on the agent.
configuration.knowledge_base_idsarrayAssigned knowledge bases.
has_unpublished_changesbooleantrue when the draft differs from the published version. Default: false.
{
  "id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
  "name": "Exemplo",
  "slug": "recepcao",
  "description": "CRM — produção",
  "status": "draft",
  "agent_type": "inbound",
  "editing_mode": "prompt",
  "version": 3,
  "phone_number": "+244900000000",
  "public_channel_enabled": false,
  "created_at": "2026-10-25T18:40:00Z",
  "updated_at": "2026-10-25T18:40:00Z",
  "configuration": {
    "prompt": "…",
    "greeting": {
      "mode": "agent_first",
      "message": "…"
    },
    "language": "…",
    "personality": "…",
    "objections": "…",
    "knowledge_notes": "…",
    "knowledge_base_ids": [
      "…"
    ]
  },
  "has_unpublished_changes": false
}

Errors

CodeWhen
404Agente não encontrado. — the agent does not exist in this organization.
404Base de conhecimento não encontrada. — one of the knowledge_base_ids does not exist.
409The agent is archived, or prompt was sent for a Flow Builder agent.
422An unknown field, a value out of bounds, or null in name, prompt, greeting or language.

Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

Copyright © 2026