cURL
curl -X POST "https://api.myworklayer.com/v1/subscriptions/0f8e2b7c-5a1d-4c3e-9b6f-2d7a8c1e4f90/rotate" \
-H "Authorization: Bearer $WORKLAYER_API_KEY"const response = await fetch('https://api.myworklayer.com/v1/subscriptions/0f8e2b7c-5a1d-4c3e-9b6f-2d7a8c1e4f90/rotate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
},
});
const data = await response.json();
console.log(data);{
"secret": "whsec_ZXhhbXBsZS1zaWduaW5nLXNlY3JldC1mb3ItZG9jczI="
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Not Found"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Subscriptions
Rotate the signing secret
Generates a new signing secret for a Subscription. For 24 hours, deliveries are dual-signed with both the new secret and the immediately preceding secret. Send with an empty body. See Rotate the secret.
POST
/
v1
/
subscriptions
/
{id}
/
rotate
cURL
curl -X POST "https://api.myworklayer.com/v1/subscriptions/0f8e2b7c-5a1d-4c3e-9b6f-2d7a8c1e4f90/rotate" \
-H "Authorization: Bearer $WORKLAYER_API_KEY"const response = await fetch('https://api.myworklayer.com/v1/subscriptions/0f8e2b7c-5a1d-4c3e-9b6f-2d7a8c1e4f90/rotate', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
},
});
const data = await response.json();
console.log(data);{
"secret": "whsec_ZXhhbXBsZS1zaWduaW5nLXNlY3JldC1mb3ItZG9jczI="
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Not Found"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Authorizations
Your factory's Worklayer API key (wrk-...). See Get an API key and Authentication. Requests sent from the playground execute live against your factory.