Board-uri
9 endpoint-uri. Fiecare cale de mai jos este relativă la URL-ul de bază al API-ului și include deja prefixul /api/v1 — vezi convențiile pentru autentificare, paginare, erori și idempotență.
| Endpoint | ||
|---|---|---|
| GET | /boards | List the organization's analytics boards with their widget definitions, ordered by name |
| POST | /boards | Create an analytics board, generating a slug from the name when none is given |
| GET | /boards/{boardId} | Fetch one analytics board with its widget definitions |
| PATCH | /boards/{boardId} | Update an analytics board's name, description, filters, time window or layout settings |
| DELETE | /boards/{boardId} | Delete an analytics board |
| GET | /boards/{boardId}/data | Render every widget on a board in one call, with optional time-range and timezone overrides |
| POST | /boards/{boardId}/widgets | Add a widget to a board, storing its saved analytics query and its grid position |
| PATCH | /boards/{boardId}/widgets/{widgetId} | Update a board widget's query, presentation or grid position |
| DELETE | /boards/{boardId}/widgets/{widgetId} | Remove a widget from a board |
Endpoint-uri
List the organization's analytics boards with their widget definitions, ordered by name
- Necesită
analytics.read. - Returns all boards; there is no pagination or filtering on this endpoint
curl -X GET "$CALLAGENT_API_URL/boards" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.get(
f"{os.environ['CALLAGENT_API_URL']}/boards",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | data-wrapped array |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the analytics.read scope |
Exemplu de răspuns, generat din schemă:
{
"data": [
"string"
]
}Create an analytics board, generating a slug from the name when none is given
- Necesită
board.write.
Corpul cererii
| Câmp | Tip | Obligatoriu | Note |
|---|---|---|---|
name | string | da | max 255 chars |
description | string | null | — | |
slug | string | null | — | max 96 chars |
time_preset | string | null | — | max 24 chars |
timezone | string | null | — | |
filters | string[] | null | — | |
refresh_interval_seconds | integer | null | — | min 0. max 3600 |
is_default | boolean | null | — |
curl -X POST "$CALLAGENT_API_URL/boards" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Support Line",
"refresh_interval_seconds": 30,
"is_default": true
}'const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Support Line",
"refresh_interval_seconds": 30,
"is_default": true
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Support Line',
'refresh_interval_seconds' => 30,
'is_default' => true,
]),
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.post(
f"{os.environ['CALLAGENT_API_URL']}/boards",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
json={
"name": "Support Line",
"refresh_interval_seconds": 30,
"is_default": True
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
201 | data-wrapped object |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the board.write scope |
422 | The payload failed validation (name is required) |
Exemplu de răspuns, generat din schemă:
{
"data": {
"id": "01JQ0000000000000000000000",
"name": "Support Line",
"slug": "string",
"description": "string",
"time_preset": "string",
"timezone": "string",
"filters": {},
"refresh_interval_seconds": 30,
"is_default": true,
"widgets": [
"string"
]
}
}Fetch one analytics board with its widget definitions
- Necesită
analytics.read. - Returns widget definitions only; the rendered figures come from GET /boards/{boardId}/data
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da |
curl -X GET "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.get(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | data-wrapped object |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the analytics.read scope |
404 | No board with that id in this organization |
Exemplu de răspuns, generat din schemă:
{
"data": {
"id": "01JQ0000000000000000000000",
"name": "Support Line",
"slug": "string",
"description": "string",
"time_preset": "string",
"timezone": "string",
"filters": {},
"refresh_interval_seconds": 30,
"is_default": true,
"widgets": [
"string"
]
}
}Update an analytics board's name, description, filters, time window or layout settings
- Necesită
board.write. - No validation runs here, so no 422 is possible. Accepts time_from, time_to and columns, which the create endpoint does not
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da |
curl -X PATCH "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.patch(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | data-wrapped object |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the board.write scope |
404 | No board with that id in this organization |
Exemplu de răspuns, generat din schemă:
{
"data": {
"id": "01JQ0000000000000000000000",
"name": "Support Line",
"slug": "string",
"description": "string",
"time_preset": "string",
"timezone": "string",
"filters": {},
"refresh_interval_seconds": 30,
"is_default": true,
"widgets": [
"string"
]
}
}Delete an analytics board
- Necesită
board.write. - Acest răspuns nu este împachetat în
data. - 204 with no body. The board is resolved before the scope check, so an unknown id returns 404 even for an unscoped key
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da |
curl -X DELETE "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000`, {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.delete(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
204 | No content |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the board.write scope |
404 | No board with that id in this organization |
Render every widget on a board in one call, with optional time-range and timezone overrides
- Necesită
analytics.read. - A widget whose query fails is not an error: its envelope carries an error field while the response stays 200
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da |
Parametri de interogare
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
preset | string | — | |
from | string | — | |
to | string | — | |
timezone | string | — |
curl -X GET "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000/data?preset=string&from=%2B40712345678" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000/data?preset=string&from=%2B40712345678`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000/data?preset=string&from=%2B40712345678');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.get(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000/data?preset=string&from=%2B40712345678",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | data-wrapped object |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the analytics.read scope |
404 | No board with that id in this organization |
Exemplu de răspuns, generat din schemă:
{
"data": {
"board": {
"id": "01JQ0000000000000000000000",
"name": "Support Line",
"timezone": null,
"preset": null
},
"widgets": [
{}
]
}
}Add a widget to a board, storing its saved analytics query and its grid position
- Necesită
board.write. metricanddimensionare validated only as short strings but cast to enums, so an unrecognised value yields a 500, not a 422
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da |
Corpul cererii
| Câmp | Tip | Obligatoriu | Note |
|---|---|---|---|
title | string | da | max 255 chars |
subtitle | string | null | — | max 255 chars |
type | timeseries · kpi · table · histogram · percentile · funnel | da | |
metric | string | da | max 32 chars |
metrics | string[] | null | — | |
dimension | string | null | — | max 32 chars |
filters | string[] | null | — | |
granularity | hour · day · week · month · null | null | — | |
options | string[] | null | — | |
position_x | integer | null | — | min 0. max 24 |
position_y | integer | null | — | min 0 |
width | integer | null | — | min 1. max 12 |
height | integer | null | — | min 1. max 12 |
curl -X POST "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000/widgets" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"title": "string",
"type": "timeseries",
"metric": "string",
"granularity": "hour",
"position_x": 1,
"position_y": 1,
"width": 1
}'const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000/widgets`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"title": "string",
"type": "timeseries",
"metric": "string",
"granularity": "hour",
"position_x": 1,
"position_y": 1,
"width": 1
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000/widgets');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'title' => 'string',
'type' => 'timeseries',
'metric' => 'string',
'granularity' => 'hour',
'position_x' => 1,
'position_y' => 1,
'width' => 1,
]),
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.post(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000/widgets",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
json={
"title": "string",
"type": "timeseries",
"metric": "string",
"granularity": "hour",
"position_x": 1,
"position_y": 1,
"width": 1
},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
201 | Columns with database defaults (granularity, type, position) are not in memory after an insert; refreshing means the presenter reads real values instead of dereferencing a null cast. |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the board.write scope |
404 | No board with that id in this organization |
422 | The payload failed validation (title, type and metric are required) |
Exemplu de răspuns, generat din schemă:
{
"data": {
"id": "01JQ0000000000000000000000",
"title": "string",
"subtitle": "string",
"type": "string",
"metric": "string",
"metrics": {},
"dimension": "string",
"filters": {},
"granularity": "string",
"options": {},
"layout": {
"x": 1,
"y": 1,
"w": 1,
"h": 1
}
}
}Update a board widget's query, presentation or grid position
- Necesită
board.write. - No validation runs here, so no 422 is possible; an unrecognised
metricortypeis stored and then breaks the enum cast with a 500
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da | |
widgetId | string | da |
curl -X PATCH "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.patch(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
200 | data-wrapped object |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the board.write scope |
404 | No such board, or no such widget on that board |
Exemplu de răspuns, generat din schemă:
{
"data": {
"id": "01JQ0000000000000000000000",
"title": "string",
"subtitle": "string",
"type": "string",
"metric": "string",
"metrics": {},
"dimension": "string",
"filters": {},
"granularity": "string",
"options": {},
"layout": {
"x": 1,
"y": 1,
"w": 1,
"h": 1
}
}
}Remove a widget from a board
- Necesită
board.write. - Acest răspuns nu este împachetat în
data.
Parametri de cale
| Nume | Tip | Obligatoriu | Note |
|---|---|---|---|
boardId | string | da | |
widgetId | string | da |
curl -X DELETE "$CALLAGENT_API_URL/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000" \
-H "Authorization: Bearer $CALLAGENT_API_KEY" \
-H "Accept: application/json"const response = await fetch(`${process.env.CALLAGENT_API_URL}/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000`, {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
Accept: 'application/json',
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { data } = await response.json();<?php
$handle = curl_init(getenv('CALLAGENT_API_URL') . '/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000');
curl_setopt_array($handle, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
'Accept: application/json',
],
]);
$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);
if ($status >= 400) {
throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}
$data = $body['data'];import os, requests
response = requests.delete(
f"{os.environ['CALLAGENT_API_URL']}/boards/01JQ0000000000000000000000/widgets/01JQ0000000000000000000000",
headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
data = response.json()["data"]Răspunsuri
| Status | Corp |
|---|---|
204 | No content |
Erori
| Status | Când apare |
|---|---|
403 | The API key lacks the board.write scope |
404 | No such board, or no such widget on that board |