Skip to content
DhvaneeDocs
Dashboard
On this page

Agents API

List, create, rename, publish and delete the voice agents of your workspace, and read their saved workflow and published versions.

An agent is what answers and makes your calls. This API manages the agents of the key's workspace from your own systems. Prompts, voices, languages and tools are set in the dashboard; see Voice agents.

The machine-readable contract is openapi.public.yaml. Download it for clients and codegen. This site has no live Try-it console.
An agent made with POST /v1/agents is a single-prompt agent that starts from your workspace's default prompt. Through the API you can change its name, publish it, read its published versions and delete it. Open it in the dashboard to write its prompt, choose its voice and language and add functions. Conversational-flow agents are made in the dashboard.

Scopes

  • agents:read for GET
  • agents:write for POST, PATCH, PUT, DELETE and publish

The agent object

FieldTypeNotes
idstring (UUID)Set by Dhvanee.
namestringUp to 128 characters.
languagestring or nullThe agent's first language, for example en-IN.
publishedbooleanfalse until the agent is published.
workflowobject or nullThe saved canvas of a conversational-flow agent. null for a single-prompt agent and until a canvas is saved.
{"id": "ff296ea3-5c61-436e-9ed9-77aba6fcc4fc", "name": "Front desk", "language": "en-IN", "published": false, "workflow": null}

List agents

Newest first. The response holds every agent in the workspace; there is no paging.

curl -sS -X GET "https://api.stage.dhvanee.com/v1/agents" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
{"items": [{"id": "ff296ea3-...", "name": "Front desk", "language": "en-IN", "published": true, "workflow": null}]}

Create an agent

name is optional, up to 128 characters. Without one the agent is called Untitled agent. Returns 201 with the agent. It is not published yet, so it takes no calls until you publish it.

curl -sS -X POST "https://api.stage.dhvanee.com/v1/agents" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Front desk"}'

Read, rename and delete one agent

curl -sS -X GET "https://api.stage.dhvanee.com/v1/agents/AGENT_ID" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
curl -sS -X PATCH "https://api.stage.dhvanee.com/v1/agents/AGENT_ID" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Front desk (Hindi)"}'
curl -sS -X DELETE "https://api.stage.dhvanee.com/v1/agents/AGENT_ID" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
  • PATCH changes the name only, and name is required (1 to 128 characters).
  • DELETE returns 204. Phone numbers and campaigns that used the agent are left with no agent until you choose another one.

Publish an agent

Makes the agent's current settings live for new calls. Returns the agent with published: true. Calls already in progress are not changed.

curl -sS -X POST "https://api.stage.dhvanee.com/v1/agents/AGENT_ID/publish" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
A conversational-flow agent publishes the canvas you saved: that canvas becomes the next version and goes live, the same as Publish in the studio. If there is no saved canvas the answer is 400 (No workflow to publish — save the Agent canvas first).

The workflow (canvas)

A conversational-flow agent keeps its steps as a canvas. Read it with GET and replace the whole canvas with PUT. Saving the canvas does not publish it.

curl -sS -X GET "https://api.stage.dhvanee.com/v1/agents/AGENT_ID/workflow" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
{"workflow": null}

workflow is null until a canvas has been saved. PUT takes the same canvas the dashboard saves, inside graph:

curl -sS -X PUT "https://api.stage.dhvanee.com/v1/agents/AGENT_ID/workflow" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "graph": {
    "nodes": {
      "start_node": {
        "type": "start",
        "label": "Start",
        "edge_order": [
          "start_to_greet"
        ]
      },
      "greet": {
        "type": "override_agent",
        "label": "Greeting",
        "additional_prompt": "Greet the caller and ask how you can help.",
        "edge_order": [
          "greet_to_end"
        ]
      },
      "end_node": {
        "type": "end",
        "label": "Ending"
      }
    },
    "edges": {
      "start_to_greet": {
        "source": "start_node",
        "target": "greet",
        "forward_condition": {
          "type": "unconditional"
        }
      },
      "greet_to_end": {
        "source": "greet",
        "target": "end_node",
        "forward_condition": {
          "type": "llm",
          "condition": "The caller is finished."
        }
      }
    }
  }
}'
RuleError (400)
nodes is a non-empty object and edges is an objectWorkflow graph.nodes must be a non-empty object
A node called start_node of type startWorkflow must include start_node
At least one node of type endWorkflow must include at least one end node
Every edge points at nodes that existEdge ... references unknown nodes
A canvas saved on a single-prompt agent is stored but does not change how that agent answers calls.

Published versions

Each time you publish changed settings, a version is recorded. Publishing again with nothing changed does not add one.

curl -sS -X GET "https://api.stage.dhvanee.com/v1/agents/AGENT_ID/versions" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
curl -sS -X GET "https://api.stage.dhvanee.com/v1/agents/AGENT_ID/versions/1" \
  -H "Authorization: Bearer dhvanee_live_YOUR_KEY"
FieldNotes
versionWhole number from 1.
published_atWhen it went live (ISO 8601).
workflowWhat was published. For a conversational-flow agent nodes and edges hold the canvas. For a single-prompt agent they are empty and prompt_config holds the settings: system_prompt, first_message, voice_id, languages, llm, knowledge_document_ids, prompt_functions and more.

Keys that look like secrets (names with secret, password, token, api_key or credential) are removed from every response.

Errors

StatusWhen
401No key, or an unknown or revoked key (Valid API key is required).
403The key lacks the scope (API key needs agents:write scope).
404No agent with that id in this workspace (Agent not found), or no such version (Workflow version 1 not found).
400An invalid canvas (table above), or an agent that cannot be published yet.
422A body that is not valid: an empty name on rename, a missing graph, or an id that is not a UUID.

To attach knowledge documents to an agent, see the Knowledge API. Limits and keys: Authentication, Rate limits.

Agents API · Dhvanee Docs