Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Retrieve

Get an alert
v1.customers.alerts.retrieve(**kwargs) -> dataCustomerAlertAlertRetrieveResponse
post/v1/customer-alerts/get

Get the customer alert status and alert information for the specified customer and alert

Parameters
alert_idString

The Metronome ID of the alert

formatuuid
customer_idString

The Metronome ID of the customer

formatuuid
plans_or_contractsunion
optional
:PLANS | :CONTRACTS

When parallel alerts are enabled during migration, this flag denotes whether to fetch alerts for plans or contracts.

Hide ParametersShow Parameters
:PLANS
:CONTRACTS
Returns
AlertRetrieveResponseclass
Hide ParametersShow Parameters
dataalertobjectcustomer_statusuniontriggered_byStringCustomerAlert
require "metronome_sdk"

metronome = MetronomeSDK::Client.new(bearer_token: "My Bearer Token")

alert = metronome.v1.customers.alerts.retrieve(
  alert_id: "8deed800-1b7a-495d-a207-6c52bac54dc9",
  customer_id: "9b85c1c1-5238-4f2a-a409-61412905e1e1"
)

puts(alert)
200 Example
{
  "data": {
    "alert": {
      "id": "id",
      "name": "name",
      "status": "enabled",
      "threshold": 0,
      "type": "low_credit_balance_reached",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "credit_grant_type_filters": [
        "string"
      ],
      "credit_type": {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "name": "name"
      },
      "custom_field_filters": [
        {
          "entity": "Contract",
          "key": "key",
          "value": "value"
        }
      ],
      "group_key_filter": {
        "key": "key",
        "value": "value"
      },
      "group_values": [
        {
          "key": "key",
          "value": "value"
        }
      ],
      "invoice_types_filter": [
        "PLAN_ARREARS, SCHEDULED, USAGE, CORRECTION, CREDIT_PURCHASE, or SEAT_PURCHASE"
      ],
      "uniqueness_key": "x"
    },
    "customer_status": "ok",
    "triggered_by": "triggered_by"
  }
}