Skip to main content
POST
/
v1
/
customer-alerts
/
list
Get all threshold notifications
curl --request POST \
  --url https://api.metronome.com/v1/customer-alerts/list \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1"
}
'
import requests

url = "https://api.metronome.com/v1/customer-alerts/list"

payload = { "customer_id": "9b85c1c1-5238-4f2a-a409-61412905e1e1" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: '9b85c1c1-5238-4f2a-a409-61412905e1e1'})
};

fetch('https://api.metronome.com/v1/customer-alerts/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/customer-alerts/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '9b85c1c1-5238-4f2a-a409-61412905e1e1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.metronome.com/v1/customer-alerts/list"

payload := strings.NewReader("{\n \"customer_id\": \"9b85c1c1-5238-4f2a-a409-61412905e1e1\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/customer-alerts/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"9b85c1c1-5238-4f2a-a409-61412905e1e1\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.metronome.com/v1/customer-alerts/list")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"9b85c1c1-5238-4f2a-a409-61412905e1e1\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "customer_status": "in_alarm",
      "alert": {
        "id": "8deed800-1b7a-495d-a207-6c52bac54dc9",
        "name": "Low credit balance alert",
        "uniqueness_key": "823j7fqzo1",
        "type": "low_credit_balance_reached",
        "status": "enabled",
        "credit_type": {
          "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
          "name": "USD (cents)"
        },
        "threshold": 0,
        "updated_at": "2022-01-01T00:00:00Z"
      }
    },
    {
      "customer_status": "ok",
      "alert": {
        "id": "3d45fdc3-e237-4acd-a7d9-ccfeb40e71b8",
        "name": "Spend threshold alert",
        "type": "spend_threshold_reached",
        "status": "enabled",
        "credit_type": {
          "id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",
          "name": "USD (cents)"
        },
        "threshold": 1000,
        "updated_at": "2022-01-01T00:00:00Z"
      }
    }
  ],
  "next_page": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

next_page
string

Cursor that indicates where the next page of results should start.

Body

application/json

The threshold notifications query to run

customer_id
string<uuid>
required

The Metronome ID of the customer

alert_statuses
enum<string>[]

Optionally filter by threshold notification status. If absent, only enabled notifications will be returned.

Minimum array length: 1
Available options:
enabled,
disabled,
archived,
ENABLED,
DISABLED,
ARCHIVED,
Enabled,
Disabled,
Archived

Response

200 - application/json

Success

data
object[]
required
next_page
string | null
required