# Webhook Subscriptions

## Create a new webhook subscription

`client.webhookSubscriptions.create(WebhookSubscriptionCreateParamsbody, RequestOptionsoptions?): WebhookSubscriptionCreateResponse`

**post** `/v3/webhook-subscriptions`

Create a new webhook subscription to receive events at a target URL.
Upon creation, a signing secret is generated for verifying webhook
authenticity. **Store this secret securely — it cannot be retrieved later.**

**Phone Number Filtering:**

- Optionally specify `phone_numbers` to only receive events for specific lines
- If omitted, events from all phone numbers are delivered (default behavior)
- Use multiple subscriptions with different `phone_numbers` to route different lines to different endpoints
- Each `target_url` can only be used once per account. To route different
  lines to different destinations, use a unique URL per subscription
  (e.g., append a query parameter: `https://example.com/webhook?line=1`)

**Webhook Delivery:**

- Events are sent via HTTP POST to the target URL
- Each request includes [Standard Webhooks](https://github.com/standard-webhooks/standard-webhooks) headers (`webhook-id`, `webhook-timestamp`, `webhook-signature`) for signature verification
- Legacy `X-Webhook-*` headers are also sent for backwards compatibility (deprecated)
- See [Verifying Webhook Signatures](https://docs.linqapp.com/channel/imessage/guides/webhooks#verifying-webhook-signatures) for verification details
- Failed deliveries (5xx, 429, network errors) are retried up to 10 times over ~25 minutes with exponential backoff
- Client errors (4xx except 429) are not retried

### Parameters

- `body: WebhookSubscriptionCreateParams`

  - `subscribed_events: Array<WebhookEventType>`

    List of event types to subscribe to

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url: string`

    URL where webhook events will be sent. Must be HTTPS.

  - `phone_numbers?: Array<string>`

    Optional list of phone numbers to filter events for. Only events originating from these phone numbers will be delivered to this subscription. If omitted or empty, events from all phone numbers are delivered. Phone numbers must be in E.164 format.

  - `routing_id_header?: string`

    Name of the header carrying the chat id, used to hash-route before a token is learned. Defaults to `Linq-Chat-Id`. Ignored without `routing_key_header`.

  - `routing_key_header?: string`

    Enables delivery affinity. Name of the header carrying an opaque routing token: we send it on each webhook for a chat and read it back from your 2xx response, so your edge can route to the cluster holding that chat. Omit to disable.

### Returns

- `WebhookSubscriptionCreateResponse`

  Response returned when creating a webhook subscription. Includes the signing secret which is only shown once.

  - `id: string`

    Unique identifier for the webhook subscription

  - `created_at: string`

    When the subscription was created

  - `is_active: boolean`

    Whether this subscription is currently active

  - `signing_secret: string`

    Secret for verifying webhook signatures. Store this securely - it cannot be retrieved again.

  - `subscribed_events: Array<WebhookEventType>`

    List of event types this subscription receives

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url: string`

    URL where webhook events will be sent

  - `updated_at: string`

    When the subscription was last updated

  - `phone_numbers?: Array<string> | null`

    Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

  - `routing_id_header?: string | null`

    Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

  - `routing_key_header?: string | null`

    Header carrying the routing token. Null disables delivery affinity.

### Example

```typescript
import LinqAPIV3 from '@linqapp/sdk';

const client = new LinqAPIV3({
  apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});

const webhookSubscription = await client.webhookSubscriptions.create({
  subscribed_events: ['message.sent', 'message.delivered', 'message.read'],
  target_url: 'https://webhooks.example.com/linq/events',
});

console.log(webhookSubscription.id);
```

#### Response

```json
{
  "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "created_at": "2024-01-15T10:30:00Z",
  "is_active": true,
  "signing_secret": "whsec_abc123def456",
  "subscribed_events": [
    "message.sent",
    "message.delivered",
    "message.read"
  ],
  "target_url": "https://webhooks.example.com/linq/events",
  "updated_at": "2024-01-15T10:30:00Z",
  "phone_numbers": [
    "string"
  ],
  "routing_id_header": "X-Chat-Id",
  "routing_key_header": "X-Route-Token"
}
```

## List all webhook subscriptions

`client.webhookSubscriptions.list(RequestOptionsoptions?): WebhookSubscriptionListResponse`

**get** `/v3/webhook-subscriptions`

Retrieve all webhook subscriptions for the authenticated partner.
Returns a list of active and inactive subscriptions with their
configuration and status.

### Returns

- `WebhookSubscriptionListResponse`

  - `subscriptions: Array<WebhookSubscription>`

    List of webhook subscriptions

    - `id: string`

      Unique identifier for the webhook subscription

    - `created_at: string`

      When the subscription was created

    - `is_active: boolean`

      Whether this subscription is currently active

    - `subscribed_events: Array<WebhookEventType>`

      List of event types this subscription receives

      - `"message.sent"`

      - `"message.received"`

      - `"message.read"`

      - `"message.delivered"`

      - `"message.failed"`

      - `"message.edited"`

      - `"reaction.added"`

      - `"reaction.removed"`

      - `"poll.received"`

      - `"poll.failed"`

      - `"poll.sent"`

      - `"poll.delivered"`

      - `"poll.read"`

      - `"poll.updated"`

      - `"poll.vote.added"`

      - `"poll.vote.removed"`

      - `"poll.reaction.added"`

      - `"participant.added"`

      - `"participant.removed"`

      - `"chat.created"`

      - `"chat.group_name_updated"`

      - `"chat.group_icon_updated"`

      - `"chat.group_name_update_failed"`

      - `"chat.group_icon_update_failed"`

      - `"chat.background_updated"`

      - `"chat.background_update_failed"`

      - `"chat.typing_indicator.started"`

      - `"chat.typing_indicator.stopped"`

      - `"phone_number.status_updated"`

      - `"phone_number.assigned"`

      - `"phone_number.released"`

      - `"contact_card.received"`

      - `"call.initiated"`

      - `"call.ringing"`

      - `"call.answered"`

      - `"call.ended"`

      - `"call.failed"`

      - `"call.declined"`

      - `"call.no_answer"`

      - `"location.sharing.started"`

      - `"location.sharing.stopped"`

      - `"payment.succeeded"`

      - `"payment.canceled"`

      - `"payment.expired"`

      - `"payment.declined"`

      - `"payment.authorized"`

      - `"connection.created"`

      - `"connection.revoked"`

    - `target_url: string`

      URL where webhook events will be sent

    - `updated_at: string`

      When the subscription was last updated

    - `phone_numbers?: Array<string> | null`

      Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

    - `routing_id_header?: string | null`

      Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

    - `routing_key_header?: string | null`

      Header carrying the routing token. Null disables delivery affinity.

### Example

```typescript
import LinqAPIV3 from '@linqapp/sdk';

const client = new LinqAPIV3({
  apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});

const webhookSubscriptions = await client.webhookSubscriptions.list();

console.log(webhookSubscriptions.subscriptions);
```

#### Response

```json
{
  "subscriptions": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
      "created_at": "2024-01-15T10:30:00Z",
      "is_active": true,
      "subscribed_events": [
        "message.sent",
        "message.delivered",
        "message.read"
      ],
      "target_url": "https://webhooks.example.com/linq/events",
      "updated_at": "2024-01-15T10:30:00Z",
      "phone_numbers": [
        "string"
      ],
      "routing_id_header": "X-Chat-Id",
      "routing_key_header": "X-Route-Token"
    }
  ]
}
```

## Get a webhook subscription by ID

`client.webhookSubscriptions.retrieve(stringsubscriptionID, RequestOptionsoptions?): WebhookSubscription`

**get** `/v3/webhook-subscriptions/{subscriptionId}`

Retrieve details for a specific webhook subscription including its
target URL, subscribed events, and current status.

### Parameters

- `subscriptionID: string`

### Returns

- `WebhookSubscription`

  - `id: string`

    Unique identifier for the webhook subscription

  - `created_at: string`

    When the subscription was created

  - `is_active: boolean`

    Whether this subscription is currently active

  - `subscribed_events: Array<WebhookEventType>`

    List of event types this subscription receives

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url: string`

    URL where webhook events will be sent

  - `updated_at: string`

    When the subscription was last updated

  - `phone_numbers?: Array<string> | null`

    Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

  - `routing_id_header?: string | null`

    Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

  - `routing_key_header?: string | null`

    Header carrying the routing token. Null disables delivery affinity.

### Example

```typescript
import LinqAPIV3 from '@linqapp/sdk';

const client = new LinqAPIV3({
  apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});

const webhookSubscription = await client.webhookSubscriptions.retrieve(
  'b2c3d4e5-f6a7-8901-bcde-f23456789012',
);

console.log(webhookSubscription.id);
```

#### Response

```json
{
  "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "created_at": "2024-01-15T10:30:00Z",
  "is_active": true,
  "subscribed_events": [
    "message.sent",
    "message.delivered",
    "message.read"
  ],
  "target_url": "https://webhooks.example.com/linq/events",
  "updated_at": "2024-01-15T10:30:00Z",
  "phone_numbers": [
    "string"
  ],
  "routing_id_header": "X-Chat-Id",
  "routing_key_header": "X-Route-Token"
}
```

## Update a webhook subscription

`client.webhookSubscriptions.update(stringsubscriptionID, WebhookSubscriptionUpdateParamsbody, RequestOptionsoptions?): WebhookSubscription`

**put** `/v3/webhook-subscriptions/{subscriptionId}`

Update an existing webhook subscription. You can modify the target URL,
subscribed events, or activate/deactivate the subscription.

**Note:** The signing secret cannot be changed via this endpoint.

### Parameters

- `subscriptionID: string`

- `body: WebhookSubscriptionUpdateParams`

  - `is_active?: boolean`

    Activate or deactivate the subscription

  - `phone_numbers?: Array<string> | null`

    Updated list of phone numbers to filter events for. Set to a non-empty array to filter events to specific phone numbers. Set to an empty array or null to remove the filter and receive events from all phone numbers. Phone numbers must be in E.164 format.

  - `routing_id_header?: string | null`

    Updated header name for the chat id. Set to null or an empty string to fall back to `Linq-Chat-Id`.

  - `routing_key_header?: string | null`

    Updated header name for the routing token. Set to null or an empty string to disable delivery affinity and drop the stored tokens.

  - `subscribed_events?: Array<WebhookEventType>`

    Updated list of event types to subscribe to

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url?: string`

    New target URL for webhook events

### Returns

- `WebhookSubscription`

  - `id: string`

    Unique identifier for the webhook subscription

  - `created_at: string`

    When the subscription was created

  - `is_active: boolean`

    Whether this subscription is currently active

  - `subscribed_events: Array<WebhookEventType>`

    List of event types this subscription receives

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url: string`

    URL where webhook events will be sent

  - `updated_at: string`

    When the subscription was last updated

  - `phone_numbers?: Array<string> | null`

    Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

  - `routing_id_header?: string | null`

    Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

  - `routing_key_header?: string | null`

    Header carrying the routing token. Null disables delivery affinity.

### Example

```typescript
import LinqAPIV3 from '@linqapp/sdk';

const client = new LinqAPIV3({
  apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});

const webhookSubscription = await client.webhookSubscriptions.update(
  'b2c3d4e5-f6a7-8901-bcde-f23456789012',
  { target_url: 'https://webhooks.example.com/linq/events' },
);

console.log(webhookSubscription.id);
```

#### Response

```json
{
  "id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "created_at": "2024-01-15T10:30:00Z",
  "is_active": true,
  "subscribed_events": [
    "message.sent",
    "message.delivered",
    "message.read"
  ],
  "target_url": "https://webhooks.example.com/linq/events",
  "updated_at": "2024-01-15T10:30:00Z",
  "phone_numbers": [
    "string"
  ],
  "routing_id_header": "X-Chat-Id",
  "routing_key_header": "X-Route-Token"
}
```

## Delete a webhook subscription

`client.webhookSubscriptions.delete(stringsubscriptionID, RequestOptionsoptions?): void`

**delete** `/v3/webhook-subscriptions/{subscriptionId}`

Delete a webhook subscription.

### Parameters

- `subscriptionID: string`

### Example

```typescript
import LinqAPIV3 from '@linqapp/sdk';

const client = new LinqAPIV3({
  apiKey: process.env['LINQ_API_V3_API_KEY'], // This is the default and can be omitted
});

await client.webhookSubscriptions.delete('b2c3d4e5-f6a7-8901-bcde-f23456789012');
```

#### Response

```json
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token",
    "doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/2xxx/2004/"
  },
  "success": false
}
```

## Domain Types

### Webhook Subscription

- `WebhookSubscription`

  - `id: string`

    Unique identifier for the webhook subscription

  - `created_at: string`

    When the subscription was created

  - `is_active: boolean`

    Whether this subscription is currently active

  - `subscribed_events: Array<WebhookEventType>`

    List of event types this subscription receives

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url: string`

    URL where webhook events will be sent

  - `updated_at: string`

    When the subscription was last updated

  - `phone_numbers?: Array<string> | null`

    Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

  - `routing_id_header?: string | null`

    Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

  - `routing_key_header?: string | null`

    Header carrying the routing token. Null disables delivery affinity.

### Webhook Subscription Create Response

- `WebhookSubscriptionCreateResponse`

  Response returned when creating a webhook subscription. Includes the signing secret which is only shown once.

  - `id: string`

    Unique identifier for the webhook subscription

  - `created_at: string`

    When the subscription was created

  - `is_active: boolean`

    Whether this subscription is currently active

  - `signing_secret: string`

    Secret for verifying webhook signatures. Store this securely - it cannot be retrieved again.

  - `subscribed_events: Array<WebhookEventType>`

    List of event types this subscription receives

    - `"message.sent"`

    - `"message.received"`

    - `"message.read"`

    - `"message.delivered"`

    - `"message.failed"`

    - `"message.edited"`

    - `"reaction.added"`

    - `"reaction.removed"`

    - `"poll.received"`

    - `"poll.failed"`

    - `"poll.sent"`

    - `"poll.delivered"`

    - `"poll.read"`

    - `"poll.updated"`

    - `"poll.vote.added"`

    - `"poll.vote.removed"`

    - `"poll.reaction.added"`

    - `"participant.added"`

    - `"participant.removed"`

    - `"chat.created"`

    - `"chat.group_name_updated"`

    - `"chat.group_icon_updated"`

    - `"chat.group_name_update_failed"`

    - `"chat.group_icon_update_failed"`

    - `"chat.background_updated"`

    - `"chat.background_update_failed"`

    - `"chat.typing_indicator.started"`

    - `"chat.typing_indicator.stopped"`

    - `"phone_number.status_updated"`

    - `"phone_number.assigned"`

    - `"phone_number.released"`

    - `"contact_card.received"`

    - `"call.initiated"`

    - `"call.ringing"`

    - `"call.answered"`

    - `"call.ended"`

    - `"call.failed"`

    - `"call.declined"`

    - `"call.no_answer"`

    - `"location.sharing.started"`

    - `"location.sharing.stopped"`

    - `"payment.succeeded"`

    - `"payment.canceled"`

    - `"payment.expired"`

    - `"payment.declined"`

    - `"payment.authorized"`

    - `"connection.created"`

    - `"connection.revoked"`

  - `target_url: string`

    URL where webhook events will be sent

  - `updated_at: string`

    When the subscription was last updated

  - `phone_numbers?: Array<string> | null`

    Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

  - `routing_id_header?: string | null`

    Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

  - `routing_key_header?: string | null`

    Header carrying the routing token. Null disables delivery affinity.

### Webhook Subscription List Response

- `WebhookSubscriptionListResponse`

  - `subscriptions: Array<WebhookSubscription>`

    List of webhook subscriptions

    - `id: string`

      Unique identifier for the webhook subscription

    - `created_at: string`

      When the subscription was created

    - `is_active: boolean`

      Whether this subscription is currently active

    - `subscribed_events: Array<WebhookEventType>`

      List of event types this subscription receives

      - `"message.sent"`

      - `"message.received"`

      - `"message.read"`

      - `"message.delivered"`

      - `"message.failed"`

      - `"message.edited"`

      - `"reaction.added"`

      - `"reaction.removed"`

      - `"poll.received"`

      - `"poll.failed"`

      - `"poll.sent"`

      - `"poll.delivered"`

      - `"poll.read"`

      - `"poll.updated"`

      - `"poll.vote.added"`

      - `"poll.vote.removed"`

      - `"poll.reaction.added"`

      - `"participant.added"`

      - `"participant.removed"`

      - `"chat.created"`

      - `"chat.group_name_updated"`

      - `"chat.group_icon_updated"`

      - `"chat.group_name_update_failed"`

      - `"chat.group_icon_update_failed"`

      - `"chat.background_updated"`

      - `"chat.background_update_failed"`

      - `"chat.typing_indicator.started"`

      - `"chat.typing_indicator.stopped"`

      - `"phone_number.status_updated"`

      - `"phone_number.assigned"`

      - `"phone_number.released"`

      - `"contact_card.received"`

      - `"call.initiated"`

      - `"call.ringing"`

      - `"call.answered"`

      - `"call.ended"`

      - `"call.failed"`

      - `"call.declined"`

      - `"call.no_answer"`

      - `"location.sharing.started"`

      - `"location.sharing.stopped"`

      - `"payment.succeeded"`

      - `"payment.canceled"`

      - `"payment.expired"`

      - `"payment.declined"`

      - `"payment.authorized"`

      - `"connection.created"`

      - `"connection.revoked"`

    - `target_url: string`

      URL where webhook events will be sent

    - `updated_at: string`

      When the subscription was last updated

    - `phone_numbers?: Array<string> | null`

      Phone numbers this subscription filters for. If null or empty, events from all phone numbers are delivered.

    - `routing_id_header?: string | null`

      Header carrying the chat id. Defaults to `Linq-Chat-Id` when affinity is on.

    - `routing_key_header?: string | null`

      Header carrying the routing token. Null disables delivery affinity.
