Team capacity insights
curl --request POST \
--url https://api.cx.stax.ai/insights/_capacity \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"assignee": "<string>",
"assignee_type": "<string>",
"end_date": "<string>",
"include_unassigned": true,
"start_date": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://api.cx.stax.ai/insights/_capacity"
payload = {
"assignee": "<string>",
"assignee_type": "<string>",
"end_date": "<string>",
"include_unassigned": True,
"start_date": "<string>",
"timezone": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assignee: '<string>',
assignee_type: '<string>',
end_date: '<string>',
include_unassigned: true,
start_date: '<string>',
timezone: '<string>'
})
};
fetch('https://api.cx.stax.ai/insights/_capacity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cx.stax.ai/insights/_capacity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assignee' => '<string>',
'assignee_type' => '<string>',
'end_date' => '<string>',
'include_unassigned' => true,
'start_date' => '<string>',
'timezone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cx.stax.ai/insights/_capacity"
payload := strings.NewReader("{\n \"assignee\": \"<string>\",\n \"assignee_type\": \"<string>\",\n \"end_date\": \"<string>\",\n \"include_unassigned\": true,\n \"start_date\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cx.stax.ai/insights/_capacity")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"assignee\": \"<string>\",\n \"assignee_type\": \"<string>\",\n \"end_date\": \"<string>\",\n \"include_unassigned\": true,\n \"start_date\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/insights/_capacity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assignee\": \"<string>\",\n \"assignee_type\": \"<string>\",\n \"end_date\": \"<string>\",\n \"include_unassigned\": true,\n \"start_date\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"recommendations": [
{
"priority": "<string>",
"reasons": [
"<string>"
],
"source_user_id": "<string>",
"summary": "<string>",
"target_user_id": "<string>",
"type": "<string>"
}
],
"references": {
"users": [
{
"email": "<string>",
"name": "<string>",
"user_id": "<string>"
}
]
},
"summary": {
"active_task_count": 123,
"avg_completed_task_count_per_user": 123,
"completed_task_count": 123,
"overdue_task_count": 123,
"users_included": 123
},
"team_summary": {
"median_active_assigned_task_count": 123,
"median_avg_open_task_age_hours": 123,
"median_completed_task_count": 123,
"median_overdue_task_count": 123
},
"users": [
{
"email": "<string>",
"labels": [
"<string>"
],
"metrics": {
"active_assigned_task_count": 123,
"active_client_count": 123,
"active_workload_hours": 123,
"available_not_started_task_count": 123,
"avg_open_task_age_hours": 123,
"avg_time_to_complete_hours": 123,
"completed_task_count": 123,
"completed_task_pct_of_team": 123,
"completion_rank": 123,
"flagged_task_count": 123,
"load_days": 123,
"max_open_task_age_hours": 123,
"max_time_to_complete_hours": 123,
"median_time_to_complete_hours": 123,
"onboarding_client_count": 123,
"overdue_task_count": 123,
"raw_routing_utilization": 123,
"routing_utilization": 123,
"terminating_client_count": 123,
"total_client_count": 123
},
"name": "<string>",
"reasons": [
"<string>"
],
"scores": {
"burnout_risk_score": 123,
"performance_score": 123,
"workload_score": 123
},
"user_id": "<string>"
}
]
}{}{}{}todo
Team capacity insights
Returns workload, performance, and burnout-risk analytics for team members.
POST
/
insights
/
_capacity
Team capacity insights
curl --request POST \
--url https://api.cx.stax.ai/insights/_capacity \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"assignee": "<string>",
"assignee_type": "<string>",
"end_date": "<string>",
"include_unassigned": true,
"start_date": "<string>",
"timezone": "<string>"
}
'import requests
url = "https://api.cx.stax.ai/insights/_capacity"
payload = {
"assignee": "<string>",
"assignee_type": "<string>",
"end_date": "<string>",
"include_unassigned": True,
"start_date": "<string>",
"timezone": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
assignee: '<string>',
assignee_type: '<string>',
end_date: '<string>',
include_unassigned: true,
start_date: '<string>',
timezone: '<string>'
})
};
fetch('https://api.cx.stax.ai/insights/_capacity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cx.stax.ai/insights/_capacity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'assignee' => '<string>',
'assignee_type' => '<string>',
'end_date' => '<string>',
'include_unassigned' => true,
'start_date' => '<string>',
'timezone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cx.stax.ai/insights/_capacity"
payload := strings.NewReader("{\n \"assignee\": \"<string>\",\n \"assignee_type\": \"<string>\",\n \"end_date\": \"<string>\",\n \"include_unassigned\": true,\n \"start_date\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cx.stax.ai/insights/_capacity")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"assignee\": \"<string>\",\n \"assignee_type\": \"<string>\",\n \"end_date\": \"<string>\",\n \"include_unassigned\": true,\n \"start_date\": \"<string>\",\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/insights/_capacity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"assignee\": \"<string>\",\n \"assignee_type\": \"<string>\",\n \"end_date\": \"<string>\",\n \"include_unassigned\": true,\n \"start_date\": \"<string>\",\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"recommendations": [
{
"priority": "<string>",
"reasons": [
"<string>"
],
"source_user_id": "<string>",
"summary": "<string>",
"target_user_id": "<string>",
"type": "<string>"
}
],
"references": {
"users": [
{
"email": "<string>",
"name": "<string>",
"user_id": "<string>"
}
]
},
"summary": {
"active_task_count": 123,
"avg_completed_task_count_per_user": 123,
"completed_task_count": 123,
"overdue_task_count": 123,
"users_included": 123
},
"team_summary": {
"median_active_assigned_task_count": 123,
"median_avg_open_task_age_hours": 123,
"median_completed_task_count": 123,
"median_overdue_task_count": 123
},
"users": [
{
"email": "<string>",
"labels": [
"<string>"
],
"metrics": {
"active_assigned_task_count": 123,
"active_client_count": 123,
"active_workload_hours": 123,
"available_not_started_task_count": 123,
"avg_open_task_age_hours": 123,
"avg_time_to_complete_hours": 123,
"completed_task_count": 123,
"completed_task_pct_of_team": 123,
"completion_rank": 123,
"flagged_task_count": 123,
"load_days": 123,
"max_open_task_age_hours": 123,
"max_time_to_complete_hours": 123,
"median_time_to_complete_hours": 123,
"onboarding_client_count": 123,
"overdue_task_count": 123,
"raw_routing_utilization": 123,
"routing_utilization": 123,
"terminating_client_count": 123,
"total_client_count": 123
},
"name": "<string>",
"reasons": [
"<string>"
],
"scores": {
"burnout_risk_score": 123,
"performance_score": 123,
"workload_score": 123
},
"user_id": "<string>"
}
]
}{}{}{}Authorizations
Body
application/json
Capacity analytics request