Update Webhook Endpoint
curl --request PUT \
--url https://api.baselayer.com/webhooks/{endpoint_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"url": "https://example.com/webhook/",
"channels": [
"project_123",
"group_2"
],
"description": "An example endpoint name",
"disabled": false,
"filter_types": [
"user.signup",
"user.deleted"
],
"metadata": {},
"rate_limit": 2,
"uid": "unique-ep-identifier",
"version": 1
}
'import requests
url = "https://api.baselayer.com/webhooks/{endpoint_id}"
payload = {
"url": "https://example.com/webhook/",
"channels": ["project_123", "group_2"],
"description": "An example endpoint name",
"disabled": False,
"filter_types": ["user.signup", "user.deleted"],
"metadata": {},
"rate_limit": 2,
"uid": "unique-ep-identifier",
"version": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhook/',
channels: ['project_123', 'group_2'],
description: 'An example endpoint name',
disabled: false,
filter_types: ['user.signup', 'user.deleted'],
metadata: {},
rate_limit: 2,
uid: 'unique-ep-identifier',
version: 1
})
};
fetch('https://api.baselayer.com/webhooks/{endpoint_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.baselayer.com/webhooks/{endpoint_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([
'url' => 'https://example.com/webhook/',
'channels' => [
'project_123',
'group_2'
],
'description' => 'An example endpoint name',
'disabled' => false,
'filter_types' => [
'user.signup',
'user.deleted'
],
'metadata' => [
],
'rate_limit' => 2,
'uid' => 'unique-ep-identifier',
'version' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.baselayer.com/webhooks/{endpoint_id}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook/\",\n \"channels\": [\n \"project_123\",\n \"group_2\"\n ],\n \"description\": \"An example endpoint name\",\n \"disabled\": false,\n \"filter_types\": [\n \"user.signup\",\n \"user.deleted\"\n ],\n \"metadata\": {},\n \"rate_limit\": 2,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.baselayer.com/webhooks/{endpoint_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook/\",\n \"channels\": [\n \"project_123\",\n \"group_2\"\n ],\n \"description\": \"An example endpoint name\",\n \"disabled\": false,\n \"filter_types\": [\n \"user.signup\",\n \"user.deleted\"\n ],\n \"metadata\": {},\n \"rate_limit\": 2,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/webhooks/{endpoint_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhook/\",\n \"channels\": [\n \"project_123\",\n \"group_2\"\n ],\n \"description\": \"An example endpoint name\",\n \"disabled\": false,\n \"filter_types\": [\n \"user.signup\",\n \"user.deleted\"\n ],\n \"metadata\": {},\n \"rate_limit\": 2,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"id": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2",
"metadata": {},
"updated_at": "2023-11-07T05:31:56Z",
"url": "https://example.com/webhook/",
"version": 1,
"channels": [
"project_123",
"group_2"
],
"disabled": false,
"filter_types": [
"user.signup",
"user.deleted"
],
"rate_limit": 1,
"uid": "unique-ep-identifier"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Webhook Endpoints
Update Webhook Endpoint
PUT
/
webhooks
/
{endpoint_id}
Update Webhook Endpoint
curl --request PUT \
--url https://api.baselayer.com/webhooks/{endpoint_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"url": "https://example.com/webhook/",
"channels": [
"project_123",
"group_2"
],
"description": "An example endpoint name",
"disabled": false,
"filter_types": [
"user.signup",
"user.deleted"
],
"metadata": {},
"rate_limit": 2,
"uid": "unique-ep-identifier",
"version": 1
}
'import requests
url = "https://api.baselayer.com/webhooks/{endpoint_id}"
payload = {
"url": "https://example.com/webhook/",
"channels": ["project_123", "group_2"],
"description": "An example endpoint name",
"disabled": False,
"filter_types": ["user.signup", "user.deleted"],
"metadata": {},
"rate_limit": 2,
"uid": "unique-ep-identifier",
"version": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhook/',
channels: ['project_123', 'group_2'],
description: 'An example endpoint name',
disabled: false,
filter_types: ['user.signup', 'user.deleted'],
metadata: {},
rate_limit: 2,
uid: 'unique-ep-identifier',
version: 1
})
};
fetch('https://api.baselayer.com/webhooks/{endpoint_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.baselayer.com/webhooks/{endpoint_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([
'url' => 'https://example.com/webhook/',
'channels' => [
'project_123',
'group_2'
],
'description' => 'An example endpoint name',
'disabled' => false,
'filter_types' => [
'user.signup',
'user.deleted'
],
'metadata' => [
],
'rate_limit' => 2,
'uid' => 'unique-ep-identifier',
'version' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.baselayer.com/webhooks/{endpoint_id}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook/\",\n \"channels\": [\n \"project_123\",\n \"group_2\"\n ],\n \"description\": \"An example endpoint name\",\n \"disabled\": false,\n \"filter_types\": [\n \"user.signup\",\n \"user.deleted\"\n ],\n \"metadata\": {},\n \"rate_limit\": 2,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.baselayer.com/webhooks/{endpoint_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook/\",\n \"channels\": [\n \"project_123\",\n \"group_2\"\n ],\n \"description\": \"An example endpoint name\",\n \"disabled\": false,\n \"filter_types\": [\n \"user.signup\",\n \"user.deleted\"\n ],\n \"metadata\": {},\n \"rate_limit\": 2,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/webhooks/{endpoint_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhook/\",\n \"channels\": [\n \"project_123\",\n \"group_2\"\n ],\n \"description\": \"An example endpoint name\",\n \"disabled\": false,\n \"filter_types\": [\n \"user.signup\",\n \"user.deleted\"\n ],\n \"metadata\": {},\n \"rate_limit\": 2,\n \"uid\": \"unique-ep-identifier\",\n \"version\": 1\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"id": "ep_1srOrx2ZWZBpBUvZwXKQmoEYga2",
"metadata": {},
"updated_at": "2023-11-07T05:31:56Z",
"url": "https://example.com/webhook/",
"version": 1,
"channels": [
"project_123",
"group_2"
],
"disabled": false,
"filter_types": [
"user.signup",
"user.deleted"
],
"rate_limit": 1,
"uid": "unique-ep-identifier"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Minimum string length:
1Example:
"https://example.com/webhook/"
List of message channels this endpoint listens to (omit for all)
Required array length:
1 - 10 elementsMaximum string length:
128Pattern:
^[a-zA-Z0-9\-_.]+$Example:
["project_123", "group_2"]
Example:
"An example endpoint name"
Example:
false
Minimum array length:
1The event type's name
Maximum string length:
256Pattern:
^[a-zA-Z0-9\-_.]+$Example:
["user.signup", "user.deleted"]
Show child attributes
Show child attributes
Required range:
x >= 1Optional unique identifier for the endpoint
Required string length:
1 - 256Pattern:
^[a-zA-Z0-9\-_.]+$Example:
"unique-ep-identifier"
Required range:
x >= 1Example:
1
Response
Successful Response
An example endpoint name
The ep's ID
Example:
"ep_1srOrx2ZWZBpBUvZwXKQmoEYga2"
Show child attributes
Show child attributes
Minimum string length:
1Example:
"https://example.com/webhook/"
Required range:
x >= 1Example:
1
List of message channels this endpoint listens to (omit for all)
Required array length:
1 - 10 elementsMaximum string length:
128Pattern:
^[a-zA-Z0-9\-_.]+$Example:
["project_123", "group_2"]
Example:
false
Minimum array length:
1The event type's name
Maximum string length:
256Pattern:
^[a-zA-Z0-9\-_.]+$Example:
["user.signup", "user.deleted"]
Required range:
x >= 0Optional unique identifier for the endpoint
Required string length:
1 - 256Pattern:
^[a-zA-Z0-9\-_.]+$Example:
"unique-ep-identifier"