Update webhook
curl --request PUT \
--url https://api.emailr.dev/v1/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Webhook Name",
"url": "https://api.example.com/webhooks",
"inbox_ids": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
'import requests
url = "https://api.emailr.dev/v1/webhooks/{id}"
payload = {
"name": "Updated Webhook Name",
"url": "https://api.example.com/webhooks",
"inbox_ids": ["123e4567-e89b-12d3-a456-426614174000"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated Webhook Name',
url: 'https://api.example.com/webhooks',
inbox_ids: ['123e4567-e89b-12d3-a456-426614174000']
})
};
fetch('https://api.emailr.dev/v1/webhooks/{id}', 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/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Webhook Name',
'url' => 'https://api.example.com/webhooks',
'inbox_ids' => [
'123e4567-e89b-12d3-a456-426614174000'
]
]),
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/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated Webhook Name\",\n \"url\": \"https://api.example.com/webhooks\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.emailr.dev/v1/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Webhook Name\",\n \"url\": \"https://api.example.com/webhooks\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Webhook Name\",\n \"url\": \"https://api.example.com/webhooks\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"type": "transactional",
"events": [
"<string>"
],
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"secret": "<string>",
"active": true,
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}webhooks
Update webhook
Update a webhook’s name, URL, or inbox scope
PUT
/
v1
/
webhooks
/
{id}
Update webhook
curl --request PUT \
--url https://api.emailr.dev/v1/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Webhook Name",
"url": "https://api.example.com/webhooks",
"inbox_ids": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
'import requests
url = "https://api.emailr.dev/v1/webhooks/{id}"
payload = {
"name": "Updated Webhook Name",
"url": "https://api.example.com/webhooks",
"inbox_ids": ["123e4567-e89b-12d3-a456-426614174000"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated Webhook Name',
url: 'https://api.example.com/webhooks',
inbox_ids: ['123e4567-e89b-12d3-a456-426614174000']
})
};
fetch('https://api.emailr.dev/v1/webhooks/{id}', 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/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Webhook Name',
'url' => 'https://api.example.com/webhooks',
'inbox_ids' => [
'123e4567-e89b-12d3-a456-426614174000'
]
]),
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/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated Webhook Name\",\n \"url\": \"https://api.example.com/webhooks\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.emailr.dev/v1/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Webhook Name\",\n \"url\": \"https://api.example.com/webhooks\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emailr.dev/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Webhook Name\",\n \"url\": \"https://api.example.com/webhooks\",\n \"inbox_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"url": "<string>",
"type": "transactional",
"events": [
"<string>"
],
"inbox_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"secret": "<string>",
"active": true,
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}{
"error": "An error occurred",
"code": "VALIDATION_ERROR",
"details": "<unknown>"
}Authorizations
API key authentication. Use your API key as the bearer token.
Path Parameters
Example:
"123e4567-e89b-12d3-a456-426614174000"
Body
application/json
Minimum string length:
1Example:
"Updated Webhook Name"
Example:
"https://api.example.com/webhooks"
Optional array of inbox UUIDs to scope receiving webhooks. Only applicable when type is 'receiving'. Set to null to receive from all inboxes.
Example:
["123e4567-e89b-12d3-a456-426614174000"]
Response
Webhook updated
Example:
"123e4567-e89b-12d3-a456-426614174000"
Webhook category type that determines which events the webhook subscribes to
Available options:
transactional, domain, receiving Example:
"transactional"
Derived list of events based on the webhook type. Read-only.
Inbox UUIDs for scoping receiving webhooks. Null for non-receiving types.
⌘I