> ## Documentation Index
> Fetch the complete documentation index at: https://developers.kit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke the previous webhook endpoint secret

> Closes a [rotation's](/api-reference/webhooks/rotate-a-webhook-endpoint-secret) overlap window early: the previous secret stops verifying immediately, leaving only the current secret valid. Call this once you've fully switched to the new secret, rather than waiting for `previous_secret_expires_at` to pass.

Subsequent deliveries are signed with the current secret only, so the `X-Kit-Signature` header goes back to carrying a single `v1` entry.



## OpenAPI

````yaml /api-reference/v4.json post /v4/webhook_endpoints/{id}/revoke_previous_secret
openapi: 3.0.3
info:
  title: Kit API
  version: '4.0'
servers:
  - url: https://api.kit.com
security: []
paths:
  /v4/webhook_endpoints/{id}/revoke_previous_secret:
    post:
      tags:
        - Webhooks
      summary: Revoke the previous webhook endpoint secret
      description: >-
        Closes a
        [rotation's](/api-reference/webhooks/rotate-a-webhook-endpoint-secret)
        overlap window early: the previous secret stops verifying immediately,
        leaving only the current secret valid. Call this once you've fully
        switched to the new secret, rather than waiting for
        `previous_secret_expires_at` to pass.


        Subsequent deliveries are signed with the current secret only, so the
        `X-Kit-Signature` header goes back to carrying a single `v1` entry.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          example: 95
      responses:
        '200':
          description: Revokes the previous secret, closing the rotation overlap window
          content:
            application/json:
              schema:
                type: object
                properties:
                  webhook_endpoint:
                    type: object
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
                      url:
                        type: string
                      events:
                        type: array
                        items:
                          type: string
                      status:
                        type: string
                      source:
                        type: string
                      description:
                        type: string
                      created_by_app:
                        nullable: true
                      created_at:
                        type: string
                      previous_secret_expires_at:
                        nullable: true
                    required:
                      - id
                      - name
                      - url
                      - events
                      - status
                      - source
                      - description
                      - created_by_app
                      - created_at
                      - previous_secret_expires_at
                required:
                  - webhook_endpoint
              example:
                webhook_endpoint:
                  id: 85
                  name: My webhook
                  url: https://hooks.example.com/incoming
                  events:
                    - subscriber.created
                  status: active
                  source: creator
                  description: A test webhook
                  created_by_app: null
                  created_at: '2023-02-17T11:43:55Z'
                  previous_secret_expires_at: null
        '404':
          description: Returns a 404 when the provided id does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                required:
                  - errors
              example:
                errors:
                  - Not Found
      security:
        - API Key: []
        - OAuth2: []
components:
  securitySchemes:
    API Key:
      description: Authenticate API requests via an API Key
      type: apiKey
      in: header
      name: X-Kit-Api-Key
    OAuth2:
      description: Authenticate API requests via an OAuth token
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.kit.com/v4/oauth/authorize
          tokenUrl: https://api.kit.com/v4/oauth/token
          refreshUrl: https://api.kit.com/v4/oauth/token
          scopes:
            read: Read access to Kit API v4
            write: Write access to Kit API v4

````

## Related topics

- [Rotate a webhook endpoint secret](/api-reference/webhooks/rotate-a-webhook-endpoint-secret.md)
- [OAuth authorization](/plugins/oauth-authorization.md)
- [Verifying signatures](/webhooks/verifying-signatures.md)
- [Get a webhook endpoint](/api-reference/webhooks/get-a-webhook-endpoint.md)
- [Create a webhook endpoint](/api-reference/webhooks/create-a-webhook-endpoint.md)
