---
updatedAt: 2025-02-19T23:45:02.000Z
agentTools:
  projectIndex: https://documentation.safecube.ai/llms.txt
---

# Rotate Endpoint Secret

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

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Webhook api",
    "version": "1.2.1",
    "description": "Welcome to the documentation of Webhook API\n<h1>Compatibility guidelines</h1> <p>The HTTP API is versioned with a single number, which is currently 1</p> <p>This number symbolizes the major version number. New features can be added to the API in the same version number if there is no breaking change.</p> <p>The version number is present in the url, for instance <strong>/webhook/api/v1</strong> for the current version. <p>Please notice that all \"/shipment\" endpoints are deprecated. Therefore it is recommended to use the \"/easy-shipment\" endpoints.</p>\n<h1>Documentation, Pricing and Key generation</h1> <p>You can find the complete documentation for our API at <a href='https://developers.sinay.ai/'>Developers Platform</a>.</p> <p>Create an account to receive your FREE key in under a minute!</p> <p>Additionally, explore our pricing plans, access support, view detailed documentation, and follow our comprehensive tutorials.</p>\n<h1>Authentication</h1> <p>Every endpoints of this API require authentication using an API key.</p> <p>If you don't have an API Key and you need to use the Ports and Vessels  API, you need to ask Sinay to have one.</p> <p>To use the API Key, you must add a header named <strong>API_KEY</strong> with your API Key as a value.</p> <h1>Test the API with Swagger-ui</h1> <p>To test the API using Swagger-ui, you must click on the button <strong>Authorize</strong> and then fill the <strong>apiKey</strong> field and click on <strong>Authorize</strong>.</p> <p>Swagger-ui will then use the api key automatically in each request.</p> <p>On every endpoints, you can click on <strong>Try it out</strong>, you can modify the body and then click on <strong>Execute</strong></p> <p>You will be able to see the response.</p>\n<h1>Release note</h1> <h2>1.2.0</h2> <ul> <li>POST /easy-shipment-asynchronous</li> </ul> <h2>1.1.0</h2> <ul> <li>Easy-shipment endpoints</li> </ul> <h2>1.0.0</h2> <ul> <li>Manage webhook</li> </ul>"
  },
  "servers": [
    {
      "url": "https://api.sinay.ai/webhook/api/v1"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Endpoint",
      "description": "Endpoints are the URLs messages will be sent to. Endpoints must be configured with filters to setup which events you wish to track with them."
    }
  ],
  "paths": {
    "/endpoint/{endpoint_id}/secret/rotate": {
      "post": {
        "tags": [
          "Endpoint"
        ],
        "summary": "Rotate Endpoint Secret",
        "description": "Rotates the endpoint's signing secret.  The previous secret will be valid for the next 24 hours.",
        "operationId": "v1.endpoint.rotate-secret",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "description": "The ep's ID or UID To retrieve your endpoints ids, use GET /endpoint.",
            "required": true,
            "schema": {
              "description": "The ep's ID or UID",
              "type": "string",
              "maxLength": 256,
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9\\-_.]+$",
              "example": "unique-ep-identifier"
            },
            "style": "simple"
          },
          {
            "in": "header",
            "name": "idempotency-key",
            "description": "The request's idempotency key",
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndpointSecretRotateIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No content. Your secret has been rotated, but we won't show it here."
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpErrorOut"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpErrorOut"
                }
              }
            }
          },
          "404": {
            "description": "Not Found. Endpoint not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpErrorOut"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpErrorOut"
                }
              }
            }
          },
          "500": {
            "description": "Internal Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpErrorOut"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HttpErrorOut": {
        "title": "HttpError",
        "type": "object",
        "required": [
          "code",
          "detail"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "EndpointSecretRotateIn": {
        "type": "object",
        "properties": {
          "key": {
            "description": "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.",
            "default": null,
            "type": "string",
            "pattern": "^(whsec_)?[a-zA-Z0-9+/=]{32,100}$",
            "example": "whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD",
            "nullable": true
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "API_KEY"
      }
    }
  }
}
```