Skip to content
Get started

Rotates the webhook signing key for the account

client.Account.RotateWebhookSigningKey(ctx) (*RotateWebhookSigningKeyResponse, error)
POST/v1/account/rotate_webhook_signing_key

Rotates the webhook signing key for the account. Returns only the new key.

ReturnsExpand Collapse
type RotateWebhookSigningKeyResponse struct{…}

RotateWebhookEventsHmacSecretResponse is a response to a RotateWebhookEventsHmacSecretRequest.

WebhookEventsHmacSecret stringoptional

Rotates the webhook signing key for the account

package main

import (
  "context"
  "fmt"

  "github.com/cadenya/cadenya-go"
  "github.com/cadenya/cadenya-go/option"
)

func main() {
  client := cadenya.NewClient(
    option.WithAPIKey("My API Key"),
  )
  rotateWebhookSigningKeyResponse, err := client.Account.RotateWebhookSigningKey(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", rotateWebhookSigningKeyResponse.WebhookEventsHmacSecret)
}
{
  "webhookEventsHmacSecret": "webhookEventsHmacSecret"
}
Returns Examples
{
  "webhookEventsHmacSecret": "webhookEventsHmacSecret"
}