API Examples

Code examples for common Dashboard API operations

This guide provides code examples for common Dashboard API operations.

Example 1: Get AWS IAM Insights Dashboard

Retrieve a specific OOTB dashboard by its ID:

curl --location --request GET \
  'https://company.veza.com/api/preview/assessments/reports/64e4231c-ead9-4bf0-bed7-afa94511f476' \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Accept: application/json'

Python:

import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json'
}

response = requests.get(
    'https://company.veza.com/api/preview/assessments/reports/64e4231c-ead9-4bf0-bed7-afa94511f476',
    headers=headers
)

dashboard = response.json()['value']
print(f"Dashboard: {dashboard['name']}")
print(f"Type: {dashboard['type']}")
print(f"Queries: {len(dashboard.get('queries', []))}")

JavaScript:


Example 2: List All Dashboards

Get all dashboards in your tenant:

Python:


Example 3: Filter Dashboards by Type

Find only system-created (OOTB) dashboards:

Python:


Example 4: Get Time-Series Data

Retrieve historical query results for trend analysis:

Python:


Example 5: Create a Custom Dashboard

Create a new dashboard programmatically:

Python:


Last updated

Was this helpful?