Skip to main content

API basics

UnitOps exposes a REST API for integrations and automation.

EnvironmentBase URL
Productionhttps://api.unitops.datalakehouse.io
Staginghttps://staging-api.unitops.datalakehouse.io

Interactive schema documentation is served by the API itself at /docs on the API host, and the OpenAPI document at /openapi.json.

Authentication

Send a bearer token from the identity provider:

curl -s "$API/api/v1/locations" \
-H "Authorization: Bearer $TOKEN"

The token carries your organization, role, and location scope. Every endpoint applies the same authorization rules as the UI, so an API caller can never read more than the same user could in the browser.

Commonly used endpoints

AreaEndpointPurpose
DocumentsPOST /api/v1/documents/searchSearch indexed document chunks
DocumentsPOST /api/v1/documents/{id}/indexIndex a document for AI search
Custom dashboardsPOST /api/v1/custom-dashboardsCreate a dashboard from a YAML spec
Custom dashboardsPOST /api/v1/custom-dashboards/{id}/publishPublish a dashboard
Custom dashboardsPOST /api/v1/custom-dashboards/{id}/embedMint an embed token and iframe snippet
NotificationsGET /api/v1/notifications/admin/channel-configsInspect per-organization channel providers
NotificationsPUT /api/v1/notifications/admin/channel-configs/{kind}Set a channel provider
NotificationsPOST /api/v1/notifications/admin/custom-rulesCreate a custom rule
NotificationsGET /api/v1/notifications/admin/dead-lettersList permanently failed deliveries
NotificationsGET /api/v1/notification-channels/delivery-healthRecent deliveries and why each one was delivered, failed, or skipped
NotificationsPOST /api/v1/notifications/admin/group-subscriptionsFan a rule out to an email group

Example: create a custom alert rule

curl -s -X POST "$API/api/v1/notifications/admin/custom-rules" \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H 'content-type: application/json' \
-d '{
"kind": "clone",
"key": "ops.pacing_below_forecast.acme_strict",
"name": "Pacing - Acme strict (5%)",
"description": "Tighter pacing alert for executive review",
"base_rule_key": "ops.pacing_below_forecast",
"thresholds": {"gap_pct": 5.0},
"severity": "critical",
"default_channels": ["in_app", "email", "slack"],
"cadence_cron": "*/15 * * * *"
}'

Example: search documents

curl -s -X POST "$API/api/v1/documents/search" \
-H "Authorization: Bearer $TOKEN" \
-H 'content-type: application/json' \
-d '{"query": "closing checklist", "top_k": 5}'

Conventions

  • All endpoints are versioned under /api/v1.
  • Timestamps are ISO 8601 in UTC.
  • Errors return a JSON body with a detail field and a conventional HTTP status.
  • Rate limits apply to scheduler trigger endpoints and return 429 with Retry-After.

Versioning

Breaking changes ship behind a new version prefix. Additive fields can appear without a version bump, so parse defensively and ignore unknown fields.