> ## 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.

# Create Webhook

> Creates a new webhook endpoint for receiving event notifications.

Creates a new webhook endpoint. The response includes a signing secret that you should store securely - it will be used to verify that incoming webhooks are actually from Cobalt.

### Example Request

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

### Example Response

```json theme={null}
{
    "success": true,
    "webhook_id": "wh_123456789",
    "webhook_url": "https://api.example.com/webhook",
    "webhook_secret": "whsec_abcdefghijklmnopqrstuvwxyz"
}
```

<Note>
  Store the webhook secret securely - you'll need it to verify webhook signatures.
</Note>


## OpenAPI

````yaml POST /webhook
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:
    post:
      summary: Create Webhook
      description: Creates a new webhook endpoint for receiving event notifications.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook_url:
                  type: string
                  description: The URL where webhook events will be sent
              required:
                - webhook_url
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  webhook:
                    type: object
                    properties:
                      webhook_id:
                        type: string
                      webhook_url:
                        type: string
                      webhook_secret_key:
                        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

````