curl --request PUT \
--url https://api.tilta.io/v1/webhooks/{type} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_url": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({destination_url: '<string>'})
};
fetch('https://api.tilta.io/v1/webhooks/{type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tilta.io/v1/webhooks/{type}"
payload = { "destination_url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tilta.io/v1/webhooks/{type}",
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([
'destination_url' => '<string>'
]),
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;
}{
"destination_url": "<string>",
"type": "FACILITY.CREATION.ACCEPTED"
}{
"code": "BAD_REQUEST",
"error": "Request validation failed. 1 issue found.",
"issues": [
{
"code": "INVALID_TYPE",
"path": "body.registered_at",
"message": "Invalid type"
}
]
}{
"error": "Unauthorized",
"code": "UNAUTHORIZED"
}Replace a subscription
Fully replace an existing webhook subscription using PUT semantics. Provide all fields – use this to update a subscription’s target endpoint URL.
curl --request PUT \
--url https://api.tilta.io/v1/webhooks/{type} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination_url": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({destination_url: '<string>'})
};
fetch('https://api.tilta.io/v1/webhooks/{type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tilta.io/v1/webhooks/{type}"
payload = { "destination_url": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tilta.io/v1/webhooks/{type}",
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([
'destination_url' => '<string>'
]),
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;
}{
"destination_url": "<string>",
"type": "FACILITY.CREATION.ACCEPTED"
}{
"code": "BAD_REQUEST",
"error": "Request validation failed. 1 issue found.",
"issues": [
{
"code": "INVALID_TYPE",
"path": "body.registered_at",
"message": "Invalid type"
}
]
}{
"error": "Unauthorized",
"code": "UNAUTHORIZED"
}destination_url – for example, when you migrate to a new server or change your webhook handler path. The event type itself is identified by the path and cannot be changed; unsubscribe and create a new subscription if you need a different event type.
signature_key. Your existing key remains valid and continues to sign every
delivery for this event type. To issue a new signing key, use Rotate Signature
Key.Authorizations
Your Tilta API key, sent as Bearer <key>.
Path Parameters
The webhook's type. Supports the hierarchical dot-notation taxonomy; subscribing to a parent (e.g. FACILITY) implicitly subscribes to every descendant event (e.g. FACILITY.CREATION.ACCEPTED). Other valid values include ORDER.CONFIRMED and INVOICE.DUE.
BUYER, BUYER.CREATED, BUYER.UPDATED, FACILITY, FACILITY.CREATION, FACILITY.CREATION.ACCEPTED, FACILITY.CREATION.IN_REVIEW, FACILITY.CREATION.REJECTED, FACILITY.EXPIRED, FACILITY.FROZEN, FACILITY.INCREASE, FACILITY.INCREASE.ACCEPTED, FACILITY.INCREASE.IN_REVIEW, FACILITY.INCREASE.REJECTED, FACILITY.RENEWAL, FACILITY.RENEWAL.ACCEPTED, FACILITY.RENEWAL.IN_REVIEW, FACILITY.RENEWAL.REJECTED, FACILITY.UNFROZEN, INVOICE, INVOICE.CLOSED, INVOICE.CREATED, INVOICE.DUE, INVOICE.FILE, INVOICE.FILE.CREATED, INVOICE.FILE.DELETED, INVOICE.FILE.REPLACED, INVOICE.FINANCING, INVOICE.FINANCING.PAID_OUT, ORDER, ORDER.CANCELLED, ORDER.CLOSED, ORDER.CONFIRMED, ORDER.DISBURSED, ORDER.EXPIRED "FACILITY.CREATION.ACCEPTED"
Body
Where the webhook should be sent to. This must be an endpoint that handles POST requests.
Response
Where the webhook should be sent to. This must be an endpoint that handles POST requests.
The webhook's type. Supports the hierarchical dot-notation taxonomy; subscribing to a parent (e.g. FACILITY) implicitly subscribes to every descendant event (e.g. FACILITY.CREATION.ACCEPTED). Other valid values include ORDER.CONFIRMED and INVOICE.DUE.
BUYER, BUYER.CREATED, BUYER.UPDATED, FACILITY, FACILITY.CREATION, FACILITY.CREATION.ACCEPTED, FACILITY.CREATION.IN_REVIEW, FACILITY.CREATION.REJECTED, FACILITY.EXPIRED, FACILITY.FROZEN, FACILITY.INCREASE, FACILITY.INCREASE.ACCEPTED, FACILITY.INCREASE.IN_REVIEW, FACILITY.INCREASE.REJECTED, FACILITY.RENEWAL, FACILITY.RENEWAL.ACCEPTED, FACILITY.RENEWAL.IN_REVIEW, FACILITY.RENEWAL.REJECTED, FACILITY.UNFROZEN, INVOICE, INVOICE.CLOSED, INVOICE.CREATED, INVOICE.DUE, INVOICE.FILE, INVOICE.FILE.CREATED, INVOICE.FILE.DELETED, INVOICE.FILE.REPLACED, INVOICE.FINANCING, INVOICE.FINANCING.PAID_OUT, ORDER, ORDER.CANCELLED, ORDER.CLOSED, ORDER.CONFIRMED, ORDER.DISBURSED, ORDER.EXPIRED "FACILITY.CREATION.ACCEPTED"