curl --request POST \
--url https://api.goyappr.com/tool-connections/cleanup \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/tool-connections/cleanup"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/tool-connections/cleanup', 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/cleanup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/tool-connections/cleanup"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/cleanup")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tool-connections/cleanup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"removed": 168
}{
"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>"
}
]
}Clear the attempts nobody finished
Requires tool-connections:manage. Every connection in this workspace that never finished connecting - it never had an account (connected is false) and is connecting or disconnected - and has no authorization open right now leaves GET /tool-connections, in one request. Each one is closed the way DELETE closes a connection that never had an account, and taken off the list the way POST /tool-connections//remove takes one off; nothing is deleted, and state=removed still reads them back. A connection that was ever connected is never touched, whatever its state. The same clean-up runs by itself every hour for attempts more than a day old. Takes no input: send no body or an empty object , and no query parameters; it always covers the whole workspace. Repeating it answers removed 0.
curl --request POST \
--url https://api.goyappr.com/tool-connections/cleanup \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/tool-connections/cleanup"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/tool-connections/cleanup', 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/cleanup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/tool-connections/cleanup"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/cleanup")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tool-connections/cleanup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"removed": 168
}{
"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>"
}
]
}tool-connections:manage. Every press of Connect makes a connection at once, and a sign-in nobody finishes leaves it there: the authorization expires after ten minutes, the connection does not. One request clears all of them.
curl -X POST https://api.goyappr.com/tool-connections/cleanup \
-H "Authorization: Bearer YOUR_API_KEY"
{ "removed": 168 }
What it clears, and what it never touches
| Cleared | Never touched |
|---|---|
A connection that never had an account (connected: false), in state connecting or disconnected, with no authorization open right now. | A connection that was ever connected (connected: true) - ready, expired, degraded or disconnected. An expired grant is a reconnect, not litter. |
| A connection whose sign-in is still open - somebody may be on the app’s consent screen. It is cleared once that authorization finishes, is cancelled or expires. |
DELETE /tool-connections/{id} closes one that never had an account (disconnect_progress: "record_deleted": there is no grant anywhere to revoke), and taken off the list the way POST /tool-connections/{id}/remove takes one off. Nothing is deleted: GET /tool-connections?state=removed still reads them back, and a reconnect that completes brings one back to the list.
It is the whole workspace, always
The clean-up cannot be narrowed to the connections one key or one person started: it takes no filter, and a key’s clean-up clears every unfinished connection in the workspace, a colleague’s included. To clear only your own, list them withGET /tool-connections (each row’s created_by and started_by say who started it and who started what it is waiting for now), then send DELETE /tool-connections/{id} and POST /tool-connections/{id}/remove for each of yours.
It also runs by itself
The same clean-up runs every hour for attempts that started more than a day ago, so a workspace nobody tidies still stops accumulating them. This request is for clearing them now, whatever their age.Errors
| HTTP | Code | When |
|---|---|---|
| 400 | CONNECTION_INVALID | The body held anything but nothing or an empty object {} (ids, an age, any field, or text that is not JSON), or a query parameter was sent. Nothing was cleared. This request takes no input: which connections are abandoned is decided by the rules above, never by the request, and it always covers the whole workspace. |
| 403 | INSUFFICIENT_SCOPE | The key lacks tool-connections:manage. |
| 503 | CONNECTION_UNAVAILABLE | Connection control is unavailable. Nothing was changed; send it again. |
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).