Rotate a billing account webhook endpoint secret
curl --request POST \
--url https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret', 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://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"insight.generated"
],
"enabled": true,
"consecutiveFailures": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z",
"lastFailureAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z",
"disabledReason": "manual",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>",
"code": "<string>",
"ip": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>",
"code": "<string>",
"ip": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123,
"code": "<string>",
"ip": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>",
"code": "<string>",
"ip": "<string>"
}
}Webhooks
Rotate a billing account webhook endpoint secret
Replaces the endpoint’s signing secret and returns the new one. Requires admin access to the billing account’s owner organization. The old secret stops being used immediately, with no overlap period: deliveries sent after this call are signed with the new secret only, so update your verifier right away. The new secret is returned only in this response.
POST
/
api
/
public
/
billing-accounts
/
{billingAccountId}
/
webhooks
/
{webhookId}
/
rotate-secret
Rotate a billing account webhook endpoint secret
curl --request POST \
--url https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret', 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://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/billing-accounts/{billingAccountId}/webhooks/{webhookId}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"insight.generated"
],
"enabled": true,
"consecutiveFailures": 123,
"lastSuccessAt": "2023-11-07T05:31:56Z",
"lastFailureAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z",
"disabledReason": "manual",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secret": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>",
"code": "<string>",
"ip": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>",
"code": "<string>",
"ip": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123,
"code": "<string>",
"ip": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>",
"code": "<string>",
"ip": "<string>"
}
}