API Reference
Execute a widget data query
Resolves the job's connector mapping, evaluates JSONata in the widget config, and calls a readonly connector method. Response size is capped at 2 MB.
POST /api/dashboards/{id}/widgets/{widgetId}/data
Resolves the job's connector mapping, evaluates JSONata in the widget config, and calls a readonly connector method. Response size is capped at 2 MB.
Operation ID: executeDashboardWidget
Authentication
Option 1
- BearerAuth (
http bearer) API key token. Create via POST /api/api-keys. Format:envoy_<hex>
Option 2
- CookieAuth (
apiKey) Session cookie set after login + TOTP verification
Path parameters
id—integer,requiredResource IDwidgetId—string,required
Success responses
200
Widget data
Content type: application/json
- Reference:
WidgetDataResponse- Type:
object - Properties:
widget_id(string)data(unknown) — Widget-specific payload (count, rows, chart series, etc.)
- Type:
Error responses
400
Validation error
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Example:
{
"error": "VALIDATION_ERROR",
"message": "Invalid input"
}404
Resource not found
Content type: application/json
- Reference:
Error- Type:
object - Properties:
error(string)- Example:
NOT_FOUND
- Example:
message(string)- Example:
Resource not found
- Example:
- Type:
Example:
{
"error": "NOT_FOUND",
"message": "Resource not found"
}Examples
cURL
curl --request POST \
--url 'https://your-envoy.example.com/api/dashboards/YOUR_ID/widgets/YOUR_WIDGET_ID/data' \
--header 'Authorization: Bearer $API_KEY'JavaScript (fetch)
const response = await fetch('https://your-envoy.example.com/api/dashboards/YOUR_ID/widgets/YOUR_WIDGET_ID/data', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);