Rotate the signing secret
curl --request POST \
--url https://dev.kori.ml/merchant/api/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.kori.ml/merchant/api/webhooks/{id}/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://dev.kori.ml/merchant/api/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://dev.kori.ml/merchant/api/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_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://dev.kori.ml/merchant/api/webhooks/{id}/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://dev.kori.ml/merchant/api/webhooks/{id}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.kori.ml/merchant/api/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>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"id": 17,
"secret": "9f2b7c1e4a8d05f3b6c9e2a7d41b8e6039c5a2f7d8b1e4c6a9f0b3d7e2c8a15"
}
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Webhooks
Rotate the signing secret
Replaces the endpoint’s signing secret and returns the new one. The secret is shown only in this response and cannot be retrieved afterwards.
Deliveries are signed with the new secret immediately, so any delivery still in
flight under the old secret will fail your verification until you deploy the new
one. Requires scope webhooks.
POST
/
merchant
/
api
/
webhooks
/
{id}
/
rotate-secret
Rotate the signing secret
curl --request POST \
--url https://dev.kori.ml/merchant/api/webhooks/{id}/rotate-secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.kori.ml/merchant/api/webhooks/{id}/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://dev.kori.ml/merchant/api/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://dev.kori.ml/merchant/api/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_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://dev.kori.ml/merchant/api/webhooks/{id}/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://dev.kori.ml/merchant/api/webhooks/{id}/rotate-secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.kori.ml/merchant/api/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>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": {
"id": 17,
"secret": "9f2b7c1e4a8d05f3b6c9e2a7d41b8e6039c5a2f7d8b1e4c6a9f0b3d7e2c8a15"
}
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"success": false,
"message": "Invalid or missing parameter",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}