Update a wallet alert
curl --request PUT \
--url https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alert": {
"code": "wallet_balance_alert",
"name": "Wallet Balance Alert",
"thresholds": [
{
"value": 99,
"code": "warn",
"recurring": false
}
]
}
}
'import requests
url = "https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}"
payload = { "alert": {
"code": "wallet_balance_alert",
"name": "Wallet Balance Alert",
"thresholds": [
{
"value": 99,
"code": "warn",
"recurring": False
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alert: {
code: 'wallet_balance_alert',
name: 'Wallet Balance Alert',
thresholds: [{value: 99, code: 'warn', recurring: false}]
}
})
};
fetch('https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}', 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.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'alert' => [
'code' => 'wallet_balance_alert',
'name' => 'Wallet Balance Alert',
'thresholds' => [
[
'value' => 99,
'code' => 'warn',
'recurring' => false
]
]
]
]),
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.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}"
payload := strings.NewReader("{\n \"alert\": {\n \"code\": \"wallet_balance_alert\",\n \"name\": \"Wallet Balance Alert\",\n \"thresholds\": [\n {\n \"value\": 99,\n \"code\": \"warn\",\n \"recurring\": false\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alert\": {\n \"code\": \"wallet_balance_alert\",\n \"name\": \"Wallet Balance Alert\",\n \"thresholds\": [\n {\n \"value\": 99,\n \"code\": \"warn\",\n \"recurring\": false\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alert\": {\n \"code\": \"wallet_balance_alert\",\n \"name\": \"Wallet Balance Alert\",\n \"thresholds\": [\n {\n \"value\": 99,\n \"code\": \"warn\",\n \"recurring\": false\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_subscription_id": null,
"billable_metric": null,
"alert_type": "wallet_balance_amount",
"code": "wallet_balance_alert",
"name": "Wallet Balance Alert",
"previous_value": 1000,
"last_processed_at": "2025-05-19T10:04:21Z",
"thresholds": [
{
"code": "warn",
"recurring": false,
"value": "99.0"
}
],
"created_at": "2025-03-20T10:00:00Z",
"lago_wallet_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"wallet_code": "wallet_code",
"direction": "decreasing"
}
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Wallet alerts
Update a wallet alert
This endpoint allows you to update an existing alert for a wallet.
PUT
/
customers
/
{external_customer_id}
/
wallets
/
{wallet_code}
/
alerts
/
{code}
Update a wallet alert
curl --request PUT \
--url https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alert": {
"code": "wallet_balance_alert",
"name": "Wallet Balance Alert",
"thresholds": [
{
"value": 99,
"code": "warn",
"recurring": false
}
]
}
}
'import requests
url = "https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}"
payload = { "alert": {
"code": "wallet_balance_alert",
"name": "Wallet Balance Alert",
"thresholds": [
{
"value": 99,
"code": "warn",
"recurring": False
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alert: {
code: 'wallet_balance_alert',
name: 'Wallet Balance Alert',
thresholds: [{value: 99, code: 'warn', recurring: false}]
}
})
};
fetch('https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}', 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.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'alert' => [
'code' => 'wallet_balance_alert',
'name' => 'Wallet Balance Alert',
'thresholds' => [
[
'value' => 99,
'code' => 'warn',
'recurring' => false
]
]
]
]),
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.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}"
payload := strings.NewReader("{\n \"alert\": {\n \"code\": \"wallet_balance_alert\",\n \"name\": \"Wallet Balance Alert\",\n \"thresholds\": [\n {\n \"value\": 99,\n \"code\": \"warn\",\n \"recurring\": false\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alert\": {\n \"code\": \"wallet_balance_alert\",\n \"name\": \"Wallet Balance Alert\",\n \"thresholds\": [\n {\n \"value\": 99,\n \"code\": \"warn\",\n \"recurring\": false\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v1/customers/{external_customer_id}/wallets/{wallet_code}/alerts/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alert\": {\n \"code\": \"wallet_balance_alert\",\n \"name\": \"Wallet Balance Alert\",\n \"thresholds\": [\n {\n \"value\": 99,\n \"code\": \"warn\",\n \"recurring\": false\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_subscription_id": null,
"billable_metric": null,
"alert_type": "wallet_balance_amount",
"code": "wallet_balance_alert",
"name": "Wallet Balance Alert",
"previous_value": 1000,
"last_processed_at": "2025-05-19T10:04:21Z",
"thresholds": [
{
"code": "warn",
"recurring": false,
"value": "99.0"
}
],
"created_at": "2025-03-20T10:00:00Z",
"lago_wallet_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"wallet_code": "wallet_code",
"direction": "decreasing"
}
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The customer external unique identifier (provided by your own application)
Example:
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
A unique wallet identifier within a customer. It is either set by the user at creation or auto-generated by Lago if not provided.
Example:
"wallet-code"
Unique code of the alert
Example:
"balance_threshold_alert"
Body
application/json
Update an existing alert for a wallet
Show child attributes
Show child attributes
Response
Wallet alert updated
Show child attributes
Show child attributes
Was this page helpful?
⌘I