API And Webhooks
The Bitaic API and webhook layer lets engineering, operations, and automation teams retrieve monitoring data, manage monitored resources, configure alert behavior, export operational data, and deliver real-time events into internal systems.
When To Use API Versus Webhooks
| Need | Use | Typical workflow |
|---|---|---|
| Read current or historical state on demand. | API | Query targets, alerts, checks, health metrics, Windows events, or exports from a script, dashboard, or internal tool. |
| Create or update configuration from automation. | API | Manage monitored targets, endpoint checks, alert thresholds, integration settings, and agent metadata. |
| React when something changes. | Webhooks | Send alert, recovery, certificate, DNS, health, Windows event, or agent-state notifications to another system. |
| Connect Bitaic to incident or workflow tools. | Integrations and webhooks | Use a built-in integration where one exists, and use webhooks for custom routing or in-house automation. |
Authentication And Authorization
- API requests use a Bitaic API token in the
Authorization: Bearer <token>header. - API tokens are created and rotated from Bitaic App settings by users with permission to manage API access.
- Requests are authorized against the calling user, workspace, organization, and role-based permissions.
- Administrative API activity is part of the Bitaic audit trail so teams can review configuration and access changes.
Create and rotate API tokens from an account role that can manage API access, then scope each automation token to the resources and actions it actually needs.
Store API tokens in a secrets manager or protected runtime variable, not in source code, command history, or committed configuration files.
Base URL And Versioning
| Base URL | https://api.bitaic.com/v1 |
|---|---|
| Content type | Send and receive JSON with Content-Type: application/json. |
| Timestamps | Use ISO 8601 UTC timestamps in request and response payloads. |
| Version path | The /v1 path identifies the stable API version used by current monitoring products and integrations. |
Resource Model
| Resource | Purpose | Common fields |
|---|---|---|
| Targets | Monitored infrastructure objects such as endpoints, domains, DNS records, certificates, hosts, and Windows event sources. | id, name, type, status, created_at, updated_at. |
| Checks | Endpoint, certificate, DNS, domain, health, and Windows event checks attached to monitored targets. | id, target_id, check_type, state, checked_at. |
| Metrics | Time-series and current values for uptime, response time, DNS latency, certificate days remaining, health usage, and event counts. | metric, value, unit, target_id, observed_at. |
| Alerts | Alert records created from threshold crossings, status changes, monitored failures, and recoveries. | id, severity, state, summary, opened_at, resolved_at. |
| Agents | Installed collectors and their status, version, last report time, and associated monitoring products. | id, name, agent_type, version, status, last_seen_at. |
| Integrations | Notification, incident, webhook, and API-connected routing configuration. | id, provider, enabled, created_at, updated_at. |
Endpoint Reference
| Method | Path | Purpose | Use case |
|---|---|---|---|
GET | /v1/targets | List monitored targets. | Inventory the resources Bitaic is monitoring. |
GET | /v1/targets/{target_id} | Retrieve one monitored target. | Inspect target metadata, current state, and check coverage. |
POST | /v1/endpoint-checks | Create an endpoint availability check. | Add a URL to Endpoint Monitoring automation. |
GET | /v1/metrics/health | Retrieve health metric values. | Feed CPU, memory, disk, and disk I/O data into reports. |
GET | /v1/events/windows | List Windows event matches. | Review event IDs, levels, sources, and event alert context. |
GET | /v1/alerts | List alerts. | Read active and resolved alert records for operations review. |
PATCH | /v1/alerts/{alert_id} | Update an alert. | Acknowledge, annotate, or resolve an alert from automation. |
GET | /v1/agents | List agents. | Check installed collector status and freshness. |
POST | /v1/webhooks/subscriptions | Create a webhook subscription. | Deliver selected events to a configured HTTPS endpoint. |
Request And Response Shape
API responses use a predictable envelope so applications can log a request ID, handle pagination, and parse the returned resource payload.
GET /v1/alerts?state=open&severity=critical HTTP/1.1
Host: api.bitaic.com
Authorization: Bearer <token>
Accept: application/json{
"data": [
{
"id": "alert_01J5Z8P2A9W8H2XP0J4K3V7B8C",
"severity": "critical",
"state": "open",
"summary": "Endpoint response time exceeded threshold",
"target_id": "target_01J5Z8M4Q9K7P6N2H1W8R5T3A1",
"opened_at": "2026-08-18T14:30:00Z"
}
],
"pagination": {
"next_cursor": "cursor_eyJwYWdlIjoyfQ"
},
"request_id": "req_01J5Z8T6N9QVH6CY7W0Z6QG1F2"
}Pagination, Filtering, And Limits
- List endpoints support cursor pagination with a
next_cursorvalue when more records are available. - Common filters include
state,severity,target_id,type,from, andto. - Metric and event queries should use bounded time windows so exports and dashboards stay responsive.
- API clients should handle
429responses by honoringRetry-Afterand retrying with backoff. - Retried writes should use an idempotency key when the client cannot safely determine whether the first request completed.
Errors And Recovery
| Status | Meaning | Recovery |
|---|---|---|
400 | Request body, query, or parameter is invalid. | Fix the field named in the error payload and retry. |
401 | Authentication token is missing, expired, or invalid. | Rotate or reissue the token, then retry the request. |
403 | The authenticated principal lacks permission. | Use an account or role with access to the requested resource. |
404 | The resource does not exist in the active workspace. | Check the resource ID and workspace context. |
409 | The requested write conflicts with current state. | Reload the resource, apply the current state, and retry. |
429 | The client has exceeded the current rate limit. | Honor Retry-After, reduce concurrency, and use backoff. |
5xx | Bitaic could not complete the request. | Retry safe requests with backoff and include the request ID. |
{
"error": {
"code": "invalid_request",
"message": "The severity filter must be one of info, warning, critical.",
"field": "severity"
},
"request_id": "req_01J5Z8W6YF5QA20NHJ9FE7J7VQ"
}Webhook Events
| Event | When it fires | Common consumers |
|---|---|---|
alert.created | A new alert opens. | Incident tools, chat channels, ticketing systems. |
alert.updated | An alert changes severity, owner, note, or routing state. | Incident records, automation workflows. |
alert.resolved | An alert returns to clear or resolved state. | Incident closure, status summaries, reporting. |
endpoint.check_failed | An endpoint availability check fails. | On-call routing, service dashboards. |
endpoint.recovered | An endpoint returns to healthy state. | Recovery automation, incident updates. |
ssl.expiring | A certificate enters its configured expiration window. | Renewal workflows, ticket queues. |
ssl.renewed | A certificate check observes a renewed certificate. | Renewal confirmation, compliance evidence. |
domain.status_changed | A monitored domain status changes. | Domain operations, escalation workflows. |
dns.lookup_failed | A DNS lookup cannot resolve successfully. | Network operations, incident workflows. |
dns.record_mismatch | A DNS answer differs from the configured expected value. | Change review, DNS operations. |
health.threshold_exceeded | A health metric crosses its configured threshold. | Capacity workflows, operations alerts. |
health.recovered | A health metric returns to clear state. | Recovery workflows, status summaries. |
windows_event.matched | A configured Windows event rule matches an event. | Windows operations, security review workflows. |
agent.offline | An agent stops reporting within its expected window. | Collector health automation, operations channels. |
agent.recovered | An agent resumes reporting. | Recovery automation, operational reports. |
Webhook Payload And Security
Webhook deliveries use HTTPS, include a unique event ID, and provide the event name, delivery timestamp, workspace context, and related resource payload. Receivers should verify the signature before processing the event.
Reject unsigned deliveries, failed signature checks, stale timestamps, and duplicate event IDs before triggering downstream automation.
POST /bitaic/webhooks HTTP/1.1
Host: automation.example.com
Content-Type: application/json
X-Bitaic-Event: alert.created
X-Bitaic-Delivery: whd_01J5Z91CBA9W37F68JTE7W8JEV
X-Bitaic-Timestamp: 2026-08-18T14:30:00Z
X-Bitaic-Signature: sha256=<signature>{
"event_id": "evt_01J5Z91CBA9W37F68JTE7W8JEV",
"event_type": "alert.created",
"created_at": "2026-08-18T14:30:00Z",
"workspace_id": "workspace_01J5Z82DB7YV6PRPK6K4WSGJ5X",
"data": {
"alert": {
"id": "alert_01J5Z8P2A9W8H2XP0J4K3V7B8C",
"severity": "critical",
"state": "open",
"summary": "Endpoint response time exceeded threshold",
"target_id": "target_01J5Z8M4Q9K7P6N2H1W8R5T3A1"
}
}
}- Validate
X-Bitaic-Signaturewith the webhook signing secret before accepting the payload. - Reject stale deliveries by checking
X-Bitaic-Timestamp. - Treat
event_idandX-Bitaic-Deliveryas idempotency values to prevent duplicate processing. - Respond with a
2xxstatus after successful processing. - Bitaic retries failed deliveries for temporary errors and records delivery attempts for troubleshooting.
Data Export
API exports support operational reporting, compliance review, backup, and downstream analytics. Export requests should include the product area, target scope, time window, and desired output format.
POST /v1/exports HTTP/1.1
Host: api.bitaic.com
Authorization: Bearer <token>
Content-Type: application/json
{
"resource": "alerts",
"format": "csv",
"from": "2026-08-01T00:00:00Z",
"to": "2026-08-18T23:59:59Z"
}Security Notes
- Use least-privilege tokens for automation and rotate them on a regular schedule.
- Separate read-only reporting tokens from tokens that can create, update, or delete configuration.
- Restrict webhook receivers to HTTPS endpoints controlled by your organization.
- Log
request_id,event_id, and delivery IDs in downstream systems for support and audit review. - Avoid forwarding secrets, credentials, or unnecessary sensitive details through webhook payloads or exports.
Related Workflows
- Integrations for Slack, Microsoft Teams, email, PagerDuty, and custom webhook routing.
- Endpoint Monitoring for endpoint availability, response time, and uptime states.
- Health Monitoring for CPU, memory, disk, disk I/O, and agent status metrics.
- Windows Event Monitoring for event log signals and event-driven alerting.
- Audit for reviewing administrative and security-relevant activity.