curl --request POST \
--url https://api.uselora.com/v1/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"immediate": false
}
'import requests
url = "https://api.uselora.com/v1/webhooks/{id}/rotate-secret"
payload = { "immediate": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({immediate: false})
};
fetch('https://api.uselora.com/v1/webhooks/{id}/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://api.uselora.com/v1/webhooks/{id}/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_POSTFIELDS => json_encode([
'immediate' => false
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uselora.com/v1/webhooks/{id}/rotate-secret"
payload := strings.NewReader("{\n \"immediate\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.uselora.com/v1/webhooks/{id}/rotate-secret")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"immediate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselora.com/v1/webhooks/{id}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"immediate\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"secret": "whsec_your_signing_secret"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"fieldErrors": {},
"traceId": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "plan_requires_upgrade",
"requestId": "<string>",
"traceId": "<string>",
"current_plan": "<string>",
"required_capability": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "payload_too_large",
"requestId": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "internal_error",
"requestId": "<string>",
"traceId": "<string>"
}Rotate a signing secret
Replaces the endpoint’s signing secret and returns the new one. Needs the Business plan or above. An endpoint made by an integration (source: subscription) is not found here.
Every request is signed with the new secret and, for 24 hours, with the old one too, so a receiver can switch without dropping events. Rotating again inside that window replaces the older secret. Send { "immediate": true } to stop the old secret at once, for example when it has leaked: requests signed with it no longer verify, so the receiver must switch immediately.
This operation and Create a webhook endpoint are the only ones whose responses contain a signing secret. The body may be left out.
curl --request POST \
--url https://api.uselora.com/v1/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"immediate": false
}
'import requests
url = "https://api.uselora.com/v1/webhooks/{id}/rotate-secret"
payload = { "immediate": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({immediate: false})
};
fetch('https://api.uselora.com/v1/webhooks/{id}/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://api.uselora.com/v1/webhooks/{id}/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_POSTFIELDS => json_encode([
'immediate' => false
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uselora.com/v1/webhooks/{id}/rotate-secret"
payload := strings.NewReader("{\n \"immediate\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.uselora.com/v1/webhooks/{id}/rotate-secret")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"immediate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselora.com/v1/webhooks/{id}/rotate-secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"immediate\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"secret": "whsec_your_signing_secret"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"fieldErrors": {},
"traceId": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "plan_requires_upgrade",
"requestId": "<string>",
"traceId": "<string>",
"current_plan": "<string>",
"required_capability": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "payload_too_large",
"requestId": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "internal_error",
"requestId": "<string>",
"traceId": "<string>"
}Authorizations
Workspace API key (lora_sk_…) sent as Authorization: Bearer <api_key>. Each scoped operation names the scope it requires in its security requirement, for example shortcuts.write; a key without it receives 403 with code: insufficient_scope. GET /v1/qr also accepts anonymous requests and requires no scope.
Path Parameters
The endpoint's unique ID, wh_ and a UUID.
^wh_[0-9a-f-]{36}$"wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f"
Body
Options for rotating a signing secret. The body may be left out.
Stop the old secret at once instead of after 24 hours. Use it when the old secret is compromised: requests signed with it no longer verify, so the receiver must switch immediately.
Response
The new signing secret.
The new signing secret. Every request signs with the new secret, and with the old one too until previousSecretExpiresAt.
The endpoint's unique ID.
^wh_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f"
When the replaced secret stops signing, ISO 8601: 24 hours from now, or null for an immediate rotation. Rotating again before then replaces the older secret.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$The signing secret, whsec_ and base64. Shown here once and never again: store it now. Verify requests with it using any Standard Webhooks library.
"whsec_your_signing_secret"
Was this page helpful?