curl --request POST \
--url https://api.goyappr.com/tool-connections/{id}/reconnect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "replace",
"locale": "en"
}
'import requests
url = "https://api.goyappr.com/tool-connections/{id}/reconnect"
payload = {
"mode": "replace",
"locale": "en"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: 'replace', locale: 'en'})
};
fetch('https://api.goyappr.com/tool-connections/{id}/reconnect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/tool-connections/{id}/reconnect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'replace',
'locale' => 'en'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/tool-connections/{id}/reconnect"
payload := strings.NewReader("{\n \"mode\": \"replace\",\n \"locale\": \"en\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goyappr.com/tool-connections/{id}/reconnect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"replace\",\n \"locale\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tool-connections/{id}/reconnect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"replace\",\n \"locale\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolkit": "<string>",
"label": "<string>",
"state": "disconnected",
"connected": true,
"enabled": true,
"binding_revision": "<string>",
"authorization_epoch": "<string>",
"disconnect_progress": "none",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"provider_identity": "<string>",
"removed_at": "2023-11-07T05:31:56Z",
"created_by": {
"type": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"started_by": {
"type": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"app_name": "<string>",
"open_attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending_human",
"expires_at": "2023-11-07T05:31:56Z"
},
"last_attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending_human",
"error_code": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"check": {
"status": "app_reports_problem",
"code": "nothing_set_up",
"reading": "Connected, but WhatsApp says no phone numbers are set up.",
"reason": "(#100) Tried accessing nonexisting field (phone_numbers)",
"action": "WHATSAPP_GET_PHONE_NUMBERS",
"checked_at": "2026-11-02T11:20:41.000Z"
}
},
"attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending_human",
"expires_at": "2023-11-07T05:31:56Z",
"next_poll_at": "2023-11-07T05:31:56Z",
"error_code": "<string>",
"return_path": "/en/tools"
},
"handoff_url": "<string>"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "CONNECTION_ATTEMPT_OPEN",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Connect a replacement account
Requires tool-connections:manage. Explicit replacement mode creates a new human consent attempt. It never changes an already pinned run to a different provider account. Same-account reauthorization is not yet exposed by this route. A connection holds one open sign-in at a time: one nobody has opened yet (status pending_human, its link handed out but unused) is cancelled and replaced by this request; one a person is in the middle of answers 409 CONNECTION_ATTEMPT_OPEN, naming it under attempt. GET /tool-connections/ shows the open one as open_attempt. For an app that is connected with a key rather than a sign-in (GET /tool-apps/connection-options shows connect.kind credentials), this is how its key is replaced in place: the handoff_url opens a Yappr page that asks a signed-in person for the new key (a key never travels over the API), and typing it re-points this same connection at a new provider account. The connection keeps its id, label and bindings; binding_revision and authorization_epoch each go up by one, so tools built on the old account stop working until they are rebuilt. Yappr starts rebuilding them the moment the key is replaced, all of the account’s tools together, so an agent that uses several of them switches in one step (usually under a minute, longer when many tools, or many agents sharing them, are involved; a rebuild that fails is tried again by a check every five minutes, waiting longer after each failure; calls in that window can fail, and a call already in progress keeps failing its app tools until it ends). An agent that pins a tool to one exact revision does not follow the account and stays refused until it is pointed at the current revision. The new key takes effect at once for every agent that uses the connection and Yappr cannot put the old one back; entering the old key again is the only undo. The old provider account is not deleted: revoke the old key in the app. For the apps Yappr has checked against a live call (Mapbox today) a key the app itself refuses is rejected on that page and nothing changes; for other apps a wrong key cannot be told apart from a good one until it is used. Sending credentials in this request is 400 CONNECTION_INVALID.
curl --request POST \
--url https://api.goyappr.com/tool-connections/{id}/reconnect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mode": "replace",
"locale": "en"
}
'import requests
url = "https://api.goyappr.com/tool-connections/{id}/reconnect"
payload = {
"mode": "replace",
"locale": "en"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mode: 'replace', locale: 'en'})
};
fetch('https://api.goyappr.com/tool-connections/{id}/reconnect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/tool-connections/{id}/reconnect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => 'replace',
'locale' => 'en'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/tool-connections/{id}/reconnect"
payload := strings.NewReader("{\n \"mode\": \"replace\",\n \"locale\": \"en\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goyappr.com/tool-connections/{id}/reconnect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"replace\",\n \"locale\": \"en\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tool-connections/{id}/reconnect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"replace\",\n \"locale\": \"en\"\n}"
response = http.request(request)
puts response.read_body{
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolkit": "<string>",
"label": "<string>",
"state": "disconnected",
"connected": true,
"enabled": true,
"binding_revision": "<string>",
"authorization_epoch": "<string>",
"disconnect_progress": "none",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"provider_identity": "<string>",
"removed_at": "2023-11-07T05:31:56Z",
"created_by": {
"type": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"started_by": {
"type": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"app_name": "<string>",
"open_attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending_human",
"expires_at": "2023-11-07T05:31:56Z"
},
"last_attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending_human",
"error_code": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"check": {
"status": "app_reports_problem",
"code": "nothing_set_up",
"reading": "Connected, but WhatsApp says no phone numbers are set up.",
"reason": "(#100) Tried accessing nonexisting field (phone_numbers)",
"action": "WHATSAPP_GET_PHONE_NUMBERS",
"checked_at": "2026-11-02T11:20:41.000Z"
}
},
"attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending_human",
"expires_at": "2023-11-07T05:31:56Z",
"next_poll_at": "2023-11-07T05:31:56Z",
"error_code": "<string>",
"return_path": "/en/tools"
},
"handoff_url": "<string>"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "CONNECTION_ATTEMPT_OPEN",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"attempt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}tool-connections:manage. This route currently exposes explicit replacement mode.
curl -X POST https://api.goyappr.com/tool-connections/CONNECTION_ID/reconnect \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"replace","locale":"en"}'
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 showsconnect.kind: "credentials" for them). This same request is how you replace such a key, and it keeps everything built on the connection:
- Send the reconnect exactly as above, with
modeand optionallylocaleonly. The answer is the samehandoff_url. Sendingcredentialshere is400CONNECTION_INVALID. - 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.
- The connection stays the same record: its
id,labeland the agents and tools bound to it are kept.binding_revisionandauthorization_epocheach go up by one, because the account behind it is now a new one.
- 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.
- 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 asPOST /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.
A sign-in that is already open
A connection holds one open sign-in at a time, andGET /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 answers201with the new link. The old link stops working. - A person is in the middle of it (
claimed,creating_link,awaiting_consent,verifyingorreconciliation_required):409 CONNECTION_ATTEMPT_OPEN, and nothing is replaced. The body names the sign-in:
{
"error": "A person is signing in to this account right now (attempt 7c1e…, awaiting_consent, open until 2026-09-25T13:47:39Z), so a replacement would take it away from them. Let it finish, or call it off with POST /tool-connections/attempts/7c1e…/cancel, then reconnect again. A sign-in nobody has opened yet is replaced without asking.",
"code": "CONNECTION_ATTEMPT_OPEN",
"attempt": { "id": "7c1e…", "status": "awaiting_consent", "expires_at": "2026-09-25T13:47:39Z" }
}
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
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).
Body
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.
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.