Search and List Webhooks
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/webhooks/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"limit": 10,
"page": 1
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/webhooks/search"
payload = {
"limit": 10,
"page": 1
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({limit: 10, page: 1})
};
fetch('https://cloudapi.mailercloud.com/v1/webhooks/search', 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://cloudapi.mailercloud.com/v1/webhooks/search",
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([
'limit' => 10,
'page' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: <content-type>"
],
]);
$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://cloudapi.mailercloud.com/v1/webhooks/search"
payload := strings.NewReader("{\n \"limit\": 10,\n \"page\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"created_date": "2024-02-15 17:06:56",
"event": [
"campaign_sent",
"campaign_opened",
"campaign_clicked",
"campaign_error",
"spam",
"hard_bounce",
"unsubscribe"
],
"id": "f",
"modified_date": "2024-02-16 16:05:52",
"name": "Main webhook",
"status": 1,
"url": "https://www.randomurl1.com"
},
{
"created_date": "2024-02-15 17:05:51",
"event": [
"campaign_sent",
"campaign_opened",
"campaign_clicked",
"campaign_error",
"spam",
"hard_bounce",
"unsubscribe"
],
"id": "E",
"modified_date": "2024-02-16 16:05:18",
"name": "new webhook",
"status": 1,
"url": "https://www.randomurl2.com"
},
{
"created_date": "2024-02-16 13:50:30",
"event": [
"campaign_sent",
"campaign_opened"
],
"id": "KK",
"modified_date": "2024-02-16 15:57:18",
"name": "Test Webhook",
"status": 0,
"url": "https://www.randomurl3.com"
}
],
"max_webhook_limit": 20,
"total": 10,
"webhook_count": 3
}{
"error": [
{
"field": "limit",
"message": "Limit is a required field"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}Search and List Webhooks
API to list all webhooks with the ability to search, filter, and sort the results.
POST
/
webhooks
/
search
Search and List Webhooks
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/webhooks/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"limit": 10,
"page": 1
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/webhooks/search"
payload = {
"limit": 10,
"page": 1
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<api-key>'},
body: JSON.stringify({limit: 10, page: 1})
};
fetch('https://cloudapi.mailercloud.com/v1/webhooks/search', 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://cloudapi.mailercloud.com/v1/webhooks/search",
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([
'limit' => 10,
'page' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: <content-type>"
],
]);
$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://cloudapi.mailercloud.com/v1/webhooks/search"
payload := strings.NewReader("{\n \"limit\": 10,\n \"page\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"created_date": "2024-02-15 17:06:56",
"event": [
"campaign_sent",
"campaign_opened",
"campaign_clicked",
"campaign_error",
"spam",
"hard_bounce",
"unsubscribe"
],
"id": "f",
"modified_date": "2024-02-16 16:05:52",
"name": "Main webhook",
"status": 1,
"url": "https://www.randomurl1.com"
},
{
"created_date": "2024-02-15 17:05:51",
"event": [
"campaign_sent",
"campaign_opened",
"campaign_clicked",
"campaign_error",
"spam",
"hard_bounce",
"unsubscribe"
],
"id": "E",
"modified_date": "2024-02-16 16:05:18",
"name": "new webhook",
"status": 1,
"url": "https://www.randomurl2.com"
},
{
"created_date": "2024-02-16 13:50:30",
"event": [
"campaign_sent",
"campaign_opened"
],
"id": "KK",
"modified_date": "2024-02-16 15:57:18",
"name": "Test Webhook",
"status": 0,
"url": "https://www.randomurl3.com"
}
],
"max_webhook_limit": 20,
"total": 10,
"webhook_count": 3
}{
"error": [
{
"field": "limit",
"message": "Limit is a required field"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Headers
Request body type
Body
application/json
Maximum number of elements to return.
Minimum: 10 Maximum: 100
Required range:
10 <= x <= 100You can retrieve a subset of records starting from the page value you have specified. You can add a limit, which will determine the number of records you can retrieve on a single page.
Starts From: 1
Required range:
x >= 1Filter webhook by searching through webhook name or url.
Sort webhook data based on this field.
Supported sort fields:
- name
- url
- modified_date
Sorting order for sort field.
Supported sort orders:
asc, ASC, desc, DESC
⌘I