Skip to main content
The Update Voice Agent API uses the same request/response shape as Create Voice Agent, but you must include agent_id to identify which agent to update. Only agent_id is required — include any other fields you want to change.

API Endpoint

POST /api/v1/global/create-agent Content-Type: application/json Authentication: Required (Token header: token)

Request Body

{
  "agent_id": 123,
  "agent_name": "Updated Support Agent",
  "description": "Updated description",
  "prompt": "Updated prompt/instructions",
  "timezone": "Asia/Kolkata",
  "greeting": "Hello and welcome",
  "session_data_webhook": "https://www.tryunleashx.com/webhooks/session-data",
  "voice": {
    "provider": "elevenlabs",
    "voice_id": "RXe6OFmxoC0nlSWpuCDy",
    "model": "eleven_turbo_v2_5",
    "settings": {
      "stability": 0.5,
      "voice_style": 1,
      "speed": 1.0
    }
  },
  "speech_to_text": {
    "provider": "deepgram",
    "model": "nova-2",
    "language": "english"
  },
  "llm": {
    "llm": "gpt-4o",
    "model": "gpt-4o"
  },
  "configurations": {
    "confidence_threshold": 0.8,
    "do_not_call_detection": true
  }
}

Required Fields

FieldTypeDescription
agent_idintegerID of the agent to update (required)

Optional Fields

All other fields follow the same definitions as the Create Voice Agent API — include only the fields you want to update.

Response

Success Response

Status Code: 200 OK
{
  "success": true,
  "message": "Voice agent updated successfully",
  "data": {
    "agent_id": 123,
    "agent_name": "Updated Support Agent"
  }
}

Error Responses

400 Bad Request

{
  "error": true,
  "message": "Agent ID is required"
}

401 Unauthorized

{
  "error": true,
  "message": "Invalid Auth Key or Session Expired"
}

404 Not Found

{
  "error": true,
  "message": "Agent not found"
}

422 Unprocessable Entity

{
  "error": true,
  "message": "Validation error message"
}

Example Requests

# Update agent using agent_id in request body
curl -X POST https://www.tryunleashx.com/api/v1/global/create-agent \
  -H "Content-Type: application/json" \
  -H "token: your_api_token_here" \
  -d '{
    "agent_id": 123,
    "agent_name": "Updated Support Agent",
    "prompt": "You are an updated helpful support agent.",
    "voice": {
      "provider": "elevenlabs",
      "voice_id": "RXe6OFmxoC0nlSWpuCDy"
    }
  }'
# Or using agent_id as query parameter
curl -X POST "https://www.tryunleashx.com/api/v1/global/create-agent?agent_id=123" \
  -H "Content-Type: application/json" \
  -H "token: your_api_token_here" \
  -d '{
    "agent_name": "Updated Support Agent",
    "prompt": "You are an updated helpful support agent."
  }'

Notes

  • Only include fields you want to update; omitted fields will remain unchanged.
  • The agent must exist and belong to your workspace.
  • For available options for voice.provider, speech_to_text.provider, speech_to_text.language, llm models, and tts_model, refer to the Create Voice Agent API documentation.
  • The agent_id can be provided either in the request body or as a query parameter.