---
title: "Rotate Endpoint Secret"
method: POST
path: "/endpoint/{endpoint_id}/secret/rotate"
tags: ["Endpoint"]
---

# Rotate Endpoint Secret

`POST /endpoint/{endpoint_id}/secret/rotate`

Rotates the endpoint's signing secret.  The previous secret will be valid for the next 24 hours.

## Path parameters

- `endpoint_id` string, required — The ep's ID or UID

## Headers

- `idempotency-key` string

## Request body

- EndpointSecretRotateIn
  - `key` string, nullable — The endpoint's verification secret. If `null` is passed, a secret is automatically generated. Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24.

## Response `204`

No content. Your secret has been rotated, but we won't show it here.

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `404` — Not Found. Endpoint not found
- `429` — Too Many Requests
- `500` — Internal Error

---

[API](https://skmtc.net/safecube/apis/api-container-tracking.md) · [All operations](https://skmtc.net/safecube/apis/api-container-tracking/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/safecube/api-container-tracking/revisions/e74a670ab7a5/schema)
