curl --request POST \
--url https://devs.adaptyvbio.com/api/v1/webhooks \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/adaptyv/webhook",
"headers": "<unknown>",
"secret": "a-32-plus-character-shared-secret"
}
'import requests
url = "https://devs.adaptyvbio.com/api/v1/webhooks"
payload = {
"url": "https://example.com/adaptyv/webhook",
"headers": "<unknown>",
"secret": "a-32-plus-character-shared-secret"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/adaptyv/webhook',
headers: '<unknown>',
secret: 'a-32-plus-character-shared-secret'
})
};
fetch('https://devs.adaptyvbio.com/api/v1/webhooks', 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://devs.adaptyvbio.com/api/v1/webhooks",
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([
'url' => 'https://example.com/adaptyv/webhook',
'headers' => '<unknown>',
'secret' => 'a-32-plus-character-shared-secret'
]),
CURLOPT_HTTPHEADER => [
"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://devs.adaptyvbio.com/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/adaptyv/webhook\",\n \"headers\": \"<unknown>\",\n \"secret\": \"a-32-plus-character-shared-secret\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://devs.adaptyvbio.com/api/v1/webhooks")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/adaptyv/webhook\",\n \"headers\": \"<unknown>\",\n \"secret\": \"a-32-plus-character-shared-secret\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devs.adaptyvbio.com/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/adaptyv/webhook\",\n \"headers\": \"<unknown>\",\n \"secret\": \"a-32-plus-character-shared-secret\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"headers": "<unknown>",
"id": "019462a4-b1c2-7def-8901-23456789abcd",
"secret_set": true,
"updated_at": "2023-11-07T05:31:56Z",
"url": "https://example.com/adaptyv/webhook"
}{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}Register a webhook for the organization.
curl --request POST \
--url https://devs.adaptyvbio.com/api/v1/webhooks \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/adaptyv/webhook",
"headers": "<unknown>",
"secret": "a-32-plus-character-shared-secret"
}
'import requests
url = "https://devs.adaptyvbio.com/api/v1/webhooks"
payload = {
"url": "https://example.com/adaptyv/webhook",
"headers": "<unknown>",
"secret": "a-32-plus-character-shared-secret"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/adaptyv/webhook',
headers: '<unknown>',
secret: 'a-32-plus-character-shared-secret'
})
};
fetch('https://devs.adaptyvbio.com/api/v1/webhooks', 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://devs.adaptyvbio.com/api/v1/webhooks",
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([
'url' => 'https://example.com/adaptyv/webhook',
'headers' => '<unknown>',
'secret' => 'a-32-plus-character-shared-secret'
]),
CURLOPT_HTTPHEADER => [
"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://devs.adaptyvbio.com/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/adaptyv/webhook\",\n \"headers\": \"<unknown>\",\n \"secret\": \"a-32-plus-character-shared-secret\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://devs.adaptyvbio.com/api/v1/webhooks")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/adaptyv/webhook\",\n \"headers\": \"<unknown>\",\n \"secret\": \"a-32-plus-character-shared-secret\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://devs.adaptyvbio.com/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/adaptyv/webhook\",\n \"headers\": \"<unknown>\",\n \"secret\": \"a-32-plus-character-shared-secret\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"headers": "<unknown>",
"id": "019462a4-b1c2-7def-8901-23456789abcd",
"secret_set": true,
"updated_at": "2023-11-07T05:31:56Z",
"url": "https://example.com/adaptyv/webhook"
}{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}{
"error": "experiment not found",
"request_id": "req_019462a4-b1c2-7def-8901-23456789abcd"
}Body
Request to register an organization-level webhook.
Example
{
"url": "https://example.com/adaptyv/webhook",
"secret": "a-32-plus-character-shared-secret",
"headers": {"X-Tenant-Id": "acme"}
}
HTTPS URL to deliver to. Must be publicly routable.
Receives the events of every experiment in the organization that has not registered a webhook of its own; an experiment that has one delivers only there, not here as well.
"https://example.com/adaptyv/webhook"
Extra HTTP headers to send with each delivery.
HMAC signing secret. Write-only — it is never returned again, so keep your copy. Omit to inherit Adaptyv's deployment-wide secret.
Minimum 32 characters.
32"a-32-plus-character-shared-secret"
Response
Webhook registered
An organization-level webhook registration as returned to the customer.
Creation timestamp.
When false, this registration receives no deliveries.
Extra HTTP headers sent with each delivery.
Registration identifier.
"019462a4-b1c2-7def-8901-23456789abcd"
Whether a signing secret is configured for this registration.
The secret itself is never returned by any endpoint. false means
deliveries fall back to Adaptyv's deployment-wide secret.
Last-modification timestamp.
HTTPS URL deliveries are POSTed to.
"https://example.com/adaptyv/webhook"
Was this page helpful?