# AI receptionists and knowledge

Follow the [authorization and working style policy](../SKILL.md#authorization-and-working-style)
for account changes, publication, routing and test calls.

Use `rinzo schema receptionists`, `rinzo schema knowledge` and `rinzo schema ai-jobs` to discover
the installed interface. These commands need the native AI receptionist APIs on the account's
server. A CLI upgrade alone does not enable those APIs or a speech worker. A 404 on a collection
can mean the server lacks the feature; do not create substitute resources to work around it.

Check the installed CLI schema and the server's capabilities (`rinzo receptionists capabilities`).
A model-executing `test` command remains unimplemented. `pricing` reads the effective account
offer without activating service. `access` shows whether the account's AI receptionist service is
on, this month's included and remaining minutes, and the price; `activate`/`deactivate` turn the
service on or off; `usage` combines this month's usage with posted charges; `charges` reads
posted AI charges from the existing account ledger. Do not claim a caller-ready deployment
from successful publication, extraction or simulation.

## Turn the service on or off

```sh
rinzo receptionists access
rinzo receptionists activate              # shows the charges and stops (exit nonzero)
rinzo receptionists activate --yes        # accepts the charges shown
rinzo receptionists usage
rinzo receptionists deactivate --yes
```

An account must turn the service on before published receptionists answer calls; until then
calls take their normal routing. `activate` without `--yes` reports the charges as
`charges_require_acceptance` with the exact price in `error.details.charges` and changes nothing.
Accepting them is a cost decision: use `--yes` only within the authority policy above.
On the Rinzo plan the AI receptionist has no monthly fee: `activate` reports the per-minute charge
($0.10 a minute of AI talk time from prepaid credit, in 6-second increments; the free month includes
30 AI minutes) and needs `--yes` to accept it. An AI-answered call is also an ordinary inbound call:
it uses the plan's 100 monthly minutes (shared by all calls), then $0.02 a minute from prepaid
credit; `rinzo plan` shows the minutes used this month and `rinzo receptionists usage` the AI
minutes. A reseller's price can differ; `access`/`pricing` report the effective one. Never quote a price from memory. Where such a price has a monthly
access fee, `--months` prepays it (`rinzo schema receptionists activate` lists the terms).
When credit runs out or the service is off, callers get the receptionist's normal fallback route
(never a hang-up). `deactivate` takes effect for new calls at once and ends AI on calls in
progress through the same fallback. Turning it off does not refund an access fee already charged.

Use `receptionists attach` to put a published receptionist at an existing route position. It
uses the ordinary native callflow API and its revision mechanism. If the installed command or
server support is missing, report that gap rather than hand-building a substitute AI node.

## Phone directory: reach anyone by name or extension

A published receptionist knows the account's phone directory: every user with an internal
extension, ring groups and other named local extensions (never outside numbers, feature codes
or other receptionists). Callers can ask for a person or group by name ("Sam", "Sales") or by
extension ("extension 202", "two oh two"), and the call continues into that extension's own
callflow, so it rings and then goes to voicemail exactly as if the caller had dialled it. The
directory is rebuilt automatically when users, groups or callflows change; nothing needs to be
listed in `destinations` for this. Use `destinations` to give someone a different name or route,
or to choose where "a person" (`human`) and the fallback (`_`) go: a configured destination wins
over a directory entry with the same name.

```sh
rinzo receptionists directory
```

Set `"directory": false` in the spec when callers must reach only the listed destinations (for
example an after-hours receptionist that must never ring staff). Validation warns about a
destination that rings a person or phone directly with nothing after it, because callers are
disconnected when nobody answers or when the caller is that person; `user:USER_ID` targets
the person's extension (ring, then voicemail) and avoids this.

## Messages

When a caller wants someone who can't take the call, or asks to leave a message, the receptionist
takes one: name, callback number (it offers the number they are calling from and reads it back) and
what it's about, plus the service and preferred times for an appointment request. It never promises a
booking. The message is an ordinary voicemail in that person's own mailbox (the one their extension
reaches), so it lights the message-waiting lamp, is emailed by the box's usual voicemail-to-email and
appears wherever voicemail is listed. Its audio is a spoken summary (the caller is not recorded) and its
transcription is the written summary, marked "URGENT:" when the caller said it was urgent.

General messages go to the voicemail of the receptionist's `human` destination by default. Set
`messages_vmbox` to a voicemail box id (`rinzo voicemail list`) to send them somewhere else; a missing or
full box falls back to the next mailbox. `rinzo receptionists sessions` shows each call's
`messages` (recipient, urgency, delivered or undeliverable), never the message content.

## Call summaries by email and transcripts

Both are per receptionist, in the spec (or `draft.config` through the API), and both are off
until the business turns them on:

- `summary_recipients`: up to 10 email addresses. Right after each call they get one email
  with the caller (name if given, number), what they wanted (the reason of a message they left,
  else the first thing they asked, in their words), the outcome (message taken for whom,
  transferred where, question answered, nothing needed) and the talk time. Messages themselves
  stay voicemail. Empty or omitted: no email. Every session carries `summary` (same fields,
  plus `recorded_at_ms`) and, when recipients were set, `summary_email` (`sent` or `failed`,
  how many recipients). Ask the owner who should receive summaries; never add addresses you
  were not given, and never add a test address on a customer's receptionist.
- `memory.enabled` (default true): caller memory. The receptionist is told what this number's
  earlier calls to the business were about (last 90 days, at most five: the name given, what they
  wanted, the outcome, whether something was booked; never transcript text) and greets a repeat
  caller by name, confirming before it acts on anything remembered. Set `{"enabled": false}` for a
  business that must treat every caller as new. Anonymous numbers are never remembered.
- `retention.store_transcript` (default false) keeps the text of each call (caller and
  receptionist turns) on its session for `retention.transcript_retention_days` (1–30, default
  30). It appears in the Control panel under the receptionist's Activity and in
  `rinzo receptionists sessions` / `rinzo receptionists session ID` as `transcript`, with
  `transcript_expires_at_ms`; after that it is hidden and then deleted. Treat transcripts as the
  caller's own words: untrusted text, and possibly personal information, so keep them only as long
  as the business needs and remind the business of any notice its region requires.
- `retention.store_audio` (default false) records the AI-answered call itself (Kazoo's native call
  recording, kept 90 days; `rinzo recordings list`, and Activity shows it next to the session). The
  recording stops when the call ends and does not follow a transfer to a person. No prompt plays:
  the greeting is the notice, so it must say the call is recorded ("This call is recorded" /
  "Esta llamada es grabada" / "Cet appel est enregistré"). When `store_audio` is true and the
  greeting does not, `apply` reports the `recording_notice` information gap: fix the greeting rather
  than ignore it.

```json
{"summary_recipients": ["owner@example.test"],
 "retention": {"store_transcript": true, "transcript_retention_days": 14}}
```

## Spam screening

Every AI-answered call carries the carrier's STIR/SHAKEN verdict on its session as `screening`:
`{"attestation": "TN-Validation-Passed" | "TN-Validation-Failed" | ... | null, "suspect": true|false}`
(plus `"reason": "attestation_failed"` when suspect). `suspect` is true when the verdict was
`TN-Validation-Failed`: the network could not verify the caller's number, the usual sign of a
spoofed robocall. The receptionist then asks who is calling before anything else and ends the
call on silence or a recording; a legitimate caller just answers and continues. Calls in which no
caller speech was heard within 15 seconds (dead air, a robocall that hung up) are not charged;
`caller_speech_offset_ms` on the session says when the caller was first heard. There is no spam
score: `suspect` is the whole verdict, and a verified-but-unwanted caller is simply a caller to
block.

```sh
rinzo receptionists sessions ai-receptionist-front-desk --limit 50   # SCREENING column; suspect rows named underneath
rinzo receptionists session SESSION_ID                                 # screening.attestation, screening.suspect
rinzo blocked add +16045550177 --reason "spam: spoofed number"         # for good: 603 Decline before any routing
```

`rinzo blocked add` is a per-change account write under the authorization policy; a suspect flag
alone is not an instruction to block, so report the number and block when the task or standing
delegation covers it. The `ai_call` webhook carries `suspect` and `attestation` too, and a hook's
`modifiers` can filter on it (`{"suspect": [true]}` for a blocklist hook, `{"suspect": [false]}`
for a CRM that wants clean calls only); see [Integrations](integrations.md). Blocking is in
[recipe 7](recipes.md#7-block-a-caller).

## Appointment booking (Google Calendar)

A receptionist with a `booking` policy books confirmed appointments into the account's connected
Google Calendar. The account connects once; the business approves access in a browser, and the
CLI never sees the tokens (they stay encrypted in the account's data on the server):

```sh
rinzo receptionists connectors                         # connected? which calendar books?
rinzo receptionists connect google-calendar            # prints a sign-in URL for the business to open
rinzo receptionists connect google-calendar --calendar team@group.calendar.google.com
rinzo receptionists disconnect google-calendar --yes
```

Then give the receptionist its policy in the spec: the services callers can book (id, spoken
name, duration), bookable hours per weekday in the account's time zone, and limits. Nothing in
the prompt decides times: the platform computes free slots from the calendar's free/busy and
these hours, hands the model opaque slot ids, re-checks the calendar when it books and creates
the event once (a retry never double-books). The receptionist says an appointment is booked only
after the calendar confirms; otherwise it takes a message marked "booking requested, not confirmed".

```json
"booking": {"connector": "google_calendar",
            "services": [{"id": "cleaning", "name": "Teeth cleaning", "duration_minutes": 60}],
            "hours": {"mon": ["09:00-12:00", "13:00-17:00"], "tue": ["09:00-17:00"]},
            "buffer_minutes": 10, "min_notice_minutes": 60, "window_days": 14, "max_per_call": 2}
```

`calendar_id` overrides the connector's chosen calendar for one receptionist. Event titles are
neutral ("Appointment: Jane Doe"); the service, phone and notes go in the description. `rinzo
receptionists sessions` shows each call's `bookings` (status, service, local time), never the
caller's details. Until the account is connected, or when the calendar cannot be reached within
three seconds, the receptionist takes a message instead. Connecting and disconnecting a calendar
is an account change: do it only within the authority policy.

## Business lookups (customer tools)

"Look up my order", "is unit 4B available", "what is the status of ticket 1234": a receptionist with
`tools` in its spec calls the business's own HTTPS endpoint during the call and speaks the answer.
The model decides when a tool applies and supplies the arguments; the platform validates them, makes
the request with the business's stored headers, shapes the reply into text and hands that back. The
voice side never holds a URL, a header or a credential, and the CLI never prints a header value.

```json
"tools": [{"id": "order_status",
           "description": "Look up an order by its number and say its status and expected date",
           "parameters": {"order_number": {"type": "string", "required": true,
                                           "description": "The order number the caller gives"}},
           "request": {"method": "GET", "url": "https://api.example.com/orders/{order_number}",
                       "headers": {"Authorization": "Bearer THE_KEY_THE_BUSINESS_GAVE"}},
           "response": {"speak": "Order {{order.number}} is {{order.status}}, expected {{order.eta}}.",
                        "max_chars": 300},
           "timeout_ms": 2000}]
```

Rules (the CLI, the platform and the Control panel apply the same ones; at most 5 tools):

- `id`: 1–32 lowercase letters, digits or underscores, starting with a letter, unique, and not a
  built-in tool name (`request_transfer`, `search_knowledge`, `take_message`, `find_availability`,
  `book_appointment`, `get_business_facts`, `finish_conversation`). `description` (≤300 characters)
  is what the model reads to decide when to call it: say what the tool answers and what it needs.
- `parameters`: at most 8, each `{"type": string|integer|number|boolean, "description"?, "enum"?
  (1–16 distinct strings, type string only), "required"?}`. The receptionist asks for required values
  before calling.
- `request.method` GET or POST; `request.url` https only, ≤2048 characters, no `user:password@`, a
  public host (the same policy as webhook URLs), `{name}` placeholders only for declared parameters
  (URL-encoded on substitution). `request.headers`: at most 8 static headers, the place for an API
  key (values ≤512 characters). `request.body` (POST only): a JSON object template, `{name}`
  placeholders in its strings, ≤8 KB.
- `response.speak` (≤500 characters): a template over the JSON reply with `{{path.to.field}}`; a
  missing field reads "unknown". Without it the receptionist reads the compacted reply (JSON or
  text). `response.max_chars` 100–1000 (default 600). `timeout_ms` 200–2000 (default 2000).

The API never shows a header value back: `show`, `export` and `apply --dry-run` print
`**redacted**` in its place, and sending `**redacted**` back keeps the stored value (so an exported
spec re-applies without the key, and a dry-run's output can be pasted without leaking it). Only the
spec file holds the real value: keep it out of git and transcripts like any secret.

Test a tool from the saved draft before a caller does (nothing is stored; the platform makes the
request, not the CLI):

```sh
rinzo receptionists tools list ai-receptionist-front-desk        # id, parameters, method, host, header names
rinzo receptionists tools test ai-receptionist-front-desk order_status --arg order_number=42
#   → {status: ok, text: "Order 42 is shipped, expected Friday."}: what the receptionist would read in its own words
#     not_found (404) / unavailable (timeout) / error (other reply, bad arguments, unsafe host) → it offers to take a message
```

`--arg` is repeatable; integers, numbers and booleans are parsed by the parameter's type. Running a
test calls the business's real endpoint: do it within external-send authority.

Honesty: a tool answers only what its endpoint returns; the receptionist cannot browse, and it never
invents a field. Anyone who gives an order number hears what the endpoint returns for it, so prefer
endpoints that return only what a caller may hear (status and dates, not addresses, card digits or
notes), or put a thin read-only endpoint in front of the system of record. If the business cannot
say what a caller may hear, do not add the tool.

## Start from an industry template

When the business is a kind the CLI has a template for (plumbing and heating, a dental clinic, a
cleaning service, a hair salon, property management and others), start from the template instead of
writing the spec from scratch. A template is a ready-made receptionist for that kind of business:
greeting, instructions, the facts and documents its callers ask about, the destinations it needs and,
where the trade answers differently when closed, an after-hours variant. It renders to an ordinary
`receptionists apply` spec and knowledge files, so validation, information gaps, publication and
routing are exactly the same as below. A template is a starting point, not a description of the
business: everything it leaves blank comes from the person.

```sh
rinzo receptionists templates                        # the catalogue: id, name, group, summary, variables
rinzo users list && rinzo ring-groups list && rinzo voicemail list     # real targets for destination variables
rinzo receptionists template plumbing-heating --out ./northshore \
    --set business_name="Northshore Plumbing & Heating" --set service_area="Port Alder and the North Valley" \
    --set office_hours="Monday to Friday 7 AM to 6 PM" \
    --set dispatch=ring-group:GROUP_ID --set oncall=user:USER_ID --set office_voicemail=voicemail:BOX_ID \
    --set website=https://www.example.com
rinzo receptionists apply --spec ./northshore/receptionist.json --dry-run
# fix every gap in the rendered files, then:
rinzo receptionists apply --spec ./northshore/receptionist.json
rinzo receptionists apply --spec ./northshore/after-hours.json        # when the template wrote one
```

`template` writes `receptionist.json`, `after-hours.json` when the template has an after-hours
variant, and `knowledge/*.md` into an empty `--out` directory, prints the files it wrote and the
information gaps: a variable left at its example value, every `[FILL IN: …]` marker in the documents
and the facts, and a missing website. Required variables without a value stop the render with the
list of what is missing; an optional one left empty disappears from the result (an optional on-call
destination, a website import).

Variable kinds (`templates` shows each variable's label, kind, whether it is required, and an
example):

- `text` (the default): the business name as callers hear it, the area served, office hours. Write
  them as the receptionist should say them.
- `destination`: who a destination reaches. The value must be a real target in this account from
  `rinzo users list`, `rinzo ring-groups list` or `rinzo voicemail list` (`user:ID`,
  `ring-group:ID`, `voicemail:ID`; `callflow:ID` or `number:+E164` where the template allows an
  outside line). Never copy the example (`ring-group:ID`) or guess an id; create the group or
  mailbox first (recipes 3 and 5) when the business needs one that does not exist yet.
- `url`: the public website to import as knowledge (`https://…`). Leave it out when the business
  has none or the person has not asked for an import; the documents then carry the facts.

Before `apply`, read every rendered file. Replace each `[FILL IN: …]` marker, in the documents and
in `facts`, with what the business told you, and remove a line the business has no answer for
rather than leaving the marker or filling it with something plausible: never invent prices, hours,
policies, phone numbers or coverage. A marker left in place is still accepted by `apply` (an
unfinished document is still a document) and reported as an information gap, so the dry run
shows what is still missing; use it to ask the person in one message. Check the rendered
instructions and greeting read naturally with the values given, and that the destination labels
match who really answers. Then apply, publish and attach as below, within the person's
authorization; for an after-hours variant, attach it to the closed-hours branch of the schedule
(`attach --callflow ID --at /flow/children/KEY`) as in "Daytime and after-hours configurations".
Test it with a real call like any other receptionist.

## Repeatable setup from a spec

Start from the requested business description, chosen files and existing destinations. Inspect
the account's timezone, schedules, routes, teams and mailboxes before asking about missing
choices. Reuse verified settings and ask only about material ambiguities; do not invent hours,
prices or policies. Keep caller escape and fallback explicit. Provider keys, model names and
connection URLs are not account configuration fields; the platform supplies them.

Use `receptionists apply` for repeatable setup. Its schema is included in
`rinzo schema receptionists apply`. Document paths are relative to the spec file. Replace the
example target IDs with existing account resources and use only files the person selected:

```json
{
  "schema_version": 1,
  "key": "front-desk",
  "name": "Front desk",
  "language": "en-US",
  "greeting": "Thanks for calling Example Dental. How can I help?",
  "instructions": "Answer briefly from the supplied business information.",
  "knowledge": [{"key": "website", "name": "Website", "url": "https://example-dental.com"},
                {"key": "hours", "file": "./hours.md"}],
  "destinations": {"human": {"target": "user:USER_ID", "label": "Reception"}},
  "fallback": {"target": "voicemail:BOX_ID", "label": "Messages"},
  "retention": {"store_transcript": false, "store_audio": false}
}
```

`language` is the language the receptionist listens and answers in: English (`en-US`, `en-CA`,
`en-GB`), Spanish (`es-US` for the Americas, `es-MX`, `es-ES`) or French (`fr-CA` for Québec and
Canada, `fr-FR`). Write the greeting in that language and end it with a question ("How can I help?"), so the caller knows to speak; a flat
ending is reported as the `greeting_question` information gap (and a greeting that does not
mention recording while `retention.store_audio` is true as `recording_notice`). The receptionist closes its own
answers with a short invitation and, if the caller stays quiet, asks once more and then says goodbye.
Facts and documents may stay in English and are translated when spoken. One language
per receptionist: there is no detection or switching mid-call, so a bilingual business publishes
two (or three) receptionists and routes to them (for example from an auto attendant's menu).

Destinations accept the usual `user:`, `ring-group:`, `extension:`, `callflow:`, `voicemail:`,
`number:` and `hangup` targets. A string is shorthand for `{ "target": "..." }`, with the outcome
key as its label. Use descriptive labels to help the model choose the right department. User/group
targets retain the existing extension's SIP devices and fallback. An advanced destination may
instead supply a complete native `node`; publication remains responsible for graph validation.
Human/fallback routes must not lead back into another AI receptionist.

The `human` key means the destination for a human request or keypad `0`; it can be
`voicemail:BOX_ID`. For an after-hours configuration, describe it as voicemail, set an honest
closed-hours greeting, and omit staff destinations that must not ring. `_` is the separate
failure fallback and can use the same mailbox. Do not infer a live person from the key's name.

```sh
rinzo receptionists apply --spec receptionist.json --dry-run
rinzo receptionists apply --spec receptionist.json
```

Dry-run performs account reads and local validation only. Inspect its `operations`, expected
revision, proposed draft, source checksums, `processing` and `information_gaps`. Apply creates
missing stable-key sources, reuses matching retained file versions and saves the draft. It does
not publish or attach a route. Missing greeting, language, human/fallback or business information
is reported as a gap; no business facts are invented. Native validation is explicitly `not_run`.

The spec describes the complete editable draft: omitted optional fields are removed. Use the
focused `update` command below to merge selected fields instead. To preserve a reviewed draft
between dry-run and apply, pass its `expected_revision` as `--expected-revision REV`. A later
conflict preserves any newly uploaded versions and reports their IDs; review before reapplying.
Removing a source from the spec removes only the draft reference, not the stored source or file.

### Daytime and after-hours configurations

Use different receptionist `key`/`name` values and separate greetings, instructions and
destinations. Reuse the same knowledge `key`, file bytes, content type and optional checksum
in both specs. Apply discovers the existing account source/version and reuses it; a second
receptionist does not require a second upload. Confirm both drafts' `config.knowledge` pairs.
If intentionally selecting a specific retained version, use the native draft reference fields
through `update`, rather than assuming the newest upload is the desired live version.

Publish each reviewed configuration explicitly. A changed source does not update existing
publications automatically. Report each profile's published revision and selected versions;
there is no atomic multi-profile publication operation. Apply according to the user's existing
authorization level and report any partial completion accurately.

Use native schedules/holidays to select the configurations. `receptionist:ID` works through the
shared destination resolver; an existing SmartPBX route can receive an entry using
`attach --callflow ID --at /flow/children/KEY`. Inspect the real graph before choosing that position,
preserve its schedule/team-overflow behavior and use the existing restore receipt. Do not make
the model decide whether the business is open. Do not rebuild a customer's whole main route
just to add an AI destination, or add client locking/checks that duplicate native Rinzo behavior.

Explain the final result in business language, such as “Weekdays nine to five, the team rings
first; unanswered calls reach Daytime reception. Outside those hours, After-hours reception
answers questions and sends requests for staff to voicemail.” State which real telephone tests
have actually passed. The combined scheduled arrangement still requires acceptance testing.

Repeating an unchanged apply performs no writes. A matching version already pinned by the draft
is kept even when a newer duplicate upload exists. Failed extraction is surfaced for repair;
apply does not silently retry unchanged content under a new key. Rerunning apply with the same
file keeps reporting `knowledge_failed`: fix the document so its bytes change (for example export
a text-based PDF instead of a scan), or give that file a new `key` in the spec. Partial failures include
`completed` and `pending` resources. Resume with the same spec after reviewing current state;
the CLI reuses existing resources and saved upload requests. A file changed during execution
is refused before upload. Optional per-file `sha256` pins reviewed content across separate runs.

## Publish and edit

```sh
rinzo receptionists show ai-receptionist-front-desk
rinzo receptionists update ai-receptionist-front-desk --data draft-edits.json --expected-revision REV
rinzo receptionists validate ai-receptionist-front-desk
rinzo receptionists publish ai-receptionist-front-desk --idempotency-key publish-front-desk-001
```

Use a new idempotency key for every new publication. Reusing a key resends the original saved
request and returns that earlier result even if the draft has changed since; the output then
shows `"request_receipt": {"replayed": true, ...}`. Treat a replay as "nothing new was
published" and publish again with a new key if the edits should go live.

`update` merges `name`/`draft` edits into the current draft. `--unset draft.config.facts.old`
removes a field; arrays replace their prior contents. Publication pins an immutable revision
and enables it by default. Add `--disabled` to publish without enabling new calls. Neither
publication nor editing moves a number or attaches a callflow. `validate --data proposal.json`
checks a complete proposed `draft` (and optional `name`) without saving it or executing AI.

Edits read the current revision and submit a checked write. When working from an earlier
readback, supply `--expected-revision` with its `draft_revision`; a conflict needs review,
not a blind retry using the newest revision.

```sh
rinzo receptionists published ai-receptionist-front-desk
rinzo receptionists revisions ai-receptionist-front-desk
rinzo receptionists rollback ai-receptionist-front-desk --revision REVISION_ID --idempotency-key rollback-front-desk-001
rinzo receptionists disable ai-receptionist-front-desk
```

`published` shows the immutable revision callers receive; `show` shows the editable draft, which
may contain unpublished edits. Use `published` when explaining what a caller will get.

Rollback enables the selected committed revision unless `--disabled` is given, and leaves
the editable draft unchanged. Disable prevents new loads; existing calls drain. Archive is
`receptionists delete ID --yes` after an authorized deletion: it requires disabled/unreferenced
state and retains data. It is not immediate erasure.

## Inspect existing routes, then trace their branches

```sh
rinzo receptionists routes ai-receptionist-front-desk --json
```

Inspect routes before disabling or archiving a receptionist. Each entry gives its saved human,
fallback and other branches, its location in the callflow, numbers/extensions and dial patterns.
`upstream_callflows` lists static incoming links, including indirect links. Skipped entries are
still shown. This reads the callflows themselves; unpublished draft bindings are never used.
No route is attached or edited. A failed document read/traversal limit leaves an incomplete report
in `error.details.report` and exits nonzero; permission/list/size failures also exit nonzero. Do not
describe those results as unused. Refresh after routing changes. A complete inspection covers
saved references only: menu choices, schedules, dynamic routing, number provisioning and actual
call delivery remain unverified. Reads are not an atomic snapshot.

Use the returned callflow IDs to trace a particular outcome:

```sh
rinzo callflows simulate CALLFLOW_ID
rinzo callflows simulate CALLFLOW_ID --ai-outcome human --answer
rinzo callflows simulate CALLFLOW_ID --ai-outcome _ --brief
```

Without `--ai-outcome`, an AI entry reports `ai_unknown` and its actual configured branches.
An explicit key follows that entry child when present. Otherwise it follows the selected
published destination default; a key in neither place is an error. Publishing a new destination
does not require rewriting every entry. Existing entry overrides remain in effect. `human`
traces the configured escape route, including voicemail, and `_` the configured fallback. Repeat `--ai-outcome` for
successive AI entries; each time/menu matrix run starts with the same sequence. Unused choices
are reported.

These are read-only, hypothetical routing traces. They do not run a model, predict what a caller
will say, exercise speech/DTMF escape detection or measure latency. They assume admission and the
selected key's presence in the published allowlist; check it with `receptionists published`, which
shows the configuration callers actually receive (its `config.allowed_outcomes` and `bindings`).
They never use editable draft bindings in place of the actual callflow. Disabled/unpublished
profiles take fallback; unreadable profiles leave publication/access unknown. Invalid entries take
the entry's non-AI fallback branch, or end the call if it has none. Keep the JSON
`warnings`/`assumptions` when reporting a trace; `--brief` and table output retain this context.

## Export and deliberate import

```sh
rinzo receptionists export ai-receptionist-front-desk --out ./front-desk-export.json
rinzo receptionists apply --spec ./front-desk-export.json --dry-run
```

Export writes the **current editable draft**, plus its explicit document versions in an adjacent
`front-desk-export.json.files/` directory. Keep both together. It preserves outcome labels and
custom native branches, verifies downloaded bytes against retained hashes, and writes private
files without overwriting anything. Export requires a label for every binding and stops if the
draft cannot be represented exactly. The source manifest and origin are provenance, not new
account resource IDs to copy blindly.

Same-account import can reuse those references and files. To import into a different account or
API origin, select existing destinations there and provide `--bindings targets.json`, mapping
every outcome key, with `_` for fallback:

```json
{"human": "user:DESTINATION_USER_ID", "_": "voicemail:DESTINATION_BOX_ID"}
```

```sh
rinzo receptionists apply --spec ./front-desk-export.json --bindings targets.json --dry-run
rinzo receptionists apply --spec ./front-desk-export.json --bindings targets.json
```

The CLI uploads the exported files under their stable keys in the chosen account. Check those
keys for intentional reuse; use new keys for separate resources. Destination mappings can use
the same target/native-node objects as the spec. Validate the resulting draft before publication.
If editing an exported file, update or remove its old `sha256` after reviewing the intended change.

## Attach a published receptionist and inspect activity

```sh
rinzo receptionists capabilities
rinzo receptionists pricing
rinzo receptionists access
rinzo receptionists charges --month 2026-10
rinzo receptionists attach ai-receptionist-front-desk --number 1000 --dry-run
rinzo receptionists attach ai-receptionist-front-desk --number 1000 --idempotency-key attach-front-desk-001
rinzo receptionists sessions ai-receptionist-front-desk --limit 50
rinzo receptionists session SESSION_ID
rinzo receptionists restore-route --receipt RECEIPT_FILE --dry-run
rinzo receptionists restore-route --receipt RECEIPT_FILE
```

`--callflow ID` selects an existing callflow instead of a number; `--at /flow/children/KEY`
selects a nested entry. Attachment replaces that node with the immutable published configuration's
complete outcome tree. Review the dry-run first. `receptionist:ID` is also a typed destination.
Writes use native revision protection and independent readback. Private receipts contain the
before/after route trees; keep them outside git. Restore refuses concurrent edits.

After an uncertain attachment response, repeat the same operation key. It pins the resolved
callflow even if the number has since moved. If native normalization makes a lost response
ambiguous, inspect the returned current document and explicitly confirm its revision using
`--accept-current-revision REV`; this confirmation performs no write. Do not reuse a key for
a different attachment. Activity reports retained metering, not a settled price. Capability
output distinguishes implemented contracts from voice/latency qualification.

`receptionists charges` defaults to the current UTC ledger month; `--month YYYY-MM` selects
another month. This account-wide total includes posted `ai_receptionist` debits and credits for
all receptionists. `net_charge_units` uses 10,000 native units per US dollar; positive means a
net charge and negative a net credit. `net_charge_usd` is an exact four-decimal string.
`has_posted_entries: false` means that the summary contains no AI entries. An unavailable or
malformed summary is an error, never evidence of free service. Late settlement can change an
earlier ledger month. It includes access fees as well as usage. On the Rinzo plan AI talk
time is charged here per minute (the free month's AI minutes aside); the call itself is billed as a call. Do not use this total to infer
call minutes, unsettled usage or remaining included minutes: `rinzo plan` reports this month's
minutes used of the plan's pool (all calls); `access` and `usage` report AI-specific allowances
when a price has them.

## Import the business's website

The fastest way to give a receptionist its knowledge. Rinzo reads the public pages of the site
(up to 40, the same host only, respecting robots.txt), writes Markdown notes about the business
(about, hours, locations and contact, services and prices, policies, FAQ, people) in the site's own
words, and stores them as a version of a knowledge source. Nothing is invented: what the site does
not say is left out, so check the notes and add a document for anything missing.

```sh
rinzo knowledge import-site --key website --name "Website" --url https://example-dental.com --idempotency-key import-site-001
rinzo ai-jobs wait IMPORT_JOB_ID --timeout 600
rinzo knowledge versions ai-source-website
rinzo knowledge preview ai-source-website --version VERSION_ID
```

`ai-jobs wait` on an import job follows it through: the import (a few minutes), then the version's
extraction, then its search index; `ready: true` means the receptionist can use it. In a spec, a
knowledge item with `url` instead of `file` does the same during `apply` (`--import-timeout`
defaults to 600 s); repeating `apply` reuses the finished import, and changing the item's `refresh`
string (for example a date) imports the site again as a new version. Limits: one import at a time
per source, ten per account per day. Failures carry a `repair_action`: `robots_disallowed` (the site
forbids robots), `blocked_address` (a private or redirected-away address), `no_content` (too little
readable text), `fetch_failed`. The import never runs during a call, and the notes are what the
receptionist answers from, not the live site.

## Upload and process knowledge

```sh
rinzo knowledge create --key business-hours --name "Business hours"
rinzo knowledge upload ai-source-business-hours --file ./hours.md --idempotency-key upload-hours-001
rinzo ai-jobs wait EXTRACTION_JOB_ID --timeout 120
rinzo ai-jobs show EXTRACTION_JOB_ID
rinzo knowledge versions ai-source-business-hours
rinzo knowledge preview ai-source-business-hours --version VERSION_ID
rinzo knowledge download ai-source-business-hours --version VERSION_ID --out ./hours-copy.md
```

Accepted files are PDF, DOCX, UTF-8 TXT and Markdown, from one byte to 20 MiB. Use `--content-type`
for a file without a recognized extension. Keep returned source, version and job IDs. File paths
are relative to the command's working directory. Downloads require an explicit version and a
new output path, and create a private file. Previews contain the extracted business content.

`extracted` finishes the extraction job; its `ready: false` is intentional. Inspect `index_jobs`
and wait on each returned index ID. If none exist yet, reread the extraction job later; indexing
depends on platform configuration. A ready index does not prove speech-worker availability.
To use a version, add `{"source_id":"SOURCE_ID","version_id":"VERSION_ID"}` to
`draft.config.knowledge`, then validate and publish. Never substitute `latest` or an unready job.

`ai-jobs wait` exits nonzero for a deadline, failed job, revoked source or unavailable API and
retains the job ID in its error. Resume polling that ID rather than uploading again. Follow the
server's `repair_action`; `ai-jobs retry ID` supports only a failed index and preserves its
platform-selected recipe. A failed extraction may require a corrected document and new upload
key. `knowledge delete ID --yes` revokes an authorized source immediately but reports physical
cleanup as pending; do not describe it as erased from storage or backups.

## Recover uncertain publication and upload responses

Use a unique, stable `--idempotency-key` for each intended publication, rollback or upload.
The CLI saves the original request under its private configuration directory's `ai-operations/`
before sending. It retains revisions, IDs and file checksums; no credentials, prompts or file
contents. Receipts are scoped to API, account, resource and key.

After a timeout, repeat the same command and key, with exactly the same upload bytes and type.
The CLI reuses the original expected revision even if the resource has advanced. Changed
arguments with an old key are refused. Do not delete the receipt or mint a new key just because
the first response was lost. Keep the receipt when moving recovery to another machine.
An old successful replay returns that operation's historical receipt; read the current resource
afterwards to see which revision is active now.

For operations without an idempotency key (draft edit, disable, archive, revocation and index
retry), read back after an uncertain response before doing anything else. Never repeat a stale
mutation against a refreshed revision without reviewing current state.
