Authentication API
Human users authenticate with the custom Cognito-backed auth flow. Agents use scoped Bearer tokens or x-api-key headers that are tied to plans, workspaces, agents, scopes, and rate limits.
- Session cookie: buildr_plannr_session for local development or Cognito token cookies in deployed environments.
- Agent token: hashed token material with workspace, agent, actor type, scopes, rate limits, and disabled or revoked state.
- Authentication failures are audited without storing raw tokens or secrets.
/api/auth/loginStarts a custom login flow and returns the user to the requested protected path when authentication succeeds.
Login request
bashcurl -X POST https://app.buildr.example.com/api/auth/login \
-H "content-type: application/json" \
-d '{"email":"owner@example.com","password":"not-logged"}'Login response
json{
"data": {
"redirectTo": "/app",
"mode": "cognito"
}
}Errors
400 invalid-input, 401 unauthorized
Pagination
Not paginated.
Idempotency
Login attempts are not idempotent. Clients should retry only after user action.
/api/api-keysCreates a scoped API token for an agent, automation, or user integration when the workspace plan allows API access.
Create API key
bashcurl -X POST https://app.buildr.example.com/api/api-keys \
-H "content-type: application/json" \
-b "buildr_plannr_session=..." \
-d '{"label":"QA agent","workspaceId":"workspace-buildr","agentId":"agent-qa","planId":"pro","scopes":["issues:read","agents:execute"]}'API key response
json{
"data": {
"apiKey": {
"id": "api-key-qa-agent",
"workspaceId": "workspace-buildr",
"agentId": "agent-qa",
"scopes": ["issues:read", "agents:execute"],
"rateLimit": { "requestsPerMinute": 600, "burst": 1200 }
},
"token": "buildr_live_..."
}
}Errors
400 invalid-input, 403 forbidden
Pagination
Not paginated.
Idempotency
Key creation is not idempotent. Store the returned token immediately because it is shown once.