List consumption analytics facets
curl --request POST \
--url https://dust.tt/api/w/{wId}/analytics/consumption/facets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "cycle",
"days": 30,
"filter": {
"agents": [
"<string>"
],
"users": [
"<string>"
],
"teams": [
"<string>"
],
"models": [
"<string>"
],
"tools": [
"<string>"
],
"skills": [
"<string>"
],
"sources": [
"<string>"
]
}
}
'import requests
url = "https://dust.tt/api/w/{wId}/analytics/consumption/facets"
payload = {
"period": "cycle",
"days": 30,
"filter": {
"agents": ["<string>"],
"users": ["<string>"],
"teams": ["<string>"],
"models": ["<string>"],
"tools": ["<string>"],
"skills": ["<string>"],
"sources": ["<string>"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
period: 'cycle',
days: 30,
filter: {
agents: ['<string>'],
users: ['<string>'],
teams: ['<string>'],
models: ['<string>'],
tools: ['<string>'],
skills: ['<string>'],
sources: ['<string>']
}
})
};
fetch('https://dust.tt/api/w/{wId}/analytics/consumption/facets', 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://dust.tt/api/w/{wId}/analytics/consumption/facets",
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([
'period' => 'cycle',
'days' => 30,
'filter' => [
'agents' => [
'<string>'
],
'users' => [
'<string>'
],
'teams' => [
'<string>'
],
'models' => [
'<string>'
],
'tools' => [
'<string>'
],
'skills' => [
'<string>'
],
'sources' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://dust.tt/api/w/{wId}/analytics/consumption/facets"
payload := strings.NewReader("{\n \"period\": \"cycle\",\n \"days\": 30,\n \"filter\": {\n \"agents\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://dust.tt/api/w/{wId}/analytics/consumption/facets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"cycle\",\n \"days\": 30,\n \"filter\": {\n \"agents\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dust.tt/api/w/{wId}/analytics/consumption/facets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": \"cycle\",\n \"days\": 30,\n \"filter\": {\n \"agents\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"period": {
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"facets": {
"agent": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"user": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"team": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"model": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"tool": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"skill": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"source": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
]
}
}Private Analytics
List consumption analytics facets
Lists current workspace entities and historical indexed values present in the selected period for each consumption dimension. A facet is disabled when it has no indexed document in that period after applying every active filter except the facet’s own dimension.
POST
/
api
/
w
/
{wId}
/
analytics
/
consumption
/
facets
List consumption analytics facets
curl --request POST \
--url https://dust.tt/api/w/{wId}/analytics/consumption/facets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"period": "cycle",
"days": 30,
"filter": {
"agents": [
"<string>"
],
"users": [
"<string>"
],
"teams": [
"<string>"
],
"models": [
"<string>"
],
"tools": [
"<string>"
],
"skills": [
"<string>"
],
"sources": [
"<string>"
]
}
}
'import requests
url = "https://dust.tt/api/w/{wId}/analytics/consumption/facets"
payload = {
"period": "cycle",
"days": 30,
"filter": {
"agents": ["<string>"],
"users": ["<string>"],
"teams": ["<string>"],
"models": ["<string>"],
"tools": ["<string>"],
"skills": ["<string>"],
"sources": ["<string>"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
period: 'cycle',
days: 30,
filter: {
agents: ['<string>'],
users: ['<string>'],
teams: ['<string>'],
models: ['<string>'],
tools: ['<string>'],
skills: ['<string>'],
sources: ['<string>']
}
})
};
fetch('https://dust.tt/api/w/{wId}/analytics/consumption/facets', 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://dust.tt/api/w/{wId}/analytics/consumption/facets",
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([
'period' => 'cycle',
'days' => 30,
'filter' => [
'agents' => [
'<string>'
],
'users' => [
'<string>'
],
'teams' => [
'<string>'
],
'models' => [
'<string>'
],
'tools' => [
'<string>'
],
'skills' => [
'<string>'
],
'sources' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://dust.tt/api/w/{wId}/analytics/consumption/facets"
payload := strings.NewReader("{\n \"period\": \"cycle\",\n \"days\": 30,\n \"filter\": {\n \"agents\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://dust.tt/api/w/{wId}/analytics/consumption/facets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"period\": \"cycle\",\n \"days\": 30,\n \"filter\": {\n \"agents\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dust.tt/api/w/{wId}/analytics/consumption/facets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"period\": \"cycle\",\n \"days\": 30,\n \"filter\": {\n \"agents\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ],\n \"teams\": [\n \"<string>\"\n ],\n \"models\": [\n \"<string>\"\n ],\n \"tools\": [\n \"<string>\"\n ],\n \"skills\": [\n \"<string>\"\n ],\n \"sources\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"period": {
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"facets": {
"agent": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"user": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"team": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"model": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"tool": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"skill": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
],
"source": [
{
"value": "<string>",
"label": "<string>",
"pictureUrl": "<string>",
"documentCount": 1,
"disabled": true,
"icon": "<string>",
"maker": "<string>"
}
]
}
}Authorizations
Your DUST API key is a Bearer token.
Path Parameters
Body
application/json
⌘I