curl --location 'https://api.weya.live/backend/api/agents/687b1c2ab7c7d3f123456789' \
--header 'x-api-key: YOUR_API_KEY'
{
"status": true,
"code": 200,
"message": "Fetched successfully",
"errorMessage": null,
"data": {
"_id": "687b1c2ab7c7d3f123456789",
"agent_name": "Sales Agent",
"gender": "Female",
"channel_type": "voice",
"conversationType": "single_prompt",
"voice": "6880aa11b7c7d3f123450000",
"systemMessage": "You are a friendly sales assistant calling {customer_name} about their order.",
"startMessage": "Hello {customer_name}, this is Asha from Example Store.",
"selectedLanguage": ["en-IN"],
"variables": ["customer_name"],
"knowledgeBase": ["687b1c2ab7c7d3f987654321"],
"latest_version": 3
}
}
Agents
Get Agent By ID
Retrieve the full configuration of one of your AI agents.
GET
/
api
/
agents
/
{id}
curl --location 'https://api.weya.live/backend/api/agents/687b1c2ab7c7d3f123456789' \
--header 'x-api-key: YOUR_API_KEY'
{
"status": true,
"code": 200,
"message": "Fetched successfully",
"errorMessage": null,
"data": {
"_id": "687b1c2ab7c7d3f123456789",
"agent_name": "Sales Agent",
"gender": "Female",
"channel_type": "voice",
"conversationType": "single_prompt",
"voice": "6880aa11b7c7d3f123450000",
"systemMessage": "You are a friendly sales assistant calling {customer_name} about their order.",
"startMessage": "Hello {customer_name}, this is Asha from Example Store.",
"selectedLanguage": ["en-IN"],
"variables": ["customer_name"],
"knowledgeBase": ["687b1c2ab7c7d3f987654321"],
"latest_version": 3
}
}
Overview
Retrieve an agent’s full configuration: prompt, start message, voice, languages, knowledge bases, call settings, tools and variables. The agent must have been created by the user who owns the API key.Prerequisites
- An API key for your workspace
- The agent’s ID, from Get Agents
Request
curl --location 'https://api.weya.live/backend/api/agents/687b1c2ab7c7d3f123456789' \
--header 'x-api-key: YOUR_API_KEY'
Response
{
"status": true,
"code": 200,
"message": "Fetched successfully",
"errorMessage": null,
"data": {
"_id": "687b1c2ab7c7d3f123456789",
"agent_name": "Sales Agent",
"gender": "Female",
"channel_type": "voice",
"conversationType": "single_prompt",
"voice": "6880aa11b7c7d3f123450000",
"systemMessage": "You are a friendly sales assistant calling {customer_name} about their order.",
"startMessage": "Hello {customer_name}, this is Asha from Example Store.",
"selectedLanguage": ["en-IN"],
"variables": ["customer_name"],
"knowledgeBase": ["687b1c2ab7c7d3f987654321"],
"latest_version": 3
}
}
The agent’s full configuration. The example shows the main fields; the response also includes call settings, tools, call analysis metrics and timestamps.
Variables used in the agent’s prompt and start message. Contacts added to a campaign should include a field for each.
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
Invalid agent ID format. - 401 Unauthorized – Missing or invalid API key.
- 404 Not Found –
Agent not found: the agent doesn’t exist or wasn’t created by the user who owns the API key. - 500 Internal Server Error – Unexpected server error.
You can use the agent ID with:
PATCH /api/agents/{id}to update the agent.DELETE /api/agents/{id}to permanently remove the agent.
Was this page helpful?

