REST conventions
OpenAPI spec at /v1/openapi.json (basic-auth gated in production). Error responses are RFC 7807 problem-details with a stable `code` field for programmatic dispatch.
Auth modes
Cookie-based for the web app (better-auth, 2FA-capable); bearer-token for CLI + bots (PATs). Same routes; the middleware picks the right one from the Authorization header.
Rate limits
Per-route fine-grained limits on auth (5/min/IP), PAT creation (10/hour/workspace), workspace creation (5/hour/user). Public endpoints get the global 100/min/IP fallback.
Idempotency
Mutating endpoints accept an Idempotency-Key header (UUID) and dedup at the workspace level. Agent template triggers use this natively.
Webhook signatures
X-AICrewKit-Signature header carries HMAC-SHA256(payload). Verify with the secret from the rotate-secret endpoint and compare in constant time.
GDPR + audit
Article 20 export + Article 17 erasure are first-class endpoints. The audit log has a weekly tamper-evidence hash chain — your compliance team can verify integrity on demand.