OpenMeter Notifications

Test notification rule

Changed on

Test a notification rule by generating an event with sample data and delivering it to the rule's channels. The test event is persisted and listed like any other event.

post/openmeter/notification/rules/{notificationRuleId}/test

Request

  • Base URL: http://localhost:8888/api/v3
  • URL: http://localhost:8888/api/v3/openmeter/notification/rules/{notificationRuleId}/test
  • Auth: none declared

Path parameters

notificationRuleIdstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

Example:01G65Z755AFWAKHE12NY0CQ9FH

Response

NotificationEvent created response.

idstring required

ULID (Universally Unique Lexicographically Sortable Identifier).

type'entitlements.balance.threshold' | 'entitlements.reset' | 'invoice.created' | 'invoice.updated' required

The type of a notification event. It determines which payload variant the event carries.

created_atstring date-time required

RFC3339 formatted date-time string in UTC.

Example response

{
  "id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "created_at": "2023-01-01T01:01:01.001Z",
  "rule": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH"
  },
  "delivery_status": [
    {
      "channel_id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "updated_at": "2023-01-01T01:01:01.001Z",
      "next_attempt": "2023-01-01T01:01:01.001Z",
      "attempts": [
        {
          "timestamp": "2023-01-01T01:01:01.001Z"
        }
      ]
    }
  ],
  "payload": {
    "id": "01G65Z755AFWAKHE12NY0CQ9FH",
    "timestamp": "2023-01-01T01:01:01.001Z",
    "data": {
      "entitlement_id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "feature": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH"
      },
      "customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
      "value": {
        "feature_key": "resource_key",
        "has_access": true,
        "config": "{ \"availableModels\": [\"gpt-5\", \"gpt-4o\"] }",
        "value": {
          "balance": "100",
          "usage": "50",
          "overage": "0",
          "total_available_grant_amount": "100",
          "grant_balances": {
            "additional_property": "1"
          }
        }
      }
    }
  }
}

Changes