docs-api-reference-connect-unsubscribe-from-trigger.md
DELETE
/
connect
/
{namespace}
/
{connectionId}
/
.triggers
/
{triggerName}
Try it
Unsubscribe from trigger
cURL
curl --request DELETE \
--url https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"params": {},
"delivery": {
"url": "https://my-app.example.com/events"
}
}
'
import requests
url = "https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}"
payload = {
"params": {},
"delivery": { "url": "https://my-app.example.com/events" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({params: {}, delivery: {url: 'https://my-app.example.com/events'}})
};
fetch('https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}', 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.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'params' => [
],
'delivery' => [
'url' => 'https://my-app.example.com/events'
]
]),
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.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}"
payload := strings.NewReader("{\n \"params\": {},\n \"delivery\": {\n \"url\": \"https://my-app.example.com/events\"\n }\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"params\": {},\n \"delivery\": {\n \"url\": \"https://my-app.example.com/events\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"params\": {},\n \"delivery\": {\n \"url\": \"https://my-app.example.com/events\"\n }\n}"
response = http.request(request)
puts response.read_body
200
404
{
"success": true
}
{
"error": "not_found",
"message": "Resource not found"
}
[
](#authorization-authorization)
Authorization
string
header
required
Smithery API key as Bearer token
[
](#parameter-namespace)
namespace
string
required
[
](#parameter-connection-id)
connectionId
string
required
[
](#parameter-trigger-name)
triggerName
string
required
application/json
[
](#body-params)
params
object
required
The same params used at subscribe time. Forms part of the subscription key.
Show child attributes
[
](#body-delivery)
delivery
object
required
Show child attributes
200
application/json
Subscription removed
[
](#response-success)
success
boolean
required
Was this page helpful?
YesNo
⌘I
Unsubscribe from trigger
cURL
curl --request DELETE \
--url https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"params": {},
"delivery": {
"url": "https://my-app.example.com/events"
}
}
'
import requests
url = "https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}"
payload = {
"params": {},
"delivery": { "url": "https://my-app.example.com/events" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({params: {}, delivery: {url: 'https://my-app.example.com/events'}})
};
fetch('https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}', 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.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'params' => [
],
'delivery' => [
'url' => 'https://my-app.example.com/events'
]
]),
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.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}"
payload := strings.NewReader("{\n \"params\": {},\n \"delivery\": {\n \"url\": \"https://my-app.example.com/events\"\n }\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"params\": {},\n \"delivery\": {\n \"url\": \"https://my-app.example.com/events\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"params\": {},\n \"delivery\": {\n \"url\": \"https://my-app.example.com/events\"\n }\n}"
response = http.request(request)
puts response.read_body
200
404
{
"success": true
}
{
"error": "not_found",
"message": "Resource not found"
}