Reading this as an agent? Here is how Retavon works.
If you are ChatGPT, Claude or another agent working for someone at a Retavon business, this page and the OpenAPI document are all you need. The API was shaped for you first, and the web app the staff use is a client of it. Anything a person can do on screen, you can do through the API with that person's permissions, and every step you take is on the record. The owner reading over your shoulder is welcome too.
One work order, two ways in
Work order 1004 is open. The service manager sees it on screen. An agent asks the API for the same record and gets the same choices, each with the reason it applies.


{
"work_order_number": 1004,
"status": "open",
"customer_name": "Peyton Nielsen",
"location_name": "Boise Showroom",
"problem": "Tub trips the breaker when it heats. Pulled the spa pack and brought it in for a look.",
"next": [
{ "operation_id": "bookWorkOrderVisit",
"why": "No visit is booked: book one to do the work." },
{ "operation_id": "recordLaborTime",
"why": "Start a timer, or record time worked." },
{ "operation_id": "completeWorkOrder",
"why": "The work is done: record what was done, which charges the rest." },
{ "operation_id": "cancelWorkOrder",
"why": "It will not be done." }
]
}
| On screen, for a person | In the API, for an agent |
|---|---|
| Book a visit | bookWorkOrderVisit |
| Done | completeWorkOrder |
| Call it off | cancelWorkOrder |
A key for each agent, with the limits you choose
A key that acts for a person holds what they hold, and its work is theirs in the audit trail; only that person can issue it, from a session signed in within the last ten minutes. A key that acts for nobody holds the roles you give it. Either can be read-only, which refuses every write whatever its roles. Keys last 90 days unless you choose otherwise, up to a year, and can be rotated or revoked at any time.
{
"name": "Claude Desktop, front counter",
"acts_for": "me",
"read_only": true,
"expires_in_days": 30
}


Keys are issued, rotated and revoked on this screen as well as through the API.
Every record says what can happen next
A record with a status carries next: the operations its state allows, each with its method, path and why. An agent reads its options from the record in front of it instead of from a manual. A fresh quote offers these, among others:
"next": [
{ "operation_id": "openSalesOrder",
"why": "The customer has agreed: make the quote an order." },
{ "operation_id": "getQuoteDocument",
"why": "Print the quote for the customer to take home." },
{ "operation_id": "emailQuote",
"why": "Email the quote to the customer." },
{ "operation_id": "addSalesOrderPackage",
"why": "Add a package (a spa with its cover, steps and delivery) to the quote." },
{ "operation_id": "cancelSalesOrder",
"why": "The customer will not go ahead." }
]
When an agent needs a yes, it asks a person
An agent can put a change or a question about one record to a person: up to six options in its order of preference, each a write it proposes or an answer. When the person chooses, the write runs as them, with their permissions, so an agent can propose what its own key does not reach. The person can change the details before saying yes, say yes once something is done first, hand the question to someone who should decide, or decline. If the record has moved on since the question was asked, nothing runs.
Refusals say what is wrong and what to do
Errors are problem documents with a stable code, a detail written for the reader, whether a retry could help, and a typed next pointing at the operation to try instead. When the database refuses something, the reply states what happened with the numbers, then what to do. This is the reply to a request with no key:
{
"status": 401,
"code": "unauthenticated",
"title": "Authentication required",
"detail": "Send a valid API key in the Authorization header: 'Authorization: Bearer rtv_...'. If this key used to work, it has expired, been revoked, or the staff member it acts for has left: a person signs in again; an agent asks the person it works for for a new key.",
"retryable": false,
"next": [
{ "operation_id": "startSignIn", "method": "POST", "path": "/v1/sign-in/start",
"why": "Sign in again for a new session." }
],
"request_id": "1bcb1d70-f91f-40ec-8027-5e92f0fd7933"
}
The numbers on the paperwork work as ids
People quote order numbers, SKUs and work order numbers, so where a record has one, the API takes it in place of the id: an order number, a SKU, a store's code, a customer number, a purchase order, a work order, a receipt or a gift card number. Every reply puts the name beside the id, so an agent can tell a person what it did in words they recognise.
{
"work_order_number": 1099,
"customer_name": "Sky Lowe",
"location_name": "Boise Showroom",
"equipment_name": "Sundance Optima (2012)",
...
}
Money and stock move once
Every write that takes money or moves stock takes an idempotency_key, held unique in the database. An agent whose connection drops sends the same request again and the deposit is taken once. Here a quote becomes an order with its deposit, in one step:
{
"deposit": {
"payment_method_id": "01a11f0b-1210-7fda-81e7-e569b8344af6",
"amount": "2000.00",
"reference": "Check 4417"
},
"idempotency_key": "open-1042-deposit"
}
An event feed that never skips
An agent that watches the business registers as an event consumer, reads what is new, and acknowledges what it has handled. The next read starts after the last event it acknowledged, so nothing is missed; events not yet acknowledged come back, so an agent handles each one in a way that is safe to repeat.
To be told instead, subscribe an https address to the event types you want. Each event is posted to it, signed by the Standard Webhooks scheme, and retried for a day until the address answers; the deliveries and their answers can be read back at any time.
Industry work is a feature the owner switches on
What one kind of store needs and another never uses is a feature: water care, delivery, work orders, warranty claims, floor plans, fitment, commission and more, 56 in all. The owner turns each on or off (listFeatures, updateFeature), and a feature may require others. A feature that is off has its operations refused and left out of the OpenAPI document and every record's next, its permissions cannot be held, and its screens are not found. Money and stock it already recorded still read and settle. So the document a key is served describes what that business uses.
What a business needs and Retavon lacks is built into the one codebase as a feature, which any business may then turn on. There is no fork and no plugin, so every update reaches every store.
Start at the base URL and read in pieces
Any agent can work Retavon today from GET / with an API key, with nothing installed and nothing else to read first. The service index points at a map, and each read from there holds what one step needs and names the rest, sized so that a small model takes it in whole:
/openapi: the tags alone, each with what it covers, its count and its address./openapi/tags/{slug}: a tag's operations in a few lines each: summary, the permission a call needs, what it moves, whether a repeat is safe, and the address of its own read. Median 5,000 characters./openapi/operations/{operationId}: what calling it needs: its method and path, its request schemas, the names of its result's fields one level down, its errors in a line, and the addresses of the rest. Median about 1,000 tokens./openapi/operations?q=word: every operation mentioning the word, one a line, grepped on the server. Withoutq, all of them./openapi/schemas/{name}: one schema, read once. The error schema is one of these.
Every read of a record or a page takes fields=a,b and answers with those fields alone; an unknown name is refused with the names there are. The whole document is still at /openapi.json for code generators, several megabytes, more than an AI client shows its model. All of it is tested for an agent: every operation described, every error saying what to do next, every read held to a budget by a test, and walked by agents that knew only the base URL, a key and curl.
{
"name": "Retavon API",
"map_url": "/openapi",
"openapi_url": "/openapi.json",
"authentication": "Authorization: Bearer <api key>",
"start": "GET /openapi, then the tag's url, then the operation's; GET /v1/identity for who you are",
...
}
The MCP server is the same reads, as tools
The server at api.retavon.com/mcp is a thin wrapper over the reads above and the operations. Its tools are map, find_operations, read_tag, read_operation and read_schema, which are the document's reads, and call_read and call_write, which call one operation by id with its path parameters, query and body. Nothing in the server names an operation, so it cannot drift from the document, and an operation only the web app calls is refused before any call. Reads are marked read-only and run; writes are marked as what they are, so a client asks the person before one.
Two ways in, and the business's rules for agents hold both:
- Signed in as the person. A client that signs people in (Claude's and ChatGPT's connectors, Codex with
codex mcp login) finds Retavon's authorization server through/.well-known/oauth-protected-resource, and the person signs in there. From then on the client acts through an agent key derived from that sign-in, named MCP connector on the Agent keys screen, held as every agent key is: a manager who revokes it ends the sign-in. - With an agent key. A client that holds a token (the OpenAI Responses API's
mcptool, Codex with a bearer) sends an agent key the business issued asAuthorization: Bearer, and the server acts as that key. A key of any other kind is refused.
Claude Code reaches the hosted server the second way, with an agent key as a header.
claude mcp add --transport http retavon \
https://api.retavon.com/mcp \
--header "Authorization: Bearer rtv_..."
{ "type": "mcp",
"server_url": "https://api.retavon.com/mcp",
"authorization": "rtv_..." }
The API describes itself
More than 800 operations in one OpenAPI 3.1 document, named by the job a person at the store would do, not by table. Field descriptions are written for a reader who has never worked in the business. Lists page by cursor. ChatGPT and Claude reach Retavon as a connector at api.retavon.com/mcp, signed in as the person; Claude Code and any agent of your own start at api-demo.retavon.com and send HTTPS requests with a bearer key, served from the same build every business runs. How the reads were sized, with the numbers, is in Tuning an API for AI agents.
Questions
Can an agent do more than the person it works for?
No. A key that acts for a person holds exactly their permissions, and nobody, person or key, can grant a permission they do not hold.
How do I see what an agent did?
The audit trail records every change with the key that made it, the person it acts for, the time, and what the record was before. Filter it by person or by key.
Which agents work with it?
ChatGPT and Claude through the connector, signed in as the person; Codex and the OpenAI Responses API through the same server, signed in or with an agent key; Claude Code through the same server with an agent key; or any agent you build that can send an HTTPS request and act on the replies, starting at the base URL. The key's name is yours to choose, so the audit trail says which agent did what.
Is there a sandbox?
A sandbox business, made for testing, has a clock that moves forward on demand, so an agent can take a sale through delivery, a warranty claim and a month-end in an afternoon. Two public demos, made-up businesses shared by their visitors and made fresh each night, need no sign-up: a hot tub dealer at https://demo.retavon.com/try?demo=blue_lake and a bike shop at https://demo.retavon.com/try?demo=larkspur. Their texts and email reach no one.