Skip to main content
POST
/
usage-alerts
Create usage alert config
curl --request POST \
  --url https://api.sevalla.com/v3/usage-alerts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "limit_usd": 100,
  "emails": [
    "billing@example.com"
  ],
  "triggers": [
    {
      "percentage": 50
    },
    {
      "percentage": 80
    },
    {
      "percentage": 100
    }
  ],
  "project_id": null
}
'
{
  "id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "company_id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
  "project_id": null,
  "limit_usd": 100,
  "emails": [
    "billing@example.com"
  ],
  "triggers": [
    {
      "id": "fb5e5168-4281-4bec-94c5-0d1584e9e657",
      "percentage": 80,
      "last_fired_at": null
    }
  ],
  "created_at": "2025-01-30T00:00:00.000Z",
  "updated_at": "2025-01-30T00:00:00.000Z"
}

Documentation Index

Fetch the complete documentation index at: https://api-docs.sevalla.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Body

application/json
limit_usd
number
required

Spending limit in USD. Triggers fire as percentages of this value.

Required range: x >= 0.01
Example:

100

emails
string<email>[]
required

Email recipients notified when a trigger fires

Minimum array length: 1
Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Example:
["billing@example.com"]
triggers
object[]
required

Threshold percentages of the limit. Up to 10 triggers per config.

Required array length: 1 - 10 elements
Example:
[
{ "percentage": 50 },
{ "percentage": 80 },
{ "percentage": 100 }
]
project_id
string<uuid> | null

Project to scope the config to. Omit or pass null to create a company-wide config that tracks total spend across all projects.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

null

Response

Default Response

id
string<uuid>
required

Unique identifier for the usage alert config

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

company_id
string
required

Identifier of the company this config belongs to

Minimum string length: 1
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

project_id
string<uuid> | null
required

Identifier of the project this config is scoped to. When null, the config applies to total company spend across all projects.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

null

limit_usd
number
required

Spending limit in USD that triggers fire as percentages of. Must be greater than zero.

Required range: x >= 0.01
Example:

100

emails
string<email>[]
required

Email recipients notified when a trigger fires

Minimum array length: 1
Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Example:
["billing@example.com"]
triggers
object[]
required

Threshold percentages of the limit. The highest matching trigger fires once per billing period. Up to 10 triggers per config.

Required array length: 1 - 10 elements
created_at
string<date-time>
required

Timestamp when the config was created, in ISO 8601 format

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-01-30T00:00:00.000Z"

updated_at
string<date-time>
required

Timestamp when the config was last modified, in ISO 8601 format

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-01-30T00:00:00.000Z"