Webhook Subscriptions
Create webhook subscription
Creates a webhook subscription for the authenticated project. Only one subscription is allowed per project. The signing secret is returned in subscription responses.
POST
/
api
/
v3
/
webhook_subscriptions
Create webhook subscription
import requests
url = "https://backend.composio.dev/api/v3/webhook_subscriptions"
payload = {
"webhook_url": "<string>",
"enabled_events": ["<string>"],
"version": "V3"
}
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({webhook_url: '<string>', enabled_events: ['<string>'], version: 'V3'})
};
fetch('https://backend.composio.dev/api/v3/webhook_subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://backend.composio.dev/api/v3/webhook_subscriptions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"webhook_url": "<string>",
"enabled_events": [
"<string>"
],
"version": "V3"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3/webhook_subscriptions"
payload := strings.NewReader("{\n \"webhook_url\": \"<string>\",\n \"enabled_events\": [\n \"<string>\"\n ],\n \"version\": \"V3\"\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://backend.composio.dev/api/v3/webhook_subscriptions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"<string>\",\n \"enabled_events\": [\n \"<string>\"\n ],\n \"version\": \"V3\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3/webhook_subscriptions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"webhook_url\": \"<string>\",\n \"enabled_events\": [\n \"<string>\"\n ],\n \"version\": \"V3\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"id": "<string>",
"webhook_url": "<string>",
"version": "V1",
"enabled_events": [
"<string>"
],
"secret": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}Authorizations
Body
application/json
Response
Webhook subscription created
Create webhook subscription
import requests
url = "https://backend.composio.dev/api/v3/webhook_subscriptions"
payload = {
"webhook_url": "<string>",
"enabled_events": ["<string>"],
"version": "V3"
}
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({webhook_url: '<string>', enabled_events: ['<string>'], version: 'V3'})
};
fetch('https://backend.composio.dev/api/v3/webhook_subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://backend.composio.dev/api/v3/webhook_subscriptions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"webhook_url": "<string>",
"enabled_events": [
"<string>"
],
"version": "V3"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://backend.composio.dev/api/v3/webhook_subscriptions"
payload := strings.NewReader("{\n \"webhook_url\": \"<string>\",\n \"enabled_events\": [\n \"<string>\"\n ],\n \"version\": \"V3\"\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://backend.composio.dev/api/v3/webhook_subscriptions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"<string>\",\n \"enabled_events\": [\n \"<string>\"\n ],\n \"version\": \"V3\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://backend.composio.dev/api/v3/webhook_subscriptions");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"webhook_url\": \"<string>\",\n \"enabled_events\": [\n \"<string>\"\n ],\n \"version\": \"V3\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
false{
"id": "<string>",
"webhook_url": "<string>",
"version": "V1",
"enabled_events": [
"<string>"
],
"secret": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}{
"error": {
"message": "<string>",
"code": 123,
"slug": "<string>",
"status": 123,
"request_id": "<string>",
"suggested_fix": "<string>",
"errors": [
"<string>"
]
}
}