Replace an agent's escalation policy (writes the DRAFT)
Replace the agent’s escalation policy. Writes the DRAFT agent config; publish freezes it into the compiled config (the tester exercises the draft, live traffic uses the published copy). Validated at write AND re-validated at runtime: every external:<destinationId> route must point to an OWNED destination that is active, whose AI-Harness integration is connected, and whose allowedChannels superset the rule’s channels; an sms-channel rule additionally requires the org’s 10DLC/TCR campaign ACTIVE. The reserved LLM-classifier conditions (intent_in / confidence_gte / sentiment) are rejected with 422 unsupported_condition. The PAYG plan gate is a non-blocking WARNING here (save is allowed); it is enforced at runtime (external rules are skipped on PAYG). Each rule’s routeTo (and the fallback’s) uses the ref grammar external:<destinationId> | email:<address> | queue:<id>.
Authorizations
Flowyte secret API key (Authorization: Bearer flowyte_sk_live_…). Scope-gated; is scoped to your organization — a key can never reach another tenant. The listed scopes in each operation's apiKey requirement are the scopes that key must hold. The tokenUrl is nominal: keys are minted in the dashboard.
Path Parameters
The agent id whose escalation policy you are reading or replacing (the same id returned by createAgent / listAgents).
Body
A per-agent ordered escalation routing policy (deterministic, no LLM). The first rule whose conditions match AND whose route can be satisfied wins; a matched rule whose runtime gate fails falls through to the next rule, then the fallback, then the existing support handoff.
Response
The saved policy (with any advisory warnings).
A per-agent ordered escalation routing policy (deterministic, no LLM). The first rule whose conditions match AND whose route can be satisfied wins; a matched rule whose runtime gate fails falls through to the next rule, then the fallback, then the existing support handoff.