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

# Send Test Webhook

> Sends a test webhook event to verify your integration is working correctly.

Sends a `test.event` webhook to all configured webhook URLs for your client. Use this endpoint to:

* Verify your webhook endpoint is receiving events correctly
* Test your webhook signature verification logic
* Validate your event processing pipeline
* Debug webhook delivery issues

The test event will include the standard webhook structure with a `test.event` type.

### Prerequisites

You must have at least one webhook URL configured before sending a test event. If you haven't configured a webhook URL yet, use the [Create Webhook](/api-reference/webhooks/create) endpoint first.

### Example Request

```bash theme={null}
curl -X POST https://api.usecobalt.com/v1/webhook/test \
  -H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
  -H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
  -H 'access_token: at_live_abc123def456'
```

### Example Response

```json theme={null}
{
  "success": true,
  "message": "Test webhook sent to 2 URL(s)",
  "webhook_urls_count": 2,
  "event": {
    "id": "test-event-1703172600000",
    "access_token_reference_id": "your-reference-id",
    "object": "event",
    "created": "2025-10-21T14:30:00.000Z",
    "type": "test.event",
    "data": {
      "message": "This is a test webhook event",
      "timestamp": "2025-10-21T14:30:00.000Z"
    }
  }
}
```

### What Your Webhook Endpoint Will Receive

Your webhook endpoint will receive the test event with a signature header that you should verify:

```json theme={null}
{
  "id": "test-event-1703172600000",
  "access_token_reference_id": "your-reference-id",
  "object": "event",
  "created": "2025-10-21T14:30:00.000Z",
  "type": "test.event",
  "data": {
    "message": "This is a test webhook event",
    "timestamp": "2025-10-21T14:30:00.000Z"
  }
}
```

<Note>
  The test webhook will be signed with your webhook secret key. Make sure to verify the `cobalt-verification` header to ensure the webhook is authentic. See [Receiving Webhooks](/docs/webhooks/receiving) for signature verification details.
</Note>

### Common Use Cases

<AccordionGroup>
  <Accordion title="Verify Initial Setup">
    After configuring your first webhook URL, send a test event to confirm your endpoint is reachable and processing webhooks correctly.
  </Accordion>

  <Accordion title="Test After Code Changes">
    After updating your webhook handler code, send a test event to verify your changes work as expected before going live.
  </Accordion>

  <Accordion title="Debug Delivery Issues">
    If you're not receiving production webhooks, send a test event to isolate whether the issue is with your endpoint or with specific event types.
  </Accordion>

  <Accordion title="Validate Signature Verification">
    Send a test event and verify the `cobalt-verification` header to ensure your signature verification logic is working correctly.
  </Accordion>
</AccordionGroup>

### Error Responses

**404 - No Webhook URLs Configured**

```json theme={null}
{
  "success": false,
  "message": "No webhook URLs configured. Please add a webhook URL first using POST /v1/webhooks."
}
```

**401 - Invalid Access Token**

```json theme={null}
{
  "success": false,
  "message": "Invalid access token"
}
```

**401 - Access Token Mismatch**

```json theme={null}
{
  "success": false,
  "message": "Access token does not belong to this client"
}
```


## OpenAPI

````yaml POST /webhook/test
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/test:
    post:
      summary: Send Test Webhook
      description: >-
        Sends a test webhook event to all configured webhook URLs. Use this to
        verify your webhook endpoint is receiving events correctly and test your
        webhook signature verification logic.
      responses:
        '200':
          description: Test webhook sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Test webhook sent to 2 URL(s)
                  webhook_urls_count:
                    type: integer
                    example: 2
                  event:
                    type: object
                    properties:
                      id:
                        type: string
                        example: test-event-1703172600000
                      access_token_reference_id:
                        type: string
                        example: your-reference-id
                      object:
                        type: string
                        example: event
                      created:
                        type: string
                        format: date-time
                        example: '2025-10-21T14:30:00.000Z'
                      type:
                        type: string
                        example: test.event
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: This is a test webhook event
                          timestamp:
                            type: string
                            format: date-time
                            example: '2025-10-21T14:30:00.000Z'
        '400':
          description: Missing required headers
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Missing required headers: access_token'
        '401':
          description: Invalid credentials or access token
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid access token
        '404':
          description: No webhook URLs configured
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: >-
                      No webhook URLs configured. Please add a webhook URL first
                      using POST /v1/webhooks.
        '500':
          description: Failed to send test webhook
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Failed to send test webhook
                  error:
                    type: string
                    example: Network error
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

````