Delete connection
curl --request DELETE \
--url https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection \
--header 'Authorization: Bearer <token>'import requests
url = "https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection', 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://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection"
req, _ := http.NewRequest("DELETE", 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.delete("https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}Connections
Delete connection
Delete the current user’s connection to this server.
This will remove the connection record and clean up any stored OAuth credentials. The user will need to reconnect to use this server again.
DELETE
/
api
/
servers
/
{server_id}
/
connection
Delete connection
curl --request DELETE \
--url https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection \
--header 'Authorization: Bearer <token>'import requests
url = "https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection', 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://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection"
req, _ := http.NewRequest("DELETE", 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.delete("https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization_id}.platform.barndoor.ai/api/servers/{server_id}/connection")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}{
"error": "ServerNotFound",
"message": "Server with ID '123' not found",
"details": {}
}Authorizations
JWT token obtained through Barndoor's OAuth 2.0 authorization-code flow with PKCE.
The token should be included in the Authorization header:
Authorization: Bearer <your-jwt-token>
Use the Barndoor SDK's loginInteractive() function to obtain tokens automatically.
Path Parameters
Server UUID
Response
Connection deleted successfully
⌘I