curl --request POST \
--url https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate \
--header 'API-Key: <api-key>' \
--header 'API-Nonce: <api-key>' \
--header 'API-Sign: <api-key>'import requests
url = "https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate"
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Nonce": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'API-Sign': '<api-key>', 'API-Nonce': '<api-key>'}
};
fetch('https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate', 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.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Nonce: <api-key>",
"API-Sign: <api-key>"
],
]);
$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.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Nonce", "<api-key>")
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.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Nonce", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Nonce"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "ep_2YuTbBzs6F8XUjWk7p7uA9KNdL5",
"signing_secret": "whsec_MfJhd2pQ0sZ8nB4vK1xLrT6yWcEa5Ug"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 400,
"code": "bad_request",
"causes": [
{
"field": "page_size",
"message": "must be between 1 and 25"
}
]
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 401,
"code": "unauthenticated"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 403,
"code": "forbidden"
}
}{
"error": {
"type": "webhooks_error",
"status": 404,
"instance": "req_01H00000000000000000000000",
"code": "webhook_not_found"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 429,
"code": "resource_exhausted"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 500,
"code": "internal"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 503,
"code": "unavailable"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 504,
"code": "deadline_exceeded"
}
}Rotate webhook secret
Rotates the webhook’s signing secret and returns the new value.
The new secret replaces the previous secret. Deliveries also include a signature made with the old secret during a short grace period so partners can roll the new value out without dropped deliveries. The new signing secret is returned in plaintext exactly once. Partners must persist it and use it to verify the signature on inbound webhook deliveries.
curl --request POST \
--url https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate \
--header 'API-Key: <api-key>' \
--header 'API-Nonce: <api-key>' \
--header 'API-Sign: <api-key>'import requests
url = "https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate"
headers = {
"API-Key": "<api-key>",
"API-Sign": "<api-key>",
"API-Nonce": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'API-Key': '<api-key>', 'API-Sign': '<api-key>', 'API-Nonce': '<api-key>'}
};
fetch('https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate', 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.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"API-Nonce: <api-key>",
"API-Sign: <api-key>"
],
]);
$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.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("API-Key", "<api-key>")
req.Header.Add("API-Sign", "<api-key>")
req.Header.Add("API-Nonce", "<api-key>")
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.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate")
.header("API-Key", "<api-key>")
.header("API-Sign", "<api-key>")
.header("API-Nonce", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.services.payward.com/v1/webhooks/{webhook_id}/secret/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["API-Key"] = '<api-key>'
request["API-Sign"] = '<api-key>'
request["API-Nonce"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "ep_2YuTbBzs6F8XUjWk7p7uA9KNdL5",
"signing_secret": "whsec_MfJhd2pQ0sZ8nB4vK1xLrT6yWcEa5Ug"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 400,
"code": "bad_request",
"causes": [
{
"field": "page_size",
"message": "must be between 1 and 25"
}
]
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 401,
"code": "unauthenticated"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 403,
"code": "forbidden"
}
}{
"error": {
"type": "webhooks_error",
"status": 404,
"instance": "req_01H00000000000000000000000",
"code": "webhook_not_found"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 429,
"code": "resource_exhausted"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 500,
"code": "internal"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 503,
"code": "unavailable"
}
}{
"error": {
"type": "webhooks_error",
"instance": "req_01H00000000000000000000000",
"status": 504,
"code": "deadline_exceeded"
}
}Authorizations
Your public API key. Identifies the partner making the request.
HMAC signature over the request, computed with your private key.
Monotonically increasing nonce included in the request signature.
Path Parameters
Identifier returned by CreateWebhook.
1 - 64Response
Successful response
Response from RotateWebhookSecret.
The new signing secret is returned in plaintext exactly once. Partners must persist it before discarding the response; it cannot be re-read later.
Data envelope returned exactly once after a successful RotateWebhookSecret.
Show child attributes
Show child attributes