Rotate the signing secret of an endpoint
curl --request POST \
--url https://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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{
"id": "whe_5mJ8kV",
"url": "<string>",
"events": [
"video.ready"
],
"createdAt": "2023-11-07T05:31:56Z",
"signingSecret": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Webhooks
Rotate the signing secret of an endpoint
Makes a new signing secret for the endpoint and returns it once. The endpoint, its URL and its event list do not change. The previous secret stops working as soon as this call returns, so update your server first.
POST
/
v1
/
projects
/
{projectId}
/
webhook-endpoints
/
{endpointId}
/
rotate-secret
Rotate the signing secret of an endpoint
curl --request POST \
--url https://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.segmnt.cloud/v1/projects/{projectId}/webhook-endpoints/{endpointId}/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{
"id": "whe_5mJ8kV",
"url": "<string>",
"events": [
"video.ready"
],
"createdAt": "2023-11-07T05:31:56Z",
"signingSecret": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "plan_limit_reached",
"detail": "<string>"
}Authorizations
apiKeysession
Project API key. Server-side only.
Path Parameters
Pattern:
^prj_[A-Za-z0-9]+$Pattern:
^whe_[A-Za-z0-9]+$Response
New secret. signingSecret is shown only in this response.