curl --request GET \
--url https://api.voice.mergenlab.ai/v1/campaign-agents/{agentId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.voice.mergenlab.ai/v1/campaign-agents/{agentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voice.mergenlab.ai/v1/campaign-agents/{agentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "agt_credfin_predue_m",
"name": "Credfin pre-due (Hindi, male)",
"language": "hi-IN",
"active": true,
"required_variables": [
"borrower_first_name",
"emi_amount",
"due_date"
],
"optional_variables": [
"lender_name"
],
"default_variables": {
"lender_name": "Credfin"
},
"post_call_variables": [
{
"name": "payment_date",
"type": "date",
"description": "Date the customer said they will pay",
"options": []
},
{
"name": "callback_at",
"type": "datetime",
"description": "When the customer asked to be called back",
"options": []
}
],
"outcomes": [
"confirmed_on_time",
"paid_early",
"callback_scheduled",
"do_not_call",
"wrong_number",
"refused",
"not_reached"
],
"outcome_roles": {
"success": [
"confirmed_on_time",
"paid_early"
],
"do_not_call": [
"do_not_call"
],
"callback": [
"callback_scheduled"
],
"wrong_number": [
"wrong_number"
]
},
"outcome_roles_source": "suggested",
"callback_variable": "callback_at",
"calling_window": {
"start": "09:00",
"end": "19:00"
},
"numbers": [
{
"number": "+9180XXXXXX79",
"is_default": true,
"status": "active",
"pool_paused": false,
"health": "good",
"usable": true
},
{
"number": "+9180XXXXXX80",
"is_default": false,
"status": "active",
"pool_paused": true,
"health": null,
"usable": false
}
],
"has_outbound_number": true,
"contract_source": "live"
}Get one agent as a campaign sees it
One agent of your account with its variables, outcomes, outcome roles, numbers and calling window. An inactive agent is returned too, with active set to false.
curl --request GET \
--url https://api.voice.mergenlab.ai/v1/campaign-agents/{agentId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.voice.mergenlab.ai/v1/campaign-agents/{agentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voice.mergenlab.ai/v1/campaign-agents/{agentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "agt_credfin_predue_m",
"name": "Credfin pre-due (Hindi, male)",
"language": "hi-IN",
"active": true,
"required_variables": [
"borrower_first_name",
"emi_amount",
"due_date"
],
"optional_variables": [
"lender_name"
],
"default_variables": {
"lender_name": "Credfin"
},
"post_call_variables": [
{
"name": "payment_date",
"type": "date",
"description": "Date the customer said they will pay",
"options": []
},
{
"name": "callback_at",
"type": "datetime",
"description": "When the customer asked to be called back",
"options": []
}
],
"outcomes": [
"confirmed_on_time",
"paid_early",
"callback_scheduled",
"do_not_call",
"wrong_number",
"refused",
"not_reached"
],
"outcome_roles": {
"success": [
"confirmed_on_time",
"paid_early"
],
"do_not_call": [
"do_not_call"
],
"callback": [
"callback_scheduled"
],
"wrong_number": [
"wrong_number"
]
},
"outcome_roles_source": "suggested",
"callback_variable": "callback_at",
"calling_window": {
"start": "09:00",
"end": "19:00"
},
"numbers": [
{
"number": "+9180XXXXXX79",
"is_default": true,
"status": "active",
"pool_paused": false,
"health": "good",
"usable": true
},
{
"number": "+9180XXXXXX80",
"is_default": false,
"status": "active",
"pool_paused": true,
"health": null,
"usable": false
}
],
"has_outbound_number": true,
"contract_source": "live"
}Authorizations
Authorization: Bearer vg_live_<32 hex characters>. Keys are issued by Mergen admins and shown once.
Missing or invalid key: 401 unauthorized. Suspended account: 403 tenant_suspended.
Path Parameters
Agent id (see GET /v1/campaign-agents).
Response
The agent.
An agent as a campaign sees it. A record must carry every required_variables entry (a variable with a
default is never required). post_call_variables and outcomes say what a call produces.
outcome_roles_source is agent when Mergen set the roles for this agent and suggested when they were
guessed from the outcome names. contract_source is live when the variables and outcomes were read from the
agent's published configuration just now and profile when they come from the agent's stored profile.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Which of the agent's outcomes mean success, do not call, a callback request and a wrong number.
Show child attributes
Show child attributes
agent, suggested The post-call variable that holds a requested callback time (default callback_at).
The agent's own calling hours in your timezone. A campaign's daily window must overlap them.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
At least one number is usable.
live, profile