POST
/
update-agent
Update agent's setup
curl --request POST \
  --url https://app.phonely.ai/api/update-agent \
  --header 'Content-Type: application/json' \
  --header 'X-Authorization: <api-key>' \
  --data '{
  "uid": "<string>",
  "agentId": "<string>",
  "orgId": "<string>",
  "voiceId": "<string>",
  "agentName": "<string>",
  "greetingMessage": "<string>",
  "humanizeConversation": true,
  "conversationStyle": "<string>"
}'
{
  "success": true
}

Update Agent

Updates various settings and configurations for an existing agent.

Request

Method: POST
Endpoint: /api/update-agent
Headers:
  • X-Authorization: Your API key (required)
  • Content-Type: application/json
Request Body:
{
  "uid": "string",
  "agentId": "string",
  "voiceId": "string",
  "agentName": "string",
  "greetingMessage": "string",
  "humanizeConversation": boolean,
  "conversationStyle": "string",
  "orgId": "string"
}
Parameters:
  • uid (string, required): Your user ID
  • agentId (string, required): The ID of the agent to update
  • voiceId (string, optional): ID of the voice to use for the agent
  • agentName (string, optional): New name for the agent (max 50 characters)
  • greetingMessage (string, optional): New greeting message (max 500 characters)
  • humanizeConversation (boolean, optional): Whether to humanize the conversation
  • conversationStyle (string, optional): Style of conversation. Must be one of: “Casual”, “Humorous”, “Direct”, “Formal”, “Persuasive”, “Friendly”
  • orgId (string, optional): Organization ID to move the agent to

Response

Success Response (200):
{
  "success": true
}
Error Responses:
  • 400 Bad Request: Invalid request body, invalid voice ID, agent name too long, greeting message too long, invalid conversation style, or agent already in organization
  • 401 Unauthorized: Invalid or missing API key, or insufficient permissions
  • 500 Internal Server Error: Server error

Example

curl -X POST https://app.phonely.ai/api/update-agent \
  -H "X-Authorization: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "uid": "user123",
    "agentId": "agent456",
    "agentName": "Updated Agent Name",
    "greetingMessage": "Hello! How can I help you today?",
    "conversationStyle": "Friendly",
    "humanizeConversation": true
  }'

Authorizations

X-Authorization
string
header
required

Body

application/json
uid
string
required

User ID

agentId
string
required

Agent ID to update

orgId
string

Organization ID to update

voiceId
string

ID of the voice to assign to the agent

agentName
string

Name of the agent, limited to 50 characters

greetingMessage
string

Greeting message to be used when the agent is called, limited to 500 characters

humanizeConversation
boolean

Add a vocal ticks such as hmm, umm etc. to your conversation.

conversationStyle
string

'Casual' | 'Humorous' | 'Direct' | 'Formal' | 'Persuasive' | 'Friendly'

Response

Agent updated successfully

success
boolean

Indicates if the update was successful