API authentication
Create bearer keys, scope access, and handle rate limits safely.
API authentication
PreFlight public API v1 uses bearer account API keys. Keys are created by the workspace owner from Dashboard → Settings → API keys and inherit that owner's project access.
Create a key
github-actions-deploy-gate).Header format
Every authenticated request must include:
Authorization: Bearer pf_live_...
Content-Type: application/json
Keys must match the pattern pf_live_ followed by at least 32 alphanumeric characters.
Scope and access
Idempotent writes
Retried POST requests — especially check triggers from CI — should send a stable idempotency header:
Idempotency-Key: ci-run-2026-06-13-main-001
PreFlight deduplicates on that key so a network retry does not spawn duplicate check runs.
Rate limiting
When limited, the API returns 429 with retry guidance. Automation should backoff exponentially.
Core endpoints
See the full catalog in the API overview.
Example: trigger a check
curl -X POST \
-H "Authorization: Bearer pf_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: ci-run-2026-06-13-001" \
https://getpreflight.dev/api/v1/projects/550e8400-e29b-41d4-a716-446655440000/checks
Example response
{
"runId": "8b3f2c1a-9d4e-4f5a-b6c7-1234567890ab",
"status": "warning",
"summary": "11 passed, 1 warning, 0 failed.",
"counts": { "success": 11, "warning": 1, "failed": 0 },
"results": []
}
<RelatedLinks links={[ { href: "/docs/api/overview", title: "API overview", description: "All v1 resources and automation patterns." }, { href: "/docs/api/mcp-server", title: "MCP server", description: "Use the same key from Cursor or Claude Desktop." }, { href: "/docs/guides/deploy-gates", title: "Release Rules", description: "Wire gate responses into CI." }, ]} />
