curl --location --request PUT 'https://api.weya.live/backend/api/whatsapp/update-whatsapp-agent/6894a98a7fcde123456789ab' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"agentName": "Premium Support Assistant",
"systemMessage": "You are an expert customer support assistant.",
"sessionTimeout": 45
}'
{
"status": true,
"code": 200,
"message": "Whatsapp agent updated successfully",
"errorMessage": null,
"data": []
}
WhatsApp
Update WhatsApp Agent
Update the configuration of one of your WhatsApp agents.
PUT
/
api
/
whatsapp
/
update-whatsapp-agent
/
{agentId}
curl --location --request PUT 'https://api.weya.live/backend/api/whatsapp/update-whatsapp-agent/6894a98a7fcde123456789ab' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"agentName": "Premium Support Assistant",
"systemMessage": "You are an expert customer support assistant.",
"sessionTimeout": 45
}'
{
"status": true,
"code": 200,
"message": "Whatsapp agent updated successfully",
"errorMessage": null,
"data": []
}
Overview
Update a WhatsApp agent created by the user who owns the API key. Send only the fields you want to change. To attach the agent to a number, use Assign Agent to WhatsApp Number;phoneNumberId can’t be changed here.
Prerequisites
- An API key for your workspace
- The agent’s ID, from Get WhatsApp Agents
Request
curl --location --request PUT 'https://api.weya.live/backend/api/whatsapp/update-whatsapp-agent/6894a98a7fcde123456789ab' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"agentName": "Premium Support Assistant",
"systemMessage": "You are an expert customer support assistant.",
"sessionTimeout": 45
}'
Request Parameters
All fields are optional. They are described in Create WhatsApp Agent. Other fields are ignored.| Field | Description |
|---|---|
agentName | Name of the agent |
systemMessage | The agent’s instructions |
sessionTimeout | Minutes of user inactivity before a conversation ends |
gender | Male, Female or Other |
voice | Voice ID |
selectedLanguage | Language codes |
rag | Knowledge base vectorDbCollection |
analysisMetrics | Data to extract after each conversation |
tools, templates, library_tools | Tools and message templates |
Response
{
"status": true,
"code": 200,
"message": "Whatsapp agent updated successfully",
"errorMessage": null,
"data": []
}
Whatsapp agent updated successfully. The updated agent isn’t returned; use Get WhatsApp Agent By ID.Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
Invalid Agent ID, orOnly one send_whatsapp_start_message tool is allowed. - 401 Unauthorized – Missing or invalid API key.
- 403 Forbidden – The request sets
settings.cross_memory, which only super admins can change. - 404 Not Found –
WhatsApp agent not found: it doesn’t exist or wasn’t created by the user who owns the API key. - 429 Too Many Requests – More than 1,000 WhatsApp requests in 15 minutes from your IP address.
- 500 Internal Server Error – Unexpected server error.
Was this page helpful?

