POST
/v1/admin/connectors
Create Connector
curl -X POST https://api.{cluster}.{platform}.voiger.io/v1/admin/connectors \
-H "Cookie: sid=$VOIGER_SESSION" \
-H "x-workspace-code: your-workspace-code" \
-H "x-csrf-token: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connector": {
"name": "Main Support Line",
"type": "phone",
"value": "+94000000000",
"team_ids": [
"ce55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ab55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"targets": [
{
"type": "queue",
"value": {
"id": "3f55fcb6-084d-4b31-bd86-f6dd2195ed6a"
},
"timeslots": {
"1": [
"09:00-12:00",
"13:00-18:00"
]
}
}
]
}
}'
const res = await fetch("https://api.{cluster}.{platform}.voiger.io/v1/admin/connectors", {
method: "POST",
credentials: "include",
headers: { "x-workspace-code": "your-workspace-code" },
headers: { "Content-Type": "application/json", "x-csrf-token": csrf },
body: JSON.stringify({
"connector": {
"name": "Main Support Line",
"type": "phone",
"value": "+94000000000",
"team_ids": [
"ce55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ab55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"targets": [
{
"type": "queue",
"value": {
"id": "3f55fcb6-084d-4b31-bd86-f6dd2195ed6a"
},
"timeslots": {
"1": [
"09:00-12:00",
"13:00-18:00"
]
}
}
]
}
}),
})
const data = await res.json()
Parameters
x-workspace-code
string
required
in header
x-csrf-token
string
required
in header
name
string
Connector name (optional)
value
null | object
Null when type hangup
json · 200
{
"connector": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "Main Support Line",
"type": "phone",
"value": "+94000000000",
"team_ids": [
"ce55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ab55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"created_at": "2024-12-29T14:30:00.123Z",
"updated_at": "2024-12-29T14:30:00.123Z",
"targets": [
{
"type": "queue",
"value": {
"id": "3f55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"name": "sales",
"strategy": "longest_idle_agent",
"image": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
},
"team": {
"id": "a9788d2e-ca37-41e3-b440-85ae6f8cd4c6",
"name": "Team one"
}
},
"timeslots": {
"1": [
"09:00-12:00",
"13:00-18:00"
]
}
}
]
}
}