Authentication
Two layers (see Authentication):X-API-Key: krnl_...— your provider key, which must have theagent_api_accessfeature enabled. Required on every call.X-Verified-Session: <token>— a short-lived session obtained via the verify flow, required on the endpoints marked verified below.
Endpoints
GET /partner/agent/customers/search
Query params:q (min 2 chars, required), limit (1–100, default 25). Returns masked matches;
when ambiguous is true, ask for the service address/unit, append to q, and search again.
GET /partner/agent/customers/
RequiresX-Verified-Session. Returns the slim CustomerProfile — no Stripe IDs, operator
notes, MAC or user_id.
POST /partner/agent/verify/issue
channel is email (default) or sms. SMS is delivered via Twilio and is inert until
configured (503 dependency_unconfigured).
POST /partner/agent/verify/check
(provider, customer) pair.
GET /partner/agent/customers//billing-summary
RequiresX-Verified-Session.
GET /partner/agent/customers//payments
RequiresX-Verified-Session. Derived from paid invoices (no separate payments table).
GET /partner/agent/customers//network-health
RequiresX-Verified-Session.
POST /partner/agent/customers//notes
RequiresX-Verified-Session. Adds an internal, operator-visible note (attributed to the AI).
PATCH /partner/agent/customers//contact
RequiresX-Verified-Session. contact_type is contract (default) or invoice; only the
fields you send change. Applies immediately — no confirmation email or rollback exists yet (see Overview).
POST /partner/agent/customers//password-reset
RequiresX-Verified-Session. action is password_reset (default, 15-min token) or
resend_activation (the account set-up mail with a 14-day token; 409 already_activated once
the customer has chosen a password — use password_reset then).
POST /partner/agent/customers//plan-change/preview
RequiresX-Verified-Session. Read-only quote of the billing impact of an upgrade or
downgrade for the rest of the current calendar month — nothing is applied.
one_time_adjustment may now come back null (see
below); its type value that used to read charge now reads next_invoice_line.
proration_factor (on the response) and due_in_days (inside one_time_adjustment) are
deprecated and will be removed in the next release — read days / days_in_period
instead.
one_time_adjustment is null (with an explanatory note, still a 200) in three cases:
the current calendar month has not been invoiced yet, or the invoice and the
correction-tracking document disagree (one exists without the other — an
operator-escalation state, not a number to quote to the caller). Otherwise type is
next_invoice_line (upgrade — nothing charged today, a line on the next monthly invoice),
credit (downgrade — credited now, applied to the next invoice), or none (the correction
is under $0.50 and is skipped, folded into whichever correction runs next; amount is
0.00). days / days_in_period replace the old proration_factor; there is no
due_in_days any more, since an upgrade never bills on its own. A second plan change on
the same calendar DAY is refused with 409 — a change day is billed at the new price, so
the next change is possible from tomorrow; only a kurnl platform admin can override that,
and the AI cannot.
POST /partner/agent/customers//plan-change
RequiresX-Verified-Session. Must include confirm: true (call /plan-change/preview first).
Live — no sandbox gate. With confirm: true this applies a real, billing-affecting plan change wherever the key has access. Planned hardening (quote_token, Idempotency-Key, rollback) has not shipped.
POST /partner/agent/tickets
Not verification-gated (so escalation works for unverified callers). Providecustomer_id
(own provider) or contact_email.
priority is low | normal | high; transcript is stored as an internal note.
Rate limits
Exceeding a limit returns
429 (standard rate-limit response; back off and retry).
Errors
Most errors use a normalized envelope with a stablecode and a request_id — but the plan-change endpoint’s delegated validation errors and unhandled 500s return plain {"detail": "…"} without a code, and a disabled account surfaces as 403 invalid_api_key (see the reference’s envelope-gaps warning):