Create multiple subscription filters
curl --request POST \
--url https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"event_type": "<string>",
"body": {},
"enabled_at": {
"set": true,
"time": "<string>"
},
"headers": {},
"path": {},
"query": {}
}
]
'import requests
url = "https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk"
payload = [
{
"event_type": "<string>",
"body": {},
"enabled_at": {
"set": True,
"time": "<string>"
},
"headers": {},
"path": {},
"query": {}
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
event_type: '<string>',
body: JSON.stringify({}),
enabled_at: {set: true, time: '<string>'},
headers: {},
path: {},
query: {}
}
])
};
fetch('https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk', 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://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk",
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([
[
'event_type' => '<string>',
'body' => [
],
'enabled_at' => [
'set' => true,
'time' => '<string>'
],
'headers' => [
],
'path' => [
],
'query' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk"
payload := strings.NewReader("[\n {\n \"event_type\": \"<string>\",\n \"body\": {},\n \"enabled_at\": {\n \"set\": true,\n \"time\": \"<string>\"\n },\n \"headers\": {},\n \"path\": {},\n \"query\": {}\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"event_type\": \"<string>\",\n \"body\": {},\n \"enabled_at\": {\n \"set\": true,\n \"time\": \"<string>\"\n },\n \"headers\": {},\n \"path\": {},\n \"query\": {}\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"event_type\": \"<string>\",\n \"body\": {},\n \"enabled_at\": {\n \"set\": true,\n \"time\": \"<string>\"\n },\n \"headers\": {},\n \"path\": {},\n \"query\": {}\n }\n]"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"status": true,
"data": [
{
"body": {},
"enabled_at": "<string>",
"event_type": "<string>",
"headers": {},
"path": {},
"query": {},
"raw_body": {},
"raw_headers": {},
"raw_path": {},
"raw_query": {},
"subscription_id": "<string>",
"uid": "<string>"
}
]
}{
"message": "<string>",
"status": true,
"data": {}
}{
"message": "<string>",
"status": true,
"data": {}
}{
"message": "<string>",
"status": true,
"data": {}
}Subscription Filters
Create multiple subscription filters
This endpoint creates multiple filters for a subscription
POST
/
v1
/
projects
/
{projectID}
/
subscriptions
/
{subscriptionID}
/
filters
/
bulk
Create multiple subscription filters
curl --request POST \
--url https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"event_type": "<string>",
"body": {},
"enabled_at": {
"set": true,
"time": "<string>"
},
"headers": {},
"path": {},
"query": {}
}
]
'import requests
url = "https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk"
payload = [
{
"event_type": "<string>",
"body": {},
"enabled_at": {
"set": True,
"time": "<string>"
},
"headers": {},
"path": {},
"query": {}
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
event_type: '<string>',
body: JSON.stringify({}),
enabled_at: {set: true, time: '<string>'},
headers: {},
path: {},
query: {}
}
])
};
fetch('https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk', 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://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk",
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([
[
'event_type' => '<string>',
'body' => [
],
'enabled_at' => [
'set' => true,
'time' => '<string>'
],
'headers' => [
],
'path' => [
],
'query' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk"
payload := strings.NewReader("[\n {\n \"event_type\": \"<string>\",\n \"body\": {},\n \"enabled_at\": {\n \"set\": true,\n \"time\": \"<string>\"\n },\n \"headers\": {},\n \"path\": {},\n \"query\": {}\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"event_type\": \"<string>\",\n \"body\": {},\n \"enabled_at\": {\n \"set\": true,\n \"time\": \"<string>\"\n },\n \"headers\": {},\n \"path\": {},\n \"query\": {}\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.getconvoy.cloud/api/v1/projects/{projectID}/subscriptions/{subscriptionID}/filters/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"event_type\": \"<string>\",\n \"body\": {},\n \"enabled_at\": {\n \"set\": true,\n \"time\": \"<string>\"\n },\n \"headers\": {},\n \"path\": {},\n \"query\": {}\n }\n]"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"status": true,
"data": [
{
"body": {},
"enabled_at": "<string>",
"event_type": "<string>",
"headers": {},
"path": {},
"query": {},
"raw_body": {},
"raw_headers": {},
"raw_path": {},
"raw_query": {},
"subscription_id": "<string>",
"uid": "<string>"
}
]
}{
"message": "<string>",
"status": true,
"data": {}
}{
"message": "<string>",
"status": true,
"data": {}
}{
"message": "<string>",
"status": true,
"data": {}
}Authorizations
Body
application/json
Filters to create
Type of event this filter applies to (required)
Body matching criteria (optional)
Non-null when this filter is active. Defaults to now when omitted.
Show child attributes
Show child attributes
Header matching criteria (optional)
Path matching criteria (optional)
Query matching criteria (optional)
Was this page helpful?
⌘I