API Guide
Use /api for REST requests and the running server’s generated reference for endpoint schemas.
| Resource | URL |
|---|---|
| Interactive API reference | /api-reference |
| OpenAPI JSON | /api/openapi |
| API base | /api |
| Readiness probe (includes database availability) | /_readiness |
| Process health (startup/liveness) | /_health |
API responses, including errors and one-time credentials, use Cache-Control: no-store, private.
Authenticate with a PAT
Create a personal access token under Settings > Access Tokens, copy its one-time value, and send it as a bearer token:
curl --fail-with-body \
-H 'Authorization: Bearer endura_pat_...' \
https://team-server.example.com/api/pipelinesPATs inherit owner permissions. GET/HEAD require read capability; other methods require write, including validation/test/sync POSTs. Token creation, rotation, and deletion require interactive sign-in; privileged local tasks are separate.
Browser Authentication
Browser login carries the original route in returnTo, restored after username/password or OIDC authentication, including query and fragment. OIDC redirects use 303 See Other.
returnTo must be root-relative and at most 2,048 UTF-8 bytes. External/protocol-relative URLs, traversal, backslashes, repeated encoding, and /api or /authentication destinations are rejected; missing/unsafe values fall back to /dashboards. Username/password login is non-production only.
Username/password login, logout, and browser-session requests other than GET/HEAD/OPTIONS require exactly one Origin matching settings.tenant.base_url, regardless of CORS. Missing, malformed, duplicate, or nonmatching origins return 403.
Bearer-only requests may omit Origin; if supplied, CORS and origin rules apply.
Array Query Parameters
Repeat the bare key for an array filter:
?id=1&id=2Literal id[]/id[0] work, but encoded brackets (%5B, %5D) in parameter names return 400. Repeated bare keys avoid client encoding issues.
Pagination
| Lists | Controls/defaults |
|---|---|
| Builds, pipelines, deployments, workloads, violations, policy commits, discovery runs | 1-based page, size up to 200; omitting both returns the complete filtered set |
| Team Server/Sensor logs | Default newest 512 matches; explicit size capped at 512 |
| Sensors, policies, users | Unpaginated; documented filters only |
Paginated responses include filtered X-Total-Count. For log tailing, after=<record-id> instead returns up to 512 greater IDs ascending, with existing filters. It ignores page/size/ordering and omits total count. At 512 results, request again after the greatest returned ID.
Integration Runs and Statistics
Operators and Administrators can inspect CI/CD discovery run history through these endpoints:
| Endpoint | Purpose |
|---|---|
GET /api/integrations/{provider}/{integration_id}/runs | Lists run history with search, ordering, outcome, scope, and trigger filters |
GET /api/integrations/{provider}/{integration_id}/runs/{run_id} | Returns one run and its bounded warning and error diagnostics |
GET /api/integrations/schedules/next | Returns the nearest configured discovery run for each provider |
Run triggers are manual, scheduled, create, and update. Outcomes are running, success, partial, failed, cancelled, and interrupted. A run stores at most 100 diagnostics and reports any additional count in omittedDiagnosticCount.
CI/CD integration responses expose lastSuccessfulRunAt, lastSuccessfulRunDuration, and lastSuccessfulRunScope. Pipeline assignment filtering uses repeated policyAssignment=assigned or policyAssignment=unassigned query parameters and is independent of runtime protection status.
Dashboard clients use GET /api/stats/security-posture for the current internally consistent security-posture calculation. Historical latest-build violation points are available from GET /api/stats/latest-build-violations.
Runtime Sensor Endpoints
Build heartbeats, deployment/workload/violation ingest, /sensors/current/*, and /sensors/logs require Sensor JWTs, as marked in the reference. Sessions/PATs cannot call them.
Sensor-token rotation immediately invalidates earlier generations with 401.
Error Responses
| Status | Meaning |
|---|---|
400 Bad Request | Invalid JSON or query syntax, including encoded array brackets |
401 Unauthorized | Missing, expired, revoked, or invalid credentials |
403 Forbidden | Browser origin, role, resource scope, ownership, or PAT capability denied the action |
404 Not Found | The resource does not exist |
409 Conflict | Current state prevents the action, such as stopping an integration that is not syncing |
415 Unsupported Media Type | A JSON body lacks Content-Type: application/json |
422 Unprocessable Content | Parsed input fails schema, bounds, credential, policy, or proposal validation |
500 Internal Server Error | An unexpected server or configuration failure occurred |
503 Service Unavailable | PostgreSQL is unavailable |
Database outages cause 503 database unavailable across /api except /api/version. Detection waits five seconds between completed probes, plus probe duration; database-dependent requests can fail earlier. Readiness includes dependencies; process health does not.