POST
/v1/admin/teams
Create Team
curl -X POST https://api.{cluster}.{platform}.voiger.io/v1/admin/teams \
-H "Cookie: sid=$VOIGER_SESSION" \
-H "x-workspace-code: your-workspace-code" \
-H "x-csrf-token: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"team": {
"name": "Sales",
"image": {
"id": "324a9e4e-027b-40de-bc2b-e8e15e906c74"
}
}
}'
const res = await fetch("https://api.{cluster}.{platform}.voiger.io/v1/admin/teams", {
method: "POST",
credentials: "include",
headers: { "x-workspace-code": "your-workspace-code" },
headers: { "Content-Type": "application/json", "x-csrf-token": csrf },
body: JSON.stringify({
"team": {
"name": "Sales",
"image": {
"id": "324a9e4e-027b-40de-bc2b-e8e15e906c74"
}
}
}),
})
const data = await res.json()
Parameters
x-workspace-code
string
required
in header
x-csrf-token
string
required
in header
json · 200
{
"team": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"name": "Sales",
"number_ids": [
"ce55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ab55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"agent_ids": [
"ab55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ca55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"admin_ids": [
"ab55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ca55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"queue_ids": [
"de55fcb6-084d-4b31-bd86-f6dd2195ed6a",
"ee55fcb6-084d-4b31-bd86-f6dd2195ed6a"
],
"image": {
"id": "324a9e4e-027b-40de-bc2b-e8e15e906c74"
},
"created_at": "2024-12-29T14:30:00.123Z",
"updated_at": "2024-12-29T14:30:00.123Z"
}
}