Guides
Access
A public question, such as a product search or store hours, needs no token. A question about a person's account needs that person to log in.
sequenceDiagram
participant P as Person
participant V as Visiting agent
participant L as Company OAuth
participant O as Company agent
P->>V: Where's my order?
V->>O: POST /cap/v1/messages
O-->>V: failed, login_required
V->>L: Start a login with its CAP-From
L-->>V: A short code and a link
V-->>P: Open this link. The code is WDJB-MJHT
P->>L: Log in and allow, on the store's page
V->>L: Polls with the device code
L-->>V: Token for this account and this agent
V->>O: POST /cap/v1/messages, Authorization: Bearer
Note over O: Looks up the order with its own tools
O-->>V: done, the order status
V-->>P: The order statusThe login is standard OAuth: the device authorization grant (RFC 8628). The visiting agent needs only HTTP. It does not register with the store, open a browser, or receive a callback. It asks the store for a short code, tells the person where to enter it, and polls until the person allows access. The store binds the token to the agent's CAP-From.
The store's page shows the agent's name as not verified, since any agent can claim any name, and shows the code so the person can match it with what their agent said. An agent that wants a verified name hosts a small client document and uses its URL as the client_id. The same document also enables the optional redirect login, OAuth 2.1 with PKCE, for agents that can open a browser.
Two identities travel on an account question. Authorization: Bearer is the person and the account. CAP-From is the visiting agent. The token works only for the agent it was issued to. Another agent with the same token gets 403.
An account name or number in the brief is not access. Only the token decides whose account the company reads.
The person's password goes to the company's login page, never to their agent. The company's keys never leave the company. Revoking the token stops that agent, and nothing else has to rotate.
CAP