Ask the hosted coordinator brain an initiative-wide question
POST/api/coordinator/consult
Ask the hosted coordinator brain an initiative-wide question. Loads initiative-scoped state (in-progress tasks, recent consults, initiative profile), reasons via Claude, writes one row to coordinator.consults, and emits coordinator.consult.created via auditCritical — all in one transaction. Called by the consult_coordinator MCP tool, the pt consult CLI, and (Phase 2) the Directory chat UI.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 422
- 429
- 502
- 503
- 504
Successful response
Validation failure (malformed initiativeId, missing question, etc.)
Caller is not authenticated.
Caller is not a member of the requested initiative.
Initiative not found in the caller's tenant.
The prompt-injection guard stopped the consult (INJECTION_GUARD_ABORTED). Not retryable — the same context trips the same guard.
The tool loop hit a RESOURCE cap — budget-tool-calls or budget-tokens (TOO_MANY_REQUESTS). Despite the status this is not rate limiting; it is the consult's own per-run allowance. A consult row and audit entry were written before this was raised. Distinct from the 504 time budget below.
Claude API call failed or returned an unparseable response.
AI provider not configured (e.g. AI_PROVIDER=claude set without ANTHROPIC_API_KEY).
The tool loop exceeded its wall-clock time budget (COORDINATOR_DEADLINE_EXCEEDED, PLT-849). A consult row and audit entry carrying the partial trace were written before this was raised, so the run is in the decision log. Distinguish it from a platform/proxy 504, which carries NO error code and gives no such guarantee.