Webhooks
Create webhook subscription
Creates a new webhook subscription. Note: You must verify the HMAC-SHA256 signature using the raw request body.
POST
/
api
/
p
/
v
{version}
/
webhooks
Create webhook subscription
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Name": "<string>",
"SubsidiaryId": "<string>",
"Url": "<string>",
"Events": [
"<string>"
],
"IncludePreviousAttributes": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
Name: '<string>',
SubsidiaryId: '<string>',
Url: '<string>',
Events: ['<string>'],
IncludePreviousAttributes: true
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/webhooks"
payload = {
"Name": "<string>",
"SubsidiaryId": "<string>",
"Url": "<string>",
"Events": ["<string>"],
"IncludePreviousAttributes": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/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([
'Name' => '<string>',
'SubsidiaryId' => '<string>',
'Url' => '<string>',
'Events' => [
'<string>'
],
'IncludePreviousAttributes' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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://integrations.alvys.com/api/p/v{version}/webhooks"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"Url\": \"<string>\",\n \"Events\": [\n \"<string>\"\n ],\n \"IncludePreviousAttributes\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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://integrations.alvys.com/api/p/v{version}/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Name\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"Url\": \"<string>\",\n \"Events\": [\n \"<string>\"\n ],\n \"IncludePreviousAttributes\": true\n}")
.asString();{
"Id": "<string>",
"CompanyCode": "<string>",
"SubsidiaryId": "<string>",
"Name": "<string>",
"Url": "<string>",
"Secret": "<string>",
"Events": [
"<string>"
],
"Status": "<string>",
"ConsecutiveFailures": 123,
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"IncludePreviousAttributes": true,
"DisabledAt": "2023-11-07T05:31:56Z",
"DisabledReason": "<string>",
"UpdatedAt": "2023-11-07T05:31:56Z",
"UpdatedBy": "<string>",
"LastTriggeredAt": "2023-11-07T05:31:56Z"
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}Creates a new webhook subscription. Note: You must verify the HMAC-SHA256 signature using the raw request body.
Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Path Parameters
API version (e.g., 1.0)
Example:
"1.0"
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Response
Created
Was this page helpful?
⌘I
Create webhook subscription
curl --request POST \
--url https://integrations.alvys.com/api/p/v{version}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"Name": "<string>",
"SubsidiaryId": "<string>",
"Url": "<string>",
"Events": [
"<string>"
],
"IncludePreviousAttributes": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({
Name: '<string>',
SubsidiaryId: '<string>',
Url: '<string>',
Events: ['<string>'],
IncludePreviousAttributes: true
})
};
fetch('https://integrations.alvys.com/api/p/v{version}/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/webhooks"
payload = {
"Name": "<string>",
"SubsidiaryId": "<string>",
"Url": "<string>",
"Events": ["<string>"],
"IncludePreviousAttributes": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json-patch+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/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([
'Name' => '<string>',
'SubsidiaryId' => '<string>',
'Url' => '<string>',
'Events' => [
'<string>'
],
'IncludePreviousAttributes' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json-patch+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://integrations.alvys.com/api/p/v{version}/webhooks"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"Url\": \"<string>\",\n \"Events\": [\n \"<string>\"\n ],\n \"IncludePreviousAttributes\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json-patch+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://integrations.alvys.com/api/p/v{version}/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"Name\": \"<string>\",\n \"SubsidiaryId\": \"<string>\",\n \"Url\": \"<string>\",\n \"Events\": [\n \"<string>\"\n ],\n \"IncludePreviousAttributes\": true\n}")
.asString();{
"Id": "<string>",
"CompanyCode": "<string>",
"SubsidiaryId": "<string>",
"Name": "<string>",
"Url": "<string>",
"Secret": "<string>",
"Events": [
"<string>"
],
"Status": "<string>",
"ConsecutiveFailures": 123,
"CreatedAt": "2023-11-07T05:31:56Z",
"CreatedBy": "<string>",
"IncludePreviousAttributes": true,
"DisabledAt": "2023-11-07T05:31:56Z",
"DisabledReason": "<string>",
"UpdatedAt": "2023-11-07T05:31:56Z",
"UpdatedBy": "<string>",
"LastTriggeredAt": "2023-11-07T05:31:56Z"
}{
"Errors": {},
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}