Cost Thresholds

Set a cost threshold

Sets what one person may spend per month on a usage type: for the organization, for a team (teamId), or for one user (userId). A new amount replaces the scope's current one on that usage type.

VOICE is international calling: once a user's spend reaches the threshold, international calls and SMS on their lines are paused until the next month, where their market offers the pause; elsewhere the threshold warns only. Other usage types answer 422 until the platform can enforce them.

The amount is in the team's cost-center currency, else the organization's primary; read it back from the response. The threshold opens now, so this month's spend counts against it at once, unless someone in scope has already spent more than the new amount: then it opens next month and appliesFromNextMonth says so. Raising it above a paused user's spend lifts their pause in the same call.

Scope: policies:write, and teams:read when a team is named.

put/v1/cost-thresholds

Request

  • Base URL
    https://api.telgea.com
  • Auth
    API key in header x-api-key

Headers

idempotency-keystring

A value unique to this request, of 1 to 255 printable ASCII characters — a UUID is the usual choice. Retry with the same key within 24 hours and you get the original response back, even if it was a failure, and nothing is done twice. Send a new key whenever you change the request. Keys are private to your API key and organisation.

Example:0b7e4f1c-6a2d-4c9e-8f35-d1a7b2c93e60

Request body

usageType'DATA' | 'VOICE' | 'SMS' | 'MMS' required

The usage type the threshold is on. VOICE is international calling: reaching it pauses international calls and SMS on the person's lines, where their market offers the pause. Other types answer 422 until the platform can enforce them.

teamIdstring uuid

UUID of the team the threshold is for. Omit with userId for the organization's own.

userIdstring uuid

UUID of the user the threshold is for. Omit with teamId for the organization's own.

maxAmountnumber required

What one person may spend on the usage type per month, at most two decimals.

Example request

{
  "usageType": "VOICE",
  "teamId": "2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70",
  "userId": "9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01",
  "maxAmount": 50
}

Response

The threshold as written, and what it did on the way in.

appliesFromNextMonthboolean required

True when someone in scope has already spent more than the new amount this month, so it opens next month rather than now.

releasedNumberCountinteger required

Lines whose pause was lifted because the raised amount put their user back under it.

Example response

{
  "threshold": {
    "id": "5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e",
    "usageType": "VOICE",
    "scope": "team",
    "teamId": "2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70",
    "maxAmount": 50,
    "currency": "EUR",
    "period": "monthly",
    "validFrom": "2026-10-01T00:00:00.000Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.