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

# Rotate Webhook Secret

> Generates a new signing secret for the webhook. The previous secret will continue to work for 24 hours.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/webhook/wh_123456789/rotate-secret \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh'
```

### Example Response

```json theme={null}
{
    "success": true,
    "webhook": {
        "id": "wh_123456789",
        "secret": "whsec_newsecrethashvalue"
    }
}
```


## OpenAPI

````yaml POST /webhook/{id}/rotate-secret
openapi: 3.0.0
info:
  title: Cobalt API
  version: 1.0.1
  description: API for interacting with Cobalt's EHR integration services
servers:
  - url: https://api.usecobalt.com/v1
security:
  - ClientCredentials: []
    ClientSecret: []
    AccessToken: []
paths:
  /webhook/{id}/rotate-secret:
    post:
      summary: Rotate Webhook Secret
      description: >-
        Generates a new signing secret for the webhook. The previous secret will
        continue to work for 24 hours.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: The webhook ID
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  webhook:
                    type: object
                    properties:
                      id:
                        type: string
                      secret:
                        type: string
components:
  securitySchemes:
    ClientCredentials:
      type: apiKey
      in: header
      name: client_id
    ClientSecret:
      type: apiKey
      in: header
      name: client_secret
    AccessToken:
      type: apiKey
      in: header
      name: access_token

````