Voice Agents

Create a voice agent

Creates a voice agent in draft status. The agent is not reachable until it is deployed.

POST
/v1/agents/voice/agents

Authorization

personalAccessToken
AuthorizationBearer <token>

Personal Access Token of a Dynamiq user — the only credential accepted by the management API (api.*). Prefix dyn_pat_ (legacy uak_ tokens still authenticate). Send as Authorization: Bearer <token>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/agents/voice/agents" \  -H "Content-Type: application/json" \  -d '{    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",    "name": "string",    "config": {      "instructions": "string"    }  }'
{
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "description": "string",
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "status": "draft",
    "config": {
      "name": "Voice Agent",
      "instructions": "string",
      "welcome_message": "string",
      "mode": "pipeline",
      "stt": {
        "provider": "string",
        "model": "string",
        "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
        "language": "string",
        "voice": "string",
        "base_url": "string",
        "temperature": 0,
        "options": {}
      },
      "llm": {
        "provider": "string",
        "model": "string",
        "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
        "language": "string",
        "voice": "string",
        "base_url": "string",
        "temperature": 0,
        "options": {}
      },
      "tts": {
        "provider": "string",
        "model": "string",
        "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
        "language": "string",
        "voice": "string",
        "base_url": "string",
        "temperature": 0,
        "options": {}
      },
      "realtime": {
        "provider": "string",
        "model": "string",
        "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
        "language": "string",
        "voice": "string",
        "base_url": "string",
        "temperature": 0,
        "options": {}
      },
      "tools": [
        {
          "name": "string",
          "description": "string",
          "method": "GET",
          "url": "string",
          "headers": [
            {
              "key": "string",
              "value": "string"
            }
          ],
          "params": [
            {
              "name": "string",
              "type": "string",
              "in": "path",
              "description": "string",
              "required": true
            }
          ],
          "long_running": false,
          "timeout_s": 10
        }
      ],
      "client_tools": [
        {
          "name": "string",
          "description": "string",
          "params": [
            {
              "name": "string",
              "type": "string",
              "description": "string",
              "required": true
            }
          ],
          "expects_response": true,
          "long_running": false,
          "timeout_s": 10
        }
      ],
      "mcp_servers": [
        {
          "name": "string",
          "url": "string",
          "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",
          "headers": [
            {
              "key": "string",
              "value": "string"
            }
          ],
          "allowed_tools": [
            "string"
          ],
          "long_running": false
        }
      ],
      "transfer": {
        "enabled": false,
        "phone_number": "string",
        "destinations": [
          {
            "label": "string",
            "phone_number": "string"
          }
        ]
      },
      "end_call_enabled": true,
      "recording_enabled": true,
      "advanced": {
        "max_call_duration_s": 1800,
        "idle_timeout_s": 75,
        "max_tool_steps": 6,
        "eos_silence_ms": 400,
        "turn_sensitivity": "auto",
        "preemptive_tts": true,
        "noise_cancellation": "auto",
        "allow_interruptions": true,
        "background_sound": "none"
      }
    },
    "agent_name": "string",
    "deploy_error": "string",
    "deployed_at": "2019-08-24T14:15:22Z",
    "phone_numbers": [
      "string"
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "deleted_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "bad_request",
    "message": "Bad Request",
    "details": {
      "input": "cannot be blank"
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Unauthorized"
  }
}