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

# Get Webhook Subscription Metrics

> Get delivery metrics for a webhook subscription.



## OpenAPI

````yaml https://api.catenatelematics.com/v2/notifications/openapi.json get /v2/notifications/webhooks/{webhook_id}/metrics
openapi: 3.1.0
info:
  title: Notifications Service - REST API
  description: Notifications Service REST API.
  version: 0.1.0
servers:
  - url: https://api.catenatelematics.com
    description: Catena Telematics API
security: []
tags:
  - name: Webhook Subscriptions
    description: >-
      Create and manage webhooks to subscribe to events and receive
      notifications when they occur.
  - name: Webhook Event Schemas
    description: Get the OpenAPI 3.0 schema for our versioned webhook events.
  - name: Webhook Events
    description: View available webhook events.
paths:
  /v2/notifications/webhooks/{webhook_id}/metrics:
    get:
      tags:
        - Webhook Subscriptions
      summary: Get Webhook Subscription Metrics
      description: Get delivery metrics for a webhook subscription.
      operationId: get_webhook_subscription_metrics
      parameters:
        - name: webhook_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Webhook Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookMetrics'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MethodNotAllowed'
          description: Method Not Allowed
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conflict'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntity'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
          description: Internal Server Error
      security:
        - Bearer:
            - webhook:read
components:
  schemas:
    WebhookMetrics:
      properties:
        webhook_id:
          type: string
          format: uuid
          title: Webhook ID
          description: The ID of the webhook that the metrics are for
        http_attempts:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: HTTP Attempts
          description: The total number of HTTP requests made (including retries)
        http_success_attempts:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: Successful HTTP Attempts
          description: The number of HTTP requests that received a 2xx response
        http_failure_attempts:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: Failed HTTP Attempts
          description: >-
            The number of HTTP requests that failed or received a non-2xx
            response
        message_count:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: Message Count
          description: >-
            The total number of unique messages/events processed (regardless of
            retries)
        message_success_count:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: Successful Messages
          description: >-
            The number of messages that were successfully delivered (after all
            retries)
        success_rate:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: Success Rate
          description: >-
            The success rate of the webhook. Only available if there are at
            least 200 messages
        avg_response_time_ms:
          $ref: '#/components/schemas/TimePeriodMetric'
          title: Average Response Time
          description: The average response time of the webhook
        ewma_success_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: EWMA Success Rate
          description: >-
            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:
          type: integer
          title: Dead Letter Queue Count
          description: >-
            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.
      type: object
      required:
        - webhook_id
        - http_attempts
        - http_success_attempts
        - http_failure_attempts
        - message_count
        - message_success_count
        - success_rate
        - avg_response_time_ms
        - ewma_success_rate
        - dlq_count
      title: WebhookMetrics
      description: >-
        Webhook Metrics model


        Intended to be calculated from the WebhookLogs table and not stored in
        the database.
      example:
        avg_response_time_ms:
          14d: 158
          24h: 160
          6h: 150
          7d: 155
        dlq_count: 5
        ewma_success_rate: 0.98
        http_attempts:
          14d: 6500
          24h: 420
          6h: 105
          7d: 3000
        http_failure_attempts:
          14d: 500
          24h: 20
          6h: 5
          7d: 200
        http_success_attempts:
          14d: 6000
          24h: 400
          6h: 100
          7d: 2800
        message_count:
          14d: 6000
          24h: 400
          6h: 100
          7d: 2800
        message_success_count:
          14d: 5800
          24h: 390
          6h: 98
          7d: 2700
        success_rate:
          14d: 96
          24h: 97
          6h: 98
          7d: 96
        webhook_id: 123e4567-e89b-12d3-a456-426614174000
    BadRequest:
      properties:
        code:
          type: integer
          title: Code
          default: 400
        message:
          type: string
          title: Message
          default: Bad Request
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: BadRequest
    Unauthorized:
      properties:
        code:
          type: integer
          title: Code
          default: 401
        message:
          type: string
          title: Message
          default: Unauthorized
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: Unauthorized
    Forbidden:
      properties:
        code:
          type: integer
          title: Code
          default: 403
        message:
          type: string
          title: Message
          default: Forbidden
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: Forbidden
    NotFound:
      properties:
        code:
          type: integer
          title: Code
          default: 404
        message:
          type: string
          title: Message
          default: Not Found
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: NotFound
    MethodNotAllowed:
      properties:
        code:
          type: integer
          title: Code
          default: 405
        message:
          type: string
          title: Message
          default: Method Not Allowed
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: MethodNotAllowed
    Conflict:
      properties:
        code:
          type: integer
          title: Code
          default: 409
        message:
          type: string
          title: Message
          default: Conflict
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: Conflict
    UnprocessableEntity:
      properties:
        code:
          type: integer
          title: Code
          default: 422
        message:
          type: string
          title: Message
          default: Invalid Request Body
        detail:
          anyOf:
            - items:
                $ref: '#/components/schemas/ValidationErrorDetail'
              type: array
            - type: 'null'
          title: Detail
      type: object
      title: UnprocessableEntity
    TooManyRequests:
      properties:
        code:
          type: integer
          title: Code
          default: 429
        message:
          type: string
          title: Message
          default: Too Many Requests
        detail:
          anyOf:
            - $ref: '#/components/schemas/RetryAfterDetail'
            - type: 'null'
      type: object
      title: TooManyRequests
    InternalServerError:
      properties:
        message:
          type: string
          title: Message
          default: Internal Server Error
      type: object
      title: InternalServerError
    TimePeriodMetric:
      properties:
        6h:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last 6 Hours
          description: Metric value for the last 6 hours
        24h:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last 24 Hours
          description: Metric value for the last 24 hours
        7d:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last 7 Days
          description: Metric value for the last 7 days
        14d:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last 14 Days
          description: Metric value for the last 14 days
      type: object
      required:
        - 6h
        - 24h
        - 7d
        - 14d
      title: TimePeriodMetric
      description: Webhook Metrics Success Rate model
      example:
        14d: 5600
        24h: 400
        6h: 100
        7d: 2800
    ValidationErrorDetail:
      properties:
        path:
          type: string
          title: Path
        input:
          type: string
          title: Input
        message:
          type: string
          title: Message
        error_type:
          type: string
          title: Error Type
      type: object
      required:
        - path
        - input
        - message
        - error_type
      title: ValidationErrorDetail
    RetryAfterDetail:
      properties:
        retry_after_seconds:
          type: integer
          title: Retry After Seconds
        message:
          type: string
          title: Message
      type: object
      required:
        - retry_after_seconds
        - message
      title: RetryAfterDetail
  securitySchemes:
    Bearer:
      type: oauth2
      flows:
        clientCredentials:
          refreshUrl: >-
            https://auth.catenatelematics.com/realms/catena/protocol/openid-connect/token
          scopes: {}
          tokenUrl: >-
            https://auth.catenatelematics.com/realms/catena/protocol/openid-connect/token
        authorizationCode:
          refreshUrl: >-
            https://auth.catenatelematics.com/realms/catena/protocol/openid-connect/token
          scopes: {}
          authorizationUrl: >-
            https://auth.catenatelematics.com/realms/catena/protocol/openid-connect/auth
          tokenUrl: >-
            https://auth.catenatelematics.com/realms/catena/protocol/openid-connect/token

````