> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate a webhook endpoint secret JSON Schema

> Rotate a webhook endpoint secret JSON Schema contract. Includes parameters, response shapes, examples, and implementation notes from the 0xArchive contract.

Source OpenAPI: 0xArchive API 1.6.1; 168 paths; 190 component schemas.

Issue a new signing secret for the endpoint and return it. The previous secret keeps verifying for 24 hours, so a receiver can accept both while it rolls over. This and endpoint creation are the only responses that carry a secret. Authenticate with an API key or a signed-in dashboard session. Costs no credits.

## Route Metadata

| Field                | Value                                |
| -------------------- | ------------------------------------ |
| Method               | `POST`                               |
| Path                 | `/v1/webhooks/endpoints/{id}/rotate` |
| operationId          | `rotateWebhookEndpointSecret`        |
| Tag                  | Webhooks - Endpoints                 |
| Family               | Webhooks                             |
| Deprecated or legacy | no                                   |

## Request Parameters

### Path Parameters

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "rotateWebhookEndpointSecret path parameters",
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "description": "Endpoint identifier.",
      "type": "string",
      "format": "uuid",
      "example": "3c1f0a52-8d6b-4f0e-9b1a-6f2c4d8e9a10",
      "x-parameter-location": "path"
    }
  }
}
```

## Response Contracts

### Status 200

The new signing secret

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "rotateWebhookEndpointSecret response 200",
  "description": "API response containing a rotated signing secret.",
  "type": "object",
  "properties": {
    "data": {
      "description": "A freshly rotated signing secret.",
      "type": "object",
      "required": [
        "secret"
      ],
      "properties": {
        "secret": {
          "description": "The new signing secret. The previous one keeps verifying for 24 hours so a receiver can roll over without dropping deliveries.",
          "type": "string",
          "example": "whsec_6f1c0b2a4d8e5f3a9c7b1e0d2f4a6c8b1d3e5f7a9c0b2d4e6f8a1c3b5d7e9f0a"
        }
      }
    },
    "note": {
      "description": "How long the previous secret keeps verifying.",
      "type": "string",
      "example": "Previous secret remains valid for 24 hours."
    },
    "success": {
      "type": "boolean",
      "example": true
    }
  }
}
```

### Status 401

Authentication required

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "rotateWebhookEndpointSecret response 401",
  "description": "Error response",
  "type": "object",
  "properties": {
    "code": {
      "description": "HTTP status code",
      "type": "integer"
    },
    "error": {
      "description": "Error message",
      "type": "string"
    },
    "error_code": {
      "description": "Machine-readable error code. Common values: `invalid_query_params` (a query parameter failed to parse or validate) and `invalid_path_params` (a path parameter failed to parse). Other endpoint-specific codes exist; treat unknown codes as generic errors of the given HTTP status.",
      "type": "string"
    },
    "request_id": {
      "description": "Unique request ID for support",
      "type": "string",
      "format": "uuid"
    }
  }
}
```

##### OpenAPI example

```json theme={"theme":"github-dark"}
{
  "code": 401,
  "error": "Missing or invalid API key. Provide X-API-Key header."
}
```

### Status 404

Resource not found

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "rotateWebhookEndpointSecret response 404",
  "description": "Error response",
  "type": "object",
  "properties": {
    "code": {
      "description": "HTTP status code",
      "type": "integer"
    },
    "error": {
      "description": "Error message",
      "type": "string"
    },
    "error_code": {
      "description": "Machine-readable error code. Common values: `invalid_query_params` (a query parameter failed to parse or validate) and `invalid_path_params` (a path parameter failed to parse). Other endpoint-specific codes exist; treat unknown codes as generic errors of the given HTTP status.",
      "type": "string"
    },
    "request_id": {
      "description": "Unique request ID for support",
      "type": "string",
      "format": "uuid"
    }
  }
}
```

##### OpenAPI example

```json theme={"theme":"github-dark"}
{
  "code": 404,
  "error": "Resource not found"
}
```

### Status 429

Rate limit exceeded

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "rotateWebhookEndpointSecret response 429",
  "description": "Error response",
  "type": "object",
  "properties": {
    "code": {
      "description": "HTTP status code",
      "type": "integer"
    },
    "error": {
      "description": "Error message",
      "type": "string"
    },
    "error_code": {
      "description": "Machine-readable error code. Common values: `invalid_query_params` (a query parameter failed to parse or validate) and `invalid_path_params` (a path parameter failed to parse). Other endpoint-specific codes exist; treat unknown codes as generic errors of the given HTTP status.",
      "type": "string"
    },
    "request_id": {
      "description": "Unique request ID for support",
      "type": "string",
      "format": "uuid"
    }
  }
}
```

##### OpenAPI example

```json theme={"theme":"github-dark"}
{
  "code": 429,
  "error": "Rate limit exceeded"
}
```
