> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://catena.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://catena.ferndocs.com/_mcp/server.

# Get Webhook Subscription Metrics

GET https://api.catenatelematics.com/v2/notifications/webhooks/{webhook_id}/metrics

Get delivery metrics for a webhook subscription.

Reference: https://catena.ferndocs.com/api-reference/notifications/webhook-subscriptions/get-webhook-subscription-metrics

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `webhook_id` (string, required)

## Response

### 200

Successful Response

- `webhook_id` (string, required) — The ID of the webhook that the metrics are for
- `http_attempts` (TimePeriodMetric, required) — The total number of HTTP requests made (including retries)
- `http_success_attempts` (TimePeriodMetric, required) — The number of HTTP requests that received a 2xx response
- `http_failure_attempts` (TimePeriodMetric, required) — The number of HTTP requests that failed or received a non-2xx response
- `message_count` (TimePeriodMetric, required) — The total number of unique messages/events processed (regardless of retries)
- `message_success_count` (TimePeriodMetric, required) — The number of messages that were successfully delivered (after all retries)
- `success_rate` (TimePeriodMetric, required) — The success rate of the webhook. Only available if there are at least 200 messages
- `avg_response_time_ms` (TimePeriodMetric, required) — The average response time of the webhook
- `ewma_success_rate` (double, required, nullable) — The exponentially weighted moving average success rate of the webhook. If lower than 0.95, the webhook is considered unhealthy and marked as `stale`.
- `dlq_count` (integer, required) — The number of messages that failed to be delivered, and were put in the DLQ. Messages are stored for 14 days and must be replayed manually.

## Errors

### 400 Bad Request Error

Bad Request

- `code` (integer, optional, default: 400)
- `message` (string, optional, default: Bad Request)
- `detail` (string, optional, nullable)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, optional, default: 401)
- `message` (string, optional, default: Unauthorized)
- `detail` (string, optional, nullable)

### 403 Forbidden Error

Forbidden

- `code` (integer, optional, default: 403)
- `message` (string, optional, default: Forbidden)
- `detail` (string, optional, nullable)

### 404 Not Found Error

Not Found

- `code` (integer, optional, default: 404)
- `message` (string, optional, default: Not Found)
- `detail` (string, optional, nullable)

### 405 Method Not Allowed Error

Method Not Allowed

- `code` (integer, optional, default: 405)
- `message` (string, optional, default: Method Not Allowed)
- `detail` (string, optional, nullable)

### 409 Conflict Error

Conflict

- `code` (integer, optional, default: 409)
- `message` (string, optional, default: Conflict)
- `detail` (string, optional, nullable)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `code` (integer, optional, default: 422)
- `message` (string, optional, default: Invalid Request Body)
- `detail` (list of ValidationErrorDetail, optional, nullable)

### 429 Too Many Requests Error

Too Many Requests

- `code` (integer, optional, default: 429)
- `message` (string, optional, default: Too Many Requests)
- `detail` (RetryAfterDetail, optional, nullable)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional, default: Internal Server Error)

## Types

### TimePeriodMetric

Webhook Metrics Success Rate model

- `6h` (integer, required, nullable) — Metric value for the last 6 hours
- `24h` (integer, required, nullable) — Metric value for the last 24 hours
- `7d` (integer, required, nullable) — Metric value for the last 7 days
- `14d` (integer, required, nullable) — Metric value for the last 14 days

### ValidationErrorDetail

- `path` (string, required)
- `input` (string, required)
- `message` (string, required)
- `error_type` (string, required)

### RetryAfterDetail

- `retry_after_seconds` (integer, required)
- `message` (string, required)

## Examples

**Response**

```json
{
  "webhook_id": "123e4567-e89b-12d3-a456-426614174000",
  "http_attempts": {
    "6h": 105,
    "24h": 420,
    "7d": 3000,
    "14d": 6500
  },
  "http_success_attempts": {
    "6h": 100,
    "24h": 400,
    "7d": 2800,
    "14d": 6000
  },
  "http_failure_attempts": {
    "6h": 5,
    "24h": 20,
    "7d": 200,
    "14d": 500
  },
  "message_count": {
    "6h": 100,
    "24h": 400,
    "7d": 2800,
    "14d": 6000
  },
  "message_success_count": {
    "6h": 98,
    "24h": 390,
    "7d": 2700,
    "14d": 5800
  },
  "success_rate": {
    "6h": 98,
    "24h": 97,
    "7d": 96,
    "14d": 96
  },
  "avg_response_time_ms": {
    "6h": 150,
    "24h": 160,
    "7d": 155,
    "14d": 158
  },
  "ewma_success_rate": 0.98,
  "dlq_count": 5
}
```

**SDK Code**

```python
import requests

url = "https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.catenatelematics.com/v2/notifications/webhooks/webhook_id/metrics")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```