End an app connection
curl --request POST \
--url https://api.bachs.io/v1/connect/oauth/revoke \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2gconst options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({token: '9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2g'})
};
fetch('https://api.bachs.io/v1/connect/oauth/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/connect/oauth/revoke"
payload = { "token": "9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2g" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/connect/oauth/revoke"
payload := strings.NewReader("token=9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2g")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "invalid_request",
"error_description": "Send the token to revoke."
}{
"error": "invalid_client",
"error_description": "The client could not be authenticated."
}{
"detail": "Rate limit exceeded. Please retry after a few seconds.",
"error_code": "TOO_MANY_REQUESTS"
}Bachs Apps
End an app connection
Ends the connection a refresh or access token belongs to. Your app’s webhook receives app.deauthorized with reason app first. Answers 200 even when the token is unknown, already revoked, or belongs to another app. See When a connection ends.
POST
/
v1
/
connect
/
oauth
/
revoke
End an app connection
curl --request POST \
--url https://api.bachs.io/v1/connect/oauth/revoke \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2gconst options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({token: '9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2g'})
};
fetch('https://api.bachs.io/v1/connect/oauth/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/connect/oauth/revoke"
payload = { "token": "9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2g" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/connect/oauth/revoke"
payload := strings.NewReader("token=9w42ebfsXyghxLDgN0ZM0h6tYYyjrW0nXUTvVLnup2g")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "invalid_request",
"error_description": "Send the token to revoke."
}{
"error": "invalid_client",
"error_description": "The client could not be authenticated."
}{
"detail": "Rate limit exceeded. Please retry after a few seconds.",
"error_code": "TOO_MANY_REQUESTS"
}Authorizations
Your app's client_id as the username and its client secret (appsk_live_... or appsk_test_...) as the password. You can send client_secret in the body instead. See Connect a business.
Body
application/x-www-form-urlencodedapplication/json
Response
Done. The body is empty.

