Skip to content

Comments

feat(alerting): Add subscriptions alerts API#367

Open
vankiru wants to merge 3 commits intofeat/move-wallets-api-to-customer-walletsfrom
feat/add-subscriptions-alerts
Open

feat(alerting): Add subscriptions alerts API#367
vankiru wants to merge 3 commits intofeat/move-wallets-api-to-customer-walletsfrom
feat/add-subscriptions-alerts

Conversation

@vankiru
Copy link
Contributor

@vankiru vankiru commented Feb 11, 2026

Context

The PR implements missing api for subscription alerts. It relies on the implementation of Nested Commands introduced in #366.

Related PR: getlago/lago-api#4925

Description

The wallet alerts API looks like this 👇

# GET /subscriptions/:subscription_id/alerts
client.subscriptions.alerts.get_all(subscription_id)
client.subscriptions.alerts.get_all(subscription_id, options={"page": 1, "per_page": 100})

# POST /subscriptions/:subscription_id/alerts
client.subscriptions.alerts.create(subscription_id, params)

# GET /subscriptions/:subscription_id/alerts/:alert_code
client.subscriptions.alerts.get(subscription_id, alert_code)

# PATCH /subscriptions/:subscription_id/alerts/:alert_code
client.subscriptions.alerts.update(subscription_id, alert_code, params)

# DELETE /subscriptions/:subscription_id/alerts/:alert_code
client.subscriptions.alerts.destroy(subscription_id, alert_code)

@vankiru vankiru changed the base branch from main to feat/move-wallets-api-to-customer-wallets February 11, 2026 16:42
@vankiru vankiru changed the title feat(alerting): Add wallet alerts API feat(alerting): Add subscriptions alerts API Feb 11, 2026
Copy link
Contributor

@annvelents annvelents left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked all the values for Alerts for both: you and me and updated my model to include values that you have. The only difference we have now is Alert vs AlertInput



class Alert(BaseModel):
alert_type: Optional[str]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot be null due to validation on the DB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the input classes are just called {Model} without Input suffix, so I kept the same naming for alerts as well 😊

I initially marked everything as optional in the model definitions since that's how most of the other models are set up 🤔 But I've updated the alerts model to require the fields you mentioned.


class Alert(BaseModel):
alert_type: Optional[str]
code: Optional[str]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot be null also

alert_type: Optional[str]
code: Optional[str]
name: Optional[str]
thresholds: Optional[AlertThresholdList]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thresholds should be provided - required by the service


class AlertThreshold(BaseModel):
code: Optional[str]
value: Optional[str]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value cannot be null 🙈



class AlertThresholdResponse(BaseResponseModel):
code: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one IS optional 😅

@vankiru vankiru force-pushed the feat/add-subscriptions-alerts branch from a45c8d2 to 3f12610 Compare February 12, 2026 11:54
@vankiru vankiru marked this pull request as ready for review February 12, 2026 12:05
@vankiru vankiru force-pushed the feat/move-wallets-api-to-customer-wallets branch from 6196069 to f834aad Compare February 17, 2026 09:49
@vankiru vankiru force-pushed the feat/add-subscriptions-alerts branch from 3f12610 to 041ee4e Compare February 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants