TelgeaDevelopers

Cost thresholds

What people may spend per month on a usage type, such as international calls, before it is paused: set per organization, team or user, and read back with each user's spend.

The cost threshold object

What people may spend per month on a usage type, such as international calls, before it is paused.

FieldTypeDescription
idrequiredstringUUID of the threshold.
5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e
usageTyperequiredenum
DATAVOICESMSMMS
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.
VOICE
scoperequiredenum
organizationteamuser
Whose threshold this is: the organization's default, a team's, or one user's own.
team
teamIdrequiredstringThe team, for a team threshold.
2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70
userIdrequiredstringThe user, for a user threshold.
null
maxAmountrequirednumberWhat one person may spend on the usage type per month, in `currency`.
50
currencyrequiredstringISO 4217 code of the threshold's money: the team's cost-center currency, else the organization's primary.
EUR
periodrequiredenum
monthly
The period the spend is counted in. Always the calendar month.
monthly
validFromrequiredstringWhen the threshold opens (ISO 8601). A threshold lowered below someone's spend opens next month.
2026-10-01T00:00:00.000Z
validTorequiredstringWhen the threshold closes (ISO 8601), or null while it stands.
null

Operations

List cost thresholds

GET/v1/cost-thresholds
Enterprise APIPartner API

Lists what people in your organization may spend per month on a usage type: the organization's own threshold; with teamId, that team's own and the own thresholds of the people in it; with userId, that user's own. A threshold that opens next month is listed with its validFrom in the future. Omit usageType for every type.

A team or user of another organization answers 404; a usage type nothing can enforce yet answers 422. A user falls under their own threshold, else their team's, else the organization's. To see which one a user is under, with their spend this month, use GET /v1/users/{userId}/cost-thresholds/{usageType}.

currency is the money a threshold written for the named team or user would carry: their cost-center currency, else the organization's primary.

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

Requires the permission policies:read on the key.

Try it in the playground → Calls run against your live organization; there is no sandbox.

Parameters

ParameterInTypeDescription
usageTypequeryenumThe 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.
VOICE
teamIdquerystring (uuid)UUID of the team the threshold is for. Omit with `userId` for the organization's own.
2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70
userIdquerystring (uuid)UUID of the user the threshold is for. Omit with `teamId` for the organization's own.
9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01

Responses

StatusMeaningBody
200The thresholds in force or opening next month.ListCostThresholdsResponse
400Request failed schema validation, or named both a team and a usernone
401Missing or invalid API key in the X-API-Key headerUnauthorizedError
403Insufficient permissions to view policiesForbiddenError
404No team in your organization has this id, so nothing was read or changed. No user in your organization has this id, so nothing was read or changed.NotFoundError
422No threshold can stand on this usage type yet, so nothing was read or changed.UnprocessableEntityError
429The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets.TooManyRequestsError
500Internal server error. Contact support if this persists.InternalError

Problems this endpoint can return

StatusProblemWhen
404Team not foundA cost threshold is listed, set or removed for a team id your organization does not hold.
404User not foundA cost threshold is listed, set, removed or read for a user id your organization does not hold.
422Usage type not supportedA cost threshold is set, removed or read on a usage type the platform cannot yet enforce.
Response fields

200 ListCostThresholdsResponse

FieldTypeDescription
thresholdsrequiredarray of CostThresholdThe organization's thresholds in force or opening next month, and the named team's or user's own.
Show 10 child fields of thresholds
FieldTypeDescription
idrequiredstringUUID of the threshold.
5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e
usageTyperequiredenum
DATAVOICESMSMMS
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.
VOICE
scoperequiredenum
organizationteamuser
Whose threshold this is: the organization's default, a team's, or one user's own.
team
teamIdrequiredstringThe team, for a team threshold.
2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70
userIdrequiredstringThe user, for a user threshold.
null
maxAmountrequirednumberWhat one person may spend on the usage type per month, in `currency`.
50
currencyrequiredstringISO 4217 code of the threshold's money: the team's cost-center currency, else the organization's primary.
EUR
periodrequiredenum
monthly
The period the spend is counted in. Always the calendar month.
monthly
validFromrequiredstringWhen the threshold opens (ISO 8601). A threshold lowered below someone's spend opens next month.
2026-10-01T00:00:00.000Z
validTorequiredstringWhen the threshold closes (ISO 8601), or null while it stands.
null
currencystringISO 4217 code a threshold written for the named team or user would carry. Absent when neither is named.
EUR
GET/v1/cost-thresholds

Request

curl -X GET "https://api.telgea.com/v1/cost-thresholds" \
  -H "x-api-key: $TELGEA_API_KEY"

Response

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

Set a cost threshold

PUT/v1/cost-thresholds
Enterprise APIPartner API

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.

Requires the permission policies:write on the key.

Try it in the playground → Calls run against your live organization; there is no sandbox.

Parameters

ParameterInTypeDescription
idempotency-keyheaderstringA 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.
0b7e4f1c-6a2d-4c9e-8f35-d1a7b2c93e60

Request body

FieldTypeDescription
usageTyperequiredenum
DATAVOICESMSMMS
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.
VOICE
teamIdstring (uuid)UUID of the team the threshold is for. Omit with `userId` for the organization's own.
2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70
userIdstring (uuid)UUID of the user the threshold is for. Omit with `teamId` for the organization's own.
9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01
maxAmountrequirednumberWhat one person may spend on the usage type per month, at most two decimals.
50

Responses

StatusMeaningBody
200The threshold as written, and what it did on the way in.SetCostThresholdResponse
400Request failed schema validation, or named both a team and a usernone
401Missing or invalid API key in the X-API-Key headerUnauthorizedError
403Insufficient permissions to manage policiesForbiddenError
404No team in your organization has this id, so nothing was read or changed. No user in your organization has this id, so nothing was read or changed.NotFoundError
409Another write of the same threshold landed at the same moment, so this one was refused and nothing was changed.ConflictError
422No cost center names a currency for this scope, so the threshold has no money to be written in. The cost-center currency is one no exchange rate covers, so spend could never be compared with a threshold in it. No threshold can stand on this usage type yet, so nothing was read or changed.UnprocessableEntityError
429The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets.TooManyRequestsError
500Internal server error. Contact support if this persists.InternalError

Problems this endpoint can return

StatusProblemWhen
404Team not foundA cost threshold is listed, set or removed for a team id your organization does not hold.
404User not foundA cost threshold is listed, set, removed or read for a user id your organization does not hold.
422No currency for the thresholdA cost threshold is set for a team with no cost center while the organization has no primary one.
422Currency not convertibleA cost threshold is set for a scope whose cost center bills in a currency the European Central Bank does not quote.
409Threshold written at the same momentTwo calls set the same scope's cost threshold at once.
422Usage type not supportedA cost threshold is set, removed or read on a usage type the platform cannot yet enforce.
Response fields

200 SetCostThresholdResponse

FieldTypeDescription
thresholdrequiredobjectThe threshold as written.
Show 10 child fields of threshold
FieldTypeDescription
idrequiredstringUUID of the threshold.
5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e
usageTyperequiredenum
DATAVOICESMSMMS
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.
VOICE
scoperequiredenum
organizationteamuser
Whose threshold this is: the organization's default, a team's, or one user's own.
team
teamIdrequiredstringThe team, for a team threshold.
2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70
userIdrequiredstringThe user, for a user threshold.
null
maxAmountrequirednumberWhat one person may spend on the usage type per month, in `currency`.
50
currencyrequiredstringISO 4217 code of the threshold's money: the team's cost-center currency, else the organization's primary.
EUR
periodrequiredenum
monthly
The period the spend is counted in. Always the calendar month.
monthly
validFromrequiredstringWhen the threshold opens (ISO 8601). A threshold lowered below someone's spend opens next month.
2026-10-01T00:00:00.000Z
validTorequiredstringWhen the threshold closes (ISO 8601), or null while it stands.
null
appliesFromNextMonthrequiredbooleanTrue when someone in scope has already spent more than the new amount this month, so it opens next month rather than now.
false
releasedNumberCountrequiredintegerLines whose pause was lifted because the raised amount put their user back under it.
0
PUT/v1/cost-thresholds

Request

curl -X PUT "https://api.telgea.com/v1/cost-thresholds" \
  -H "x-api-key: $TELGEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "usageType": "VOICE",
  "teamId": "2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70",
  "maxAmount": 50
}'

Response

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

Remove a cost threshold

DELETE/v1/cost-thresholds
Enterprise APIPartner API

Ends the scope's threshold on a usage type now: the organization's (no team or user), a team's (teamId) or a user's own (userId). A user then falls under their team's threshold, a team under the organization's; with none left, the usage is unlimited.

Removing a threshold that is not set changes nothing and still answers 204.

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

Requires the permission policies:write on the key.

Try it in the playground → Calls run against your live organization; there is no sandbox.

Parameters

ParameterInTypeDescription
usageTyperequiredqueryenumThe 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.
VOICE
teamIdquerystring (uuid)UUID of the team the threshold is for. Omit with `userId` for the organization's own.
2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70
userIdquerystring (uuid)UUID of the user the threshold is for. Omit with `teamId` for the organization's own.
9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01
idempotency-keyheaderstringA 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.
0b7e4f1c-6a2d-4c9e-8f35-d1a7b2c93e60

Responses

StatusMeaningBody
204The threshold is ended, or none was set.none
400Request failed schema validation, or named both a team and a usernone
401Missing or invalid API key in the X-API-Key headerUnauthorizedError
403Insufficient permissions to manage policiesForbiddenError
404No team in your organization has this id, so nothing was read or changed. No user in your organization has this id, so nothing was read or changed.NotFoundError
422No threshold can stand on this usage type yet, so nothing was read or changed.UnprocessableEntityError
429The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets.TooManyRequestsError
500Internal server error. Contact support if this persists.InternalError

Problems this endpoint can return

StatusProblemWhen
404Team not foundA cost threshold is listed, set or removed for a team id your organization does not hold.
404User not foundA cost threshold is listed, set, removed or read for a user id your organization does not hold.
422Usage type not supportedA cost threshold is set, removed or read on a usage type the platform cannot yet enforce.
DELETE/v1/cost-thresholds

Request

curl -X DELETE "https://api.telgea.com/v1/cost-thresholds" \
  -H "x-api-key: $TELGEA_API_KEY"

Response

{
  "type": "https://developer.telgea.com/errors/http/BAD_REQUEST",
  "title": "Bad request",
  "status": 400,
  "detail": "This request was refused, and no more specific code describes why.",
  "code": "BAD_REQUEST",
  "requestId": "req_123"
}
Need the raw schema? OpenAPI JSON