connect
Subscribe to trigger
Subscribe to (or refresh) a trigger. Supplying the same (params, delivery.url) refreshes the TTL and may rotate the secret.
POST
/
connect
/
{namespace}
/
{connectionId}
/
.triggers
/
{triggerName}
Subscribe to trigger
curl --request POST \
--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",
"secret": "whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE="
}
}
'import requests
url = "https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}"
payload = {
"params": {},
"delivery": {
"url": "https://my-app.example.com/events",
"secret": "whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE="
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
params: {},
delivery: {
url: 'https://my-app.example.com/events',
secret: 'whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE='
}
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'params' => [
],
'delivery' => [
'url' => 'https://my-app.example.com/events',
'secret' => 'whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE='
]
]),
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 \"secret\": \"whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE=\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("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 \"secret\": \"whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE=\"\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::Post.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 \"secret\": \"whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE=\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "trg_01HW1234567890",
"refreshBefore": "2026-04-22T13:00:00.000Z"
}{
"error": "<string>",
"message": "Invalid request"
}{
"error": "not_found",
"message": "Resource not found"
}Authorizations
Smithery API key as Bearer token
Body
application/json
Response
Subscription created or refreshed
Stable subscription id derived from (namespace, connection, name, params, delivery.url). Used by the receiver to route via X-MCP-Subscription-Id.
Example:
"trg_01HW1234567890"
ISO 8601 timestamp at which the subscription expires unless refreshed.
Example:
"2026-04-22T13:00:00.000Z"
Was this page helpful?
Previous
Unsubscribe from triggerUnsubscribe by subscription key (params + delivery.url). Eager teardown — subscriptions also expire naturally on TTL.
Next
⌘I
Subscribe to trigger
curl --request POST \
--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",
"secret": "whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE="
}
}
'import requests
url = "https://api.smithery.ai/connect/{namespace}/{connectionId}/.triggers/{triggerName}"
payload = {
"params": {},
"delivery": {
"url": "https://my-app.example.com/events",
"secret": "whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE="
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
params: {},
delivery: {
url: 'https://my-app.example.com/events',
secret: 'whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE='
}
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'params' => [
],
'delivery' => [
'url' => 'https://my-app.example.com/events',
'secret' => 'whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE='
]
]),
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 \"secret\": \"whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE=\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("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 \"secret\": \"whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE=\"\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::Post.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 \"secret\": \"whsec_dGVzdF9zZWNyZXRfMjRfYnl0ZXNfbWluaW11bSE=\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "trg_01HW1234567890",
"refreshBefore": "2026-04-22T13:00:00.000Z"
}{
"error": "<string>",
"message": "Invalid request"
}{
"error": "not_found",
"message": "Resource not found"
}