Rotate webhook signing secret
Rotate webhook signing secret: rotateWebhookSigningSecret in the TypeScript, Python, Rust and Go clients.
POST /v1/projects/{projectId}/webhooks/destinations/{destinationId}/secret-rotations
Rotates the signing secret for the selected project's webhook destination and returns the new secret. The optional overlapSeconds controls the requested overlap with the previous secret according to the documented request constraints. Store the new secret securely and update the receiver's signature verification configuration; it is returned only in this response and in idempotent replays of it, never by destination reads. Supply the required Idempotency-Key header.
photon.projects.rotateWebhookSigningSecret(input: RotateWebhookSigningSecretInput, options?: RequestOptions): Promise<RotateWebhookSigningSecretOutput>photon.projects.rotate_webhook_signing_secret(input: RotateWebhookSigningSecretInput, *, options: RequestOptions | None = None) -> models.RotateWebhookSigningSecretResponseclient.rotate_webhook_signing_secret(idempotency_key: String, destination_id: String, project_id: String, body: &types::RotateWebhookSigningSecretRequest).await -> Result<ResponseValue<types::RotateWebhookSigningSecretResponse>, Error<RotateWebhookSigningSecretError>>client.Projects.RotateWebhookSigningSecret(ctx context.Context, params *RotateWebhookSigningSecretParams, opts ...RequestOption) (*RotateWebhookSigningSecretResponse, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.rotateWebhookSigningSecret({
path: {
destinationId: "destinationId",
projectId: "projectId",
},
headers: {
idempotencyKey: "idempotencyKey",
},
body: {},
});import os
from photon_api import Photon
from photon_api.rpc_generated import RotateWebhookSigningSecretInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.rotate_webhook_signing_secret(
RotateWebhookSigningSecretInput.model_validate({
"path": {
"destinationId": "destinationId",
"projectId": "projectId",
},
"headers": {
"Idempotency-Key": "idempotencyKey",
},
"body": {},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.rotate_webhook_signing_secret(
"idempotencyKey".to_owned(),
"destinationId".to_owned(),
"projectId".to_owned(),
&serde_json::from_value(serde_json::json!({}))?,
)
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"encoding/json"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
var body photonapi.RotateWebhookSigningSecretRequest
if err := json.Unmarshal([]byte(`{}`), &body); err != nil {
return err
}
result, err := client.Projects.RotateWebhookSigningSecret(ctx, &photonapi.RotateWebhookSigningSecretParams{
IdempotencyKey: "idempotencyKey",
DestinationID: "destinationId",
ProjectID: "projectId",
Body: body,
})
if err != nil {
return err
}
_ = result{
"previousSecretExpiresAt": null,
"signingSecret": "string"
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Identifies one logical mutation across retries.
Body
Returns
200 The new signing secret. RotateWebhookSigningSecretResponse
Headers: Photon-Version. The raw response carries these headers; see Raw responses.