# Webhooks

## Get webhooks

**get** `/api/account/webhooks`

Get webhooks configured for the authenticated account.

With a line-scoped temporary bearer token, this returns receive webhooks for the token's phone numbers.

### Returns

- `status: optional string`

- `webhooks: optional object { call_completed, call_log, contact_created, 8 more }`

  - `call_completed: optional array of string or WebhookConfiguration`

    Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

      - `url: string`

        Webhook endpoint URL for receiving callbacks

      - `secret: optional string`

        Secret for webhook signature verification

      - `sendblue_numbers: optional array of string`

        Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

  - `call_log: optional array of string or WebhookConfiguration`

    Webhooks for call log events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_created: optional array of string or WebhookConfiguration`

    Webhooks for contact created events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_profile: optional array of string or WebhookConfiguration`

    Webhooks for durable contact-profile publication completion and failure events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `globalSecret: optional string`

    Global secret applied to all webhooks

  - `inbound_call: optional array of string or WebhookConfiguration`

    Webhooks for inbound call events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_assigned: optional array of string or WebhookConfiguration`

    Webhooks for line assigned events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_blocked: optional array of string or WebhookConfiguration`

    Webhooks for line blocked events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `outbound: optional array of string or WebhookConfiguration`

    Webhooks for outbound message status updates

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `receive: optional array of string or WebhookConfiguration`

    Webhooks for inbound message events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `typing_indicator: optional array of string or WebhookConfiguration`

    Webhooks for typing indicator events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Example

```http
curl https://api.sendblue.co/api/account/webhooks \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET"
```

#### Response

```json
{
  "status": "OK",
  "webhooks": {
    "call_completed": [
      "https://example.com"
    ],
    "call_log": [
      "https://example.com"
    ],
    "contact_created": [
      "https://example.com"
    ],
    "contact_profile": [
      "https://example.com"
    ],
    "globalSecret": "whsec_global123",
    "inbound_call": [
      "https://example.com"
    ],
    "line_assigned": [
      "https://example.com"
    ],
    "line_blocked": [
      "https://example.com"
    ],
    "outbound": [
      "https://example.com"
    ],
    "receive": [
      "https://example.com"
    ],
    "typing_indicator": [
      "https://example.com"
    ]
  }
}
```

## Add webhooks

**post** `/api/account/webhooks`

Add new webhooks to the account. Webhooks are appended to existing ones.

With a line-scoped temporary bearer token, only receive webhooks can be added. String webhook URLs are
automatically scoped to the token's phone numbers; webhook objects must use `sendblue_numbers` within
the token's allowed phone numbers.

### Body Parameters

- `webhooks: array of string or WebhookConfiguration`

  Array of webhook URLs or webhook objects

  - `string`

  - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `url: string`

      Webhook endpoint URL for receiving callbacks

    - `secret: optional string`

      Secret for webhook signature verification

    - `sendblue_numbers: optional array of string`

      Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

- `globalSecret: optional string`

  Global secret for webhook signature verification

- `type: optional "receive" or "line_blocked" or "line_assigned" or 7 more`

  Type of webhook to add

  - `"receive"`

  - `"line_blocked"`

  - `"line_assigned"`

  - `"outbound"`

  - `"typing_indicator"`

  - `"call_log"`

  - `"call_completed"`

  - `"inbound_call"`

  - `"contact_profile"`

  - `"contact_created"`

### Returns

- `message: optional string`

- `status: optional string`

- `webhooks: optional object { call_completed, call_log, contact_created, 8 more }`

  - `call_completed: optional array of string or WebhookConfiguration`

    Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

      - `url: string`

        Webhook endpoint URL for receiving callbacks

      - `secret: optional string`

        Secret for webhook signature verification

      - `sendblue_numbers: optional array of string`

        Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

  - `call_log: optional array of string or WebhookConfiguration`

    Webhooks for call log events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_created: optional array of string or WebhookConfiguration`

    Webhooks for contact created events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_profile: optional array of string or WebhookConfiguration`

    Webhooks for durable contact-profile publication completion and failure events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `globalSecret: optional string`

    Global secret applied to all webhooks

  - `inbound_call: optional array of string or WebhookConfiguration`

    Webhooks for inbound call events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_assigned: optional array of string or WebhookConfiguration`

    Webhooks for line assigned events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_blocked: optional array of string or WebhookConfiguration`

    Webhooks for line blocked events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `outbound: optional array of string or WebhookConfiguration`

    Webhooks for outbound message status updates

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `receive: optional array of string or WebhookConfiguration`

    Webhooks for inbound message events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `typing_indicator: optional array of string or WebhookConfiguration`

    Webhooks for typing indicator events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Example

```http
curl https://api.sendblue.co/api/account/webhooks \
    -H 'Content-Type: application/json' \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET" \
    -d '{
          "webhooks": [
            "https://example.com"
          ]
        }'
```

#### Response

```json
{
  "message": "Webhooks added successfully",
  "status": "OK",
  "webhooks": {
    "call_completed": [
      "https://example.com"
    ],
    "call_log": [
      "https://example.com"
    ],
    "contact_created": [
      "https://example.com"
    ],
    "contact_profile": [
      "https://example.com"
    ],
    "globalSecret": "whsec_global123",
    "inbound_call": [
      "https://example.com"
    ],
    "line_assigned": [
      "https://example.com"
    ],
    "line_blocked": [
      "https://example.com"
    ],
    "outbound": [
      "https://example.com"
    ],
    "receive": [
      "https://example.com"
    ],
    "typing_indicator": [
      "https://example.com"
    ]
  }
}
```

## Replace webhooks

**put** `/api/account/webhooks`

Replace all webhooks for the account. This overwrites existing webhooks.

### Body Parameters

- `webhooks: object { call_completed, call_log, contact_created, 8 more }`

  - `call_completed: optional array of string or WebhookConfiguration`

    Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

      - `url: string`

        Webhook endpoint URL for receiving callbacks

      - `secret: optional string`

        Secret for webhook signature verification

      - `sendblue_numbers: optional array of string`

        Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

  - `call_log: optional array of string or WebhookConfiguration`

    Webhooks for call log events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_created: optional array of string or WebhookConfiguration`

    Webhooks for contact created events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_profile: optional array of string or WebhookConfiguration`

    Webhooks for durable contact-profile publication completion and failure events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `globalSecret: optional string`

    Global secret applied to all webhooks

  - `inbound_call: optional array of string or WebhookConfiguration`

    Webhooks for inbound call events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_assigned: optional array of string or WebhookConfiguration`

    Webhooks for line assigned events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_blocked: optional array of string or WebhookConfiguration`

    Webhooks for line blocked events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `outbound: optional array of string or WebhookConfiguration`

    Webhooks for outbound message status updates

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `receive: optional array of string or WebhookConfiguration`

    Webhooks for inbound message events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `typing_indicator: optional array of string or WebhookConfiguration`

    Webhooks for typing indicator events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Returns

- `message: optional string`

- `status: optional string`

- `webhooks: optional object { call_completed, call_log, contact_created, 8 more }`

  - `call_completed: optional array of string or WebhookConfiguration`

    Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

      - `url: string`

        Webhook endpoint URL for receiving callbacks

      - `secret: optional string`

        Secret for webhook signature verification

      - `sendblue_numbers: optional array of string`

        Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

  - `call_log: optional array of string or WebhookConfiguration`

    Webhooks for call log events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_created: optional array of string or WebhookConfiguration`

    Webhooks for contact created events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `contact_profile: optional array of string or WebhookConfiguration`

    Webhooks for durable contact-profile publication completion and failure events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `globalSecret: optional string`

    Global secret applied to all webhooks

  - `inbound_call: optional array of string or WebhookConfiguration`

    Webhooks for inbound call events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_assigned: optional array of string or WebhookConfiguration`

    Webhooks for line assigned events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `line_blocked: optional array of string or WebhookConfiguration`

    Webhooks for line blocked events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `outbound: optional array of string or WebhookConfiguration`

    Webhooks for outbound message status updates

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `receive: optional array of string or WebhookConfiguration`

    Webhooks for inbound message events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `typing_indicator: optional array of string or WebhookConfiguration`

    Webhooks for typing indicator events

    - `string`

    - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Example

```http
curl https://api.sendblue.co/api/account/webhooks \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET" \
    -d '{
          "webhooks": {}
        }'
```

#### Response

```json
{
  "message": "Webhooks updated successfully",
  "status": "OK",
  "webhooks": {
    "call_completed": [
      "https://example.com"
    ],
    "call_log": [
      "https://example.com"
    ],
    "contact_created": [
      "https://example.com"
    ],
    "contact_profile": [
      "https://example.com"
    ],
    "globalSecret": "whsec_global123",
    "inbound_call": [
      "https://example.com"
    ],
    "line_assigned": [
      "https://example.com"
    ],
    "line_blocked": [
      "https://example.com"
    ],
    "outbound": [
      "https://example.com"
    ],
    "receive": [
      "https://example.com"
    ],
    "typing_indicator": [
      "https://example.com"
    ]
  }
}
```

## Delete webhooks

**delete** `/api/account/webhooks`

Delete specific webhooks from the account.

With a line-scoped temporary bearer token, this can only remove receive webhooks for the token's phone
numbers.

### Body Parameters

- `webhooks: array of string`

  Array of webhook URLs to delete

- `type: optional "receive" or "line_blocked" or "line_assigned" or 7 more`

  Type of webhook to delete from

  - `"receive"`

  - `"line_blocked"`

  - `"line_assigned"`

  - `"outbound"`

  - `"typing_indicator"`

  - `"call_log"`

  - `"call_completed"`

  - `"inbound_call"`

  - `"contact_profile"`

  - `"contact_created"`

### Returns

- `message: optional string`

- `status: optional string`

### Example

```http
curl https://api.sendblue.co/api/account/webhooks \
    -X DELETE \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET"
```

#### Response

```json
{
  "message": "Webhooks deleted successfully",
  "status": "OK"
}
```

## Domain Types

### Webhook Configuration

- `WebhookConfiguration object { url, secret, sendblue_numbers }`

  - `url: string`

    Webhook endpoint URL for receiving callbacks

  - `secret: optional string`

    Secret for webhook signature verification

  - `sendblue_numbers: optional array of string`

    Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

### Webhook List Response

- `WebhookListResponse object { status, webhooks }`

  - `status: optional string`

  - `webhooks: optional object { call_completed, call_log, contact_created, 8 more }`

    - `call_completed: optional array of string or WebhookConfiguration`

      Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

        - `url: string`

          Webhook endpoint URL for receiving callbacks

        - `secret: optional string`

          Secret for webhook signature verification

        - `sendblue_numbers: optional array of string`

          Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

    - `call_log: optional array of string or WebhookConfiguration`

      Webhooks for call log events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `contact_created: optional array of string or WebhookConfiguration`

      Webhooks for contact created events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `contact_profile: optional array of string or WebhookConfiguration`

      Webhooks for durable contact-profile publication completion and failure events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `globalSecret: optional string`

      Global secret applied to all webhooks

    - `inbound_call: optional array of string or WebhookConfiguration`

      Webhooks for inbound call events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `line_assigned: optional array of string or WebhookConfiguration`

      Webhooks for line assigned events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `line_blocked: optional array of string or WebhookConfiguration`

      Webhooks for line blocked events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `outbound: optional array of string or WebhookConfiguration`

      Webhooks for outbound message status updates

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `receive: optional array of string or WebhookConfiguration`

      Webhooks for inbound message events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `typing_indicator: optional array of string or WebhookConfiguration`

      Webhooks for typing indicator events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Webhook Create Response

- `WebhookCreateResponse object { message, status, webhooks }`

  - `message: optional string`

  - `status: optional string`

  - `webhooks: optional object { call_completed, call_log, contact_created, 8 more }`

    - `call_completed: optional array of string or WebhookConfiguration`

      Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

        - `url: string`

          Webhook endpoint URL for receiving callbacks

        - `secret: optional string`

          Secret for webhook signature verification

        - `sendblue_numbers: optional array of string`

          Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

    - `call_log: optional array of string or WebhookConfiguration`

      Webhooks for call log events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `contact_created: optional array of string or WebhookConfiguration`

      Webhooks for contact created events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `contact_profile: optional array of string or WebhookConfiguration`

      Webhooks for durable contact-profile publication completion and failure events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `globalSecret: optional string`

      Global secret applied to all webhooks

    - `inbound_call: optional array of string or WebhookConfiguration`

      Webhooks for inbound call events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `line_assigned: optional array of string or WebhookConfiguration`

      Webhooks for line assigned events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `line_blocked: optional array of string or WebhookConfiguration`

      Webhooks for line blocked events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `outbound: optional array of string or WebhookConfiguration`

      Webhooks for outbound message status updates

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `receive: optional array of string or WebhookConfiguration`

      Webhooks for inbound message events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `typing_indicator: optional array of string or WebhookConfiguration`

      Webhooks for typing indicator events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Webhook Update Response

- `WebhookUpdateResponse object { message, status, webhooks }`

  - `message: optional string`

  - `status: optional string`

  - `webhooks: optional object { call_completed, call_log, contact_created, 8 more }`

    - `call_completed: optional array of string or WebhookConfiguration`

      Webhooks fired once per call when its recording and transcript are final (deduplicate on call_id)

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

        - `url: string`

          Webhook endpoint URL for receiving callbacks

        - `secret: optional string`

          Secret for webhook signature verification

        - `sendblue_numbers: optional array of string`

          Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

    - `call_log: optional array of string or WebhookConfiguration`

      Webhooks for call log events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `contact_created: optional array of string or WebhookConfiguration`

      Webhooks for contact created events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `contact_profile: optional array of string or WebhookConfiguration`

      Webhooks for durable contact-profile publication completion and failure events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `globalSecret: optional string`

      Global secret applied to all webhooks

    - `inbound_call: optional array of string or WebhookConfiguration`

      Webhooks for inbound call events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `line_assigned: optional array of string or WebhookConfiguration`

      Webhooks for line assigned events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `line_blocked: optional array of string or WebhookConfiguration`

      Webhooks for line blocked events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `outbound: optional array of string or WebhookConfiguration`

      Webhooks for outbound message status updates

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `receive: optional array of string or WebhookConfiguration`

      Webhooks for inbound message events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

    - `typing_indicator: optional array of string or WebhookConfiguration`

      Webhooks for typing indicator events

      - `string`

      - `WebhookConfiguration object { url, secret, sendblue_numbers }`

### Webhook Delete Response

- `WebhookDeleteResponse object { message, status }`

  - `message: optional string`

  - `status: optional string`
