Subscribe automation webhook
curl --request POST \
--url https://api.emailr.dev/v1/automation-webhooks/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_url": "https://hooks.zapier.com/hooks/catch/123/abc",
"event_type": "email.received",
"provider": "zapier",
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"send_test": true
}
'import requests
url = "https://api.emailr.dev/v1/automation-webhooks/subscribe"
payload = {
"target_url": "https://hooks.zapier.com/hooks/catch/123/abc",
"event_type": "email.received",
"provider": "zapier",
"inbox_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"send_test": True
}
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({
target_url: 'https://hooks.zapier.com/hooks/catch/123/abc',
event_type: 'email.received',
provider: 'zapier',
inbox_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
send_test: true
})
};
fetch('https://api.emailr.dev/v1/automation-webhooks/subscribe', 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.emailr.dev/v1/automation-webhooks/subscribe",
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([
'target_url' => 'https://hooks.zapier.com/hooks/catch/123/abc',
'event_type' => 'email.received',
'provider' => 'zapier',
'inbox_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'send_test' => true
]),
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.emailr.dev/v1/automation-webhooks/subscribe"
payload := strings.NewReader("{\n \"target_url\": \"https://hooks.zapier.com/hooks/catch/123/abc\",\n \"event_type\": \"email.received\",\n \"provider\": \"zapier\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"send_test\": true\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.emailr.dev/v1/automation-webhooks/subscribe")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_url\": \"https://hooks.zapier.com/hooks/catch/123/abc\",\n \"event_type\": \"email.received\",\n \"provider\": \"zapier\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"send_test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/automation-webhooks/subscribe")
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 \"target_url\": \"https://hooks.zapier.com/hooks/catch/123/abc\",\n \"event_type\": \"email.received\",\n \"provider\": \"zapier\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"send_test\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "zapier",
"event_type": "email.received",
"target_url": "<string>",
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"active": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}automation-webhooks
Subscribe automation webhook
Register a webhook URL for a third-party automation (Zapier, n8n)
POST
/
v1
/
automation-webhooks
/
subscribe
Subscribe automation webhook
curl --request POST \
--url https://api.emailr.dev/v1/automation-webhooks/subscribe \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target_url": "https://hooks.zapier.com/hooks/catch/123/abc",
"event_type": "email.received",
"provider": "zapier",
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"send_test": true
}
'import requests
url = "https://api.emailr.dev/v1/automation-webhooks/subscribe"
payload = {
"target_url": "https://hooks.zapier.com/hooks/catch/123/abc",
"event_type": "email.received",
"provider": "zapier",
"inbox_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"send_test": True
}
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({
target_url: 'https://hooks.zapier.com/hooks/catch/123/abc',
event_type: 'email.received',
provider: 'zapier',
inbox_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
send_test: true
})
};
fetch('https://api.emailr.dev/v1/automation-webhooks/subscribe', 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.emailr.dev/v1/automation-webhooks/subscribe",
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([
'target_url' => 'https://hooks.zapier.com/hooks/catch/123/abc',
'event_type' => 'email.received',
'provider' => 'zapier',
'inbox_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'send_test' => true
]),
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.emailr.dev/v1/automation-webhooks/subscribe"
payload := strings.NewReader("{\n \"target_url\": \"https://hooks.zapier.com/hooks/catch/123/abc\",\n \"event_type\": \"email.received\",\n \"provider\": \"zapier\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"send_test\": true\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.emailr.dev/v1/automation-webhooks/subscribe")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target_url\": \"https://hooks.zapier.com/hooks/catch/123/abc\",\n \"event_type\": \"email.received\",\n \"provider\": \"zapier\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"send_test\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/automation-webhooks/subscribe")
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 \"target_url\": \"https://hooks.zapier.com/hooks/catch/123/abc\",\n \"event_type\": \"email.received\",\n \"provider\": \"zapier\",\n \"inbox_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"send_test\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "zapier",
"event_type": "email.received",
"target_url": "<string>",
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"active": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}Authorizations
API key authentication. Use your API key as the bearer token.
Body
application/json
Example:
"https://hooks.zapier.com/hooks/catch/123/abc"
Available options:
email.received Example:
"email.received"
Available options:
zapier, n8n Example:
"zapier"
Optional array of inbox UUIDs to scope the trigger.
Deprecated and ignored on subscribe. Use the dedicated automation-webhooks test endpoint to send a sample event.
Response
Webhook subscribed
Available options:
zapier, n8n Example:
"zapier"
Available options:
email.received Example:
"email.received"
⌘I