Skip to main content
POST
Authorize a replacement account
Requires tool-connections:manage. This route currently exposes explicit replacement mode.
Open the returned one-time human handoff (handoff_url, on the Yappr dashboard at https://app.goyappr.com). The current account remains fixed while consent is pending. After verification, the replacement creates a new binding revision and authorization epoch. Work already pinned to the old account is not moved by this request itself: a tool that was built on the old account stops working until it is rebuilt on the new one (see Replacing the key of an app that is connected with a key for how that happens). Same-account reauthorization is not exposed by this route yet. An unavailable configuration, expired attempt or competing authorization fails visibly; no newest-account lookup or native fallback is performed.

Replacing the key of an app that is connected with a key

Some apps are connected with a key or token a person types, not with a sign-in page (Mapbox, Pipedrive; connection options shows connect.kind: "credentials" for them). This same request is how you replace such a key, and it keeps everything built on the connection:
  1. Send the reconnect exactly as above, with mode and optionally locale only. The answer is the same handoff_url. Sending credentials here is 400 CONNECTION_INVALID.
  2. Give the link to a signed-in member of the workspace. For a key app the page asks for the new key (the fields the app takes) and shows how many agents use the account. A key never travels over the API, the builder chat or the link itself: a person types it on that page, in their own browser.
  3. The connection stays the same record: its id, label and the agents and tools bound to it are kept. binding_revision and authorization_epoch each go up by one, because the account behind it is now a new one.
Typing a new key replaces the old one at once, and Yappr cannot put the old one back. From that moment every agent that uses the connection uses the new key, and the old one is no longer used. If the new key is wrong, the connection stays broken until a person enters a working key again (the old one, if it still works). For the few apps Yappr can test on the spot (below) a wrong key is refused before anything changes; for the others it cannot be told apart from a good one until it is used. What happens to work built on the old key:
  • A tool built on the old account stops working at its next call until it is rebuilt on the new one. Yappr starts rebuilding the moment the key is replaced: the tools it made from the account’s action list and the tools someone built by hand on it, all of them, and an agent that uses several of them switches to the new key in one step, not one tool at a time. That usually takes under a minute; many tools, or many agents sharing them, take longer. A rebuild that fails is tried again by a check that runs every five minutes, waiting longer after each failure. Calls to an affected agent can fail in that short window, and a call that is already in progress keeps failing its app tools until it ends, so tell whoever relies on it. An agent that pins a tool to one exact revision keeps that revision: it does not follow the account, and its calls stay refused until you point it at the current revision.
  • The old provider account is not deleted: nothing in Yappr can revoke a key in the app for you. Revoke the old key in the app once the new one works.
How the new key is checked before the page says it worked:
  • The page checks the key has the fields the app takes. For the apps Yappr has checked against a live call (Mapbox today) it then asks the app itself whether it accepts the key: when the app says the token is malformed, invalid, expired or revoked, the person is told which, nothing is recorded, the account made for it is deleted, and the connection keeps its old key. They start again from a new POST /tool-connections/{id}/reconnect.
  • An app that proves nothing either way (every app that is not one of those, or an answer that settles nothing) is not treated as bad. The page then reads the account’s actions (GET /tool-connections/{id}/actions) and runs the same check as POST /tool-connections/{id}/check, and tells the person in plain words when either fails. For most apps the check has nothing to ask, so the page says the key is saved but could not be tested, and that it is used the first time a call runs.
Only the Yappr page can use the link of a key app; there is no sign-in page to open for it.

A sign-in that is already open

A connection holds one open sign-in at a time, and GET /tool-connections/{id} shows it as open_attempt.
  • Nobody has opened it yet (status: "pending_human" — a link was handed out and not used): this request cancels it and answers 201 with the new link. The old link stops working.
  • A person is in the middle of it (claimed, creating_link, awaiting_consent, verifying or reconciliation_required): 409 CONNECTION_ATTEMPT_OPEN, and nothing is replaced. The body names the sign-in:
Let it finish, or cancel it with POST /tool-connections/attempts/{id}/cancel and send the reconnect again. Do not retry it as an outage: it answers the same until that sign-in ends (at most ten minutes).

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required

Body

application/json
mode
string
required
Allowed value: "replace"
locale
enum<string>
default:en
Available options:
en,
he

Response

A one-time replacement handoff; current identity stays fixed until verification commits. For an app connected with a key, the link opens the page that asks for the new key.

connection
object
required
attempt
object
required
handoff_url
string<uri>
required

Expiring one-time Yappr handoff for an authorized human, on the Yappr dashboard (https://app.goyappr.com//tool-connection/#). Treat its fragment as a secret capability; never log it.