# Rotate a webhook signing secret (/docs/api/other/webhooks_endpoints_rotate_secret)

Issue a new signing secret. The old one keeps signing alongside it for `overlap_s` (default 24 hours), so both verify while you deploy the new one. Returns the new secret once.

`POST /v1/webhooks/endpoints/{id}/rotate-secret`

```json
{
  "operationId": "webhooks_endpoints_rotate_secret",
  "summary": "Rotate a webhook signing secret",
  "description": "Issue a new signing secret. The old one keeps signing alongside it for `overlap_s` (default 24 hours), so both verify while you deploy the new one. Returns the new secret once.",
  "tags": [
    "webhooks"
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "parameters": [
    {
      "schema": {
        "type": "string",
        "pattern": "^whe_[a-z0-9]{8,32}$"
      },
      "required": true,
      "name": "id",
      "in": "path"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "overlap_s": {
              "type": "integer",
              "minimum": 0,
              "maximum": 604800,
              "default": 86400
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "webhook_endpoint"
                ]
              },
              "id": {
                "type": "string",
                "pattern": "^whe_[a-z0-9]{8,32}$"
              },
              "url": {
                "type": "string",
                "maxLength": 2000,
                "format": "uri"
              },
              "description": {
                "type": "string",
                "maxLength": 200
              },
              "event_types": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "call.completed",
                        "call.failed",
                        "job.completed",
                        "job.failed",
                        "list.completed",
                        "waterfall.run.completed",
                        "alert.triggered",
                        "alert.resolved",
                        "vendor_key.failed",
                        "billing.mismatch_detected",
                        "budget.threshold_reached",
                        "key.created",
                        "key.revoked",
                        "member.added",
                        "member.removed"
                      ]
                    },
                    {
                      "type": "string",
                      "enum": [
                        "*"
                      ]
                    }
                  ]
                },
                "minItems": 1
              },
              "enabled": {
                "type": "boolean"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "failing",
                  "disabled"
                ]
              },
              "disabled_reason": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 300
              },
              "secrets": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^whs_[a-z0-9]{8,32}$"
                    },
                    "prefix": {
                      "type": "string",
                      "maxLength": 16
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "prefix",
                    "created_at",
                    "expires_at"
                  ]
                },
                "minItems": 1,
                "maxItems": 2
              },
              "health": {
                "type": "object",
                "properties": {
                  "deliveries": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failures": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "consecutive_failures": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "last_success_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "last_failure_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "failing_since": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "last_error": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300
                  }
                },
                "required": [
                  "deliveries",
                  "failures",
                  "consecutive_failures",
                  "last_success_at",
                  "last_failure_at",
                  "failing_since",
                  "last_error"
                ]
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "secret": {
                "type": "string",
                "pattern": "^whsec_[A-Za-z0-9+/=]{32,}$"
              }
            },
            "required": [
              "object",
              "id",
              "url",
              "description",
              "event_types",
              "enabled",
              "status",
              "disabled_reason",
              "secrets",
              "health",
              "created_at",
              "updated_at",
              "secret"
            ]
          }
        }
      }
    },
    "default": {
      "description": "Error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "invalid_request",
                      "unauthorized",
                      "insufficient_balance",
                      "max_cost_exceeded",
                      "scope_denied",
                      "budget_blocked",
                      "not_found",
                      "idempotency_mismatch",
                      "invalid_meta",
                      "rate_limited",
                      "upstream_error",
                      "response_buffer_limit",
                      "provider_capacity_unavailable",
                      "grid_saturated",
                      "upstream_timeout",
                      "conflict",
                      "internal_error",
                      "account_frozen",
                      "strict_filters",
                      "plan_limit_reached",
                      "validation_failed",
                      "deadline_exceeded",
                      "cancelled"
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "retry_after_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "details": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  }
}
```
