---
title: "Create a budget alert"
method: POST
path: "/alerts/"
tags: ["Alert"]
---

# Create a budget alert

`POST /alerts/`

## Request

- Base URL: `https://api.your-domain.com`
- URL: `https://api.your-domain.com/alerts/`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/docs/alerts/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new budget alert with threshold and current spend.

## Query parameters

- `cookie_name` string, nullable
- `tenant_id` integer

## Request body

- BudgetAlertRequest: Payload for creating a budget alert.
  - `name` string, required: Name for the alert to be created. Max 100 characters.
  - `threshold_amount` number, required: Spend threshold that triggers the alert.

## Response `201`

Successful Response

- BudgetAlert: Saves the budget alerts.
  - `id` integer, nullable: Primary key for budget alerts.
  - `tenant_id` integer, required: ID of the tenant the budget alert belongs to.
  - `name` string: Name of the alert.
  - `threshold_amount` number: Budget threshold, for notification.
  - `current_spend` string: Total Spent. In decimal to have more accuracy
  - `triggered` boolean: If the alert is triggered or not
  - `active` boolean: If the alert is enabled
  - `created_at` string, date-time: Timestamp when the alert was created.
  - `updated_at` string, date-time: Timestamp when alert was updated.
  - `created_user_id` integer, required: ID of the user who made the LLM request.

## Other responses

- `401`: Missing or invalid authentication.
- `403`: Admin privileges required.
- `422`: Validation Error

---

[API](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api.md) - [All operations](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neulandai/apis/neuland-ai-hub-api/revisions/b53e89b98c2b?raw)
