curl --request POST \
--url https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"expectedName": "<string>",
"detachFromPlugins": true
}
'import requests
url = "https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request"
payload = {
"expectedName": "<string>",
"detachFromPlugins": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedName: '<string>', detachFromPlugins: true})
};
fetch('https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request', 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.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request",
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([
'expectedName' => '<string>',
'detachFromPlugins' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request"
payload := strings.NewReader("{\n \"expectedName\": \"<string>\",\n \"detachFromPlugins\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expectedName\": \"<string>\",\n \"detachFromPlugins\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedName\": \"<string>\",\n \"detachFromPlugins\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "confirmation_required",
"connection": {
"id": "<string>",
"name": "<string>",
"url": "<string>"
},
"requiredBy": [
{
"pluginId": "<string>",
"name": "<string>"
}
],
"handoff": {
"action": "open_link",
"url": "<string>",
"instructions": "<string>"
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "connection_not_found",
"message": "<string>"
}{
"error": "connection_name_mismatch",
"message": "<string>",
"connection": {
"id": "<string>",
"name": "<string>"
},
"requiredBy": [
{
"pluginId": "<string>",
"name": "<string>"
}
]
}Prepare removing an organization connection
Prepares removing one organization connection (connector) from OpenWork and returns a link where the person confirms it. Nothing is removed by this call: the connection, who can use it, its stored accounts and OAuth app are deleted only when the person opens the link and confirms in OpenWork. It never deletes anything in the connected service. Only when the user explicitly asks to remove a connection: first list connections with getMcpConnections and pick the one whose name matches; if several could match, ask the user which one and do not guess. Send its exact name as expectedName. A connection that plugins need is refused unless detachFromPlugins is true, which you may send only after telling the user which plugins use it and they agree. Needs the Remove any connection permission, or having added the connection. Give the person handoff.url and handoff.instructions; afterwards, list connections with getMcpConnections to confirm it is gone.
curl --request POST \
--url https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"expectedName": "<string>",
"detachFromPlugins": true
}
'import requests
url = "https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request"
payload = {
"expectedName": "<string>",
"detachFromPlugins": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedName: '<string>', detachFromPlugins: true})
};
fetch('https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request', 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.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request",
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([
'expectedName' => '<string>',
'detachFromPlugins' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request"
payload := strings.NewReader("{\n \"expectedName\": \"<string>\",\n \"detachFromPlugins\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expectedName\": \"<string>\",\n \"detachFromPlugins\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/mcp-connections/{connectionId}/removal-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expectedName\": \"<string>\",\n \"detachFromPlugins\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "confirmation_required",
"connection": {
"id": "<string>",
"name": "<string>",
"url": "<string>"
},
"requiredBy": [
{
"pluginId": "<string>",
"name": "<string>"
}
],
"handoff": {
"action": "open_link",
"url": "<string>",
"instructions": "<string>"
}
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "unauthorized"
}{
"error": "forbidden",
"reason": "<string>",
"message": "<string>"
}{
"error": "connection_not_found",
"message": "<string>"
}{
"error": "connection_name_mismatch",
"message": "<string>",
"connection": {
"id": "<string>",
"name": "<string>"
},
"requiredBy": [
{
"pluginId": "<string>",
"name": "<string>"
}
]
}Authorizations
Organization API key passed as the x-api-key header. The raw key is the header value; do not prefix it with Bearer.
Path Parameters
Den TypeID with 'emc_' prefix and a 26-character base32 suffix.
30Body
The connection's exact name, as getMcpConnections lists it. Nothing is prepared when it does not match.
1 - 255The user agreed it may be removed from plugins that need it. Send true only after telling the user which plugins use it.
Was this page helpful?