---
title: "Get a webhook subscription"
description: "Returns one of your webhook subscriptions."
version: "v2"
---

> Documentation Index
> Fetch the complete documentation index at: https://dev.messageport.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

Path: MessagePort API › Webhook subscriptions

`GET /v2/webhook-subscriptions/{webhookSubscription}`

Returns one of your webhook subscriptions.

## Authentication

- `basicAuth`, http, header `Authorization`

## Path parameters

- `webhookSubscription` (`getWebhookSubscription.path.webhookSubscription`; integer, required) — Webhook subscription ID.

## Code samples

### cURL

```bash
curl --request GET \
  --url https://app.messageport.com.au/api/v2/webhook-subscriptions/123 \
  --header 'Authorization: Basic <credentials>'
```

### TypeScript

```typescript
const url = 'https://app.messageport.com.au/api/v2/webhook-subscriptions/123';
const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.messageport.com.au/api/v2/webhook-subscriptions/123"

headers = {"Authorization": "Basic <credentials>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The subscription.

#### Example

```json
{
  "data": {
    "id": 123,
    "status": "Active",
    "event": "message_received",
    "include_sent_status": false,
    "name": "Inbound to CRM",
    "url": "https://example.com/hooks/inbound",
    "request_method": "POST",
    "request_encoding_type": "json",
    "headers": [
      {
        "key": "X-Api-Key",
        "value": "abc123"
      }
    ],
    "created_at": "2024-02-02T23:51:19Z",
    "updated_at": "2024-03-11T02:14:07Z"
  }
}
```

- `data` (`getWebhookSubscription.response.200.data`; object, optional)
  - example `{"id":123,"status":"Active","event":"message_received","include_sent_status":false,"name":"Inbound to CRM","url":"https://example.com/hooks/inbound","request_method":"POST","request_encoding_type":"json","headers":[{"key":"X-Api-Key","value":"abc123"}],"created_at":"2024-02-02T23:51:19Z","updated_at":"2024-03-11T02:14:07Z"}`
  - `id` (`getWebhookSubscription.response.200.data.id`; integer, optional)
  - `status` (`getWebhookSubscription.response.200.data.status`; string, optional) — `Disabled Failing` means the subscription was disabled automatically after repeated delivery failures and receives no events until re-enabled.
    - one of `"Active"`, `"Disabled"`, `"Disabled Failing"`
  - `event` (`getWebhookSubscription.response.200.data.event`; string, optional) — - `message_received`: an inbound message was received. - `message_dlr`: a delivery receipt was received for an outbound message. - `optout_created`: a number opted out. - `message_received_3cx`: an inbound message, formatted for 3CX.
    - one of `"message_received"`, `"message_dlr"`, `"optout_created"`, `"message_received_3cx"`
  - `include_sent_status` (`getWebhookSubscription.response.200.data.include_sent_status`; boolean, optional) — Whether a `message_dlr` subscription also receives `sent` receipts. Always `false` for other events.
  - `name` (`getWebhookSubscription.response.200.data.name`; string, optional)
  - `url` (`getWebhookSubscription.response.200.data.url`; string, optional)
    - format `uri`
  - `request_method` (`getWebhookSubscription.response.200.data.request_method`; string, optional)
    - one of `"POST"`, `"GET"`
  - `request_encoding_type` (`getWebhookSubscription.response.200.data.request_encoding_type`; string | null, optional)
    - one of `"json"`, `"form"`, `null`
  - `headers` (`getWebhookSubscription.response.200.data.headers`; array<object>, optional)
    - `key` (`getWebhookSubscription.response.200.data.headers.key`; string, required) — A valid HTTP header name.
      - minLength 3; maxLength 50
    - `value` (`getWebhookSubscription.response.200.data.headers.value`; string, required)
      - minLength 3; maxLength 200
  - `created_at` (`getWebhookSubscription.response.200.data.created_at`; string, optional)
    - format `date-time`
  - `updated_at` (`getWebhookSubscription.response.200.data.updated_at`; string, optional)
    - format `date-time`

### 401

Missing, malformed or invalid API credentials.

#### Example

```json
{
  "message": "Unauthenticated."
}
```

- `message` (`getWebhookSubscription.response.401.message`; string, required)

### 403

The resource exists but does not belong to you, or you lack permission.

#### Example

```json
{
  "message": "This action is unauthorized."
}
```

- `message` (`getWebhookSubscription.response.403.message`; string, required)

### 404

The resource does not exist.

#### Example

```json
{
  "message": "Not Found"
}
```

- `message` (`getWebhookSubscription.response.404.message`; string, required)


Source: https://dev.messageport.com.au/api/webhook-subscriptions/get/index.md
