> ## Documentation Index
> Fetch the complete documentation index at: https://60db.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Webhook

> Create a new webhook

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  application/json
</ParamField>

### Body

<ParamField body="url" type="string" required>
  Webhook URL (must be HTTPS)
</ParamField>

<ParamField body="events" type="array" required>
  Array of event types to subscribe to
</ParamField>

<ParamField body="secret" type="string">
  Optional secret for webhook signature verification
</ParamField>

## Available Events

* `tts.completed` - Text-to-speech generation completed
* `tts.failed` - Text-to-speech generation failed
* `stt.completed` - Speech-to-text transcription completed
* `stt.failed` - Speech-to-text transcription failed
* `voice.created` - Custom voice created
* `voice.ready` - Custom voice processing completed
* `voice.failed` - Custom voice processing failed

## Response

<ResponseField name="id" type="string">
  Webhook ID
</ResponseField>

<ResponseField name="url" type="string">
  Webhook URL
</ResponseField>

<ResponseField name="events" type="array">
  Subscribed events
</ResponseField>

<ResponseField name="status" type="string">
  Webhook status
</ResponseField>

<ResponseField name="created_at" type="string">
  Creation timestamp
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.60db.ai/webhooks \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://example.com/webhook",
      "events": ["tts.completed", "stt.completed"],
      "secret": "your-webhook-secret"
    }'
  ```

  ```javascript JavaScript theme={null}
  const webhook = await client.createWebhook({
    url: "https://example.com/webhook",
    events: ["tts.completed", "stt.completed"],
    secret: "your-webhook-secret",
  });
  ```

  ```python Python theme={null}
  webhook = client.create_webhook(
      url='https://example.com/webhook',
      events=['tts.completed', 'stt.completed'],
      secret='your-webhook-secret'
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "wh-456",
    "url": "https://example.com/webhook",
    "events": ["tts.completed", "stt.completed"],
    "status": "active",
    "created_at": "2026-01-29T11:35:00Z"
  }
  ```
</ResponseExample>

## Webhook Payload

When an event occurs, we'll send a POST request to your webhook URL:

```json theme={null}
{
  "event": "tts.completed",
  "timestamp": "2026-01-29T11:35:00Z",
  "data": {
    "id": "tts-123",
    "text": "Hello, world!",
    "voice_id": "default-voice",
    "audio_url": "https://cdn.60db.com/audio/tts-123.mp3",
    "duration": 2.5
  }
}
```
