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.
| Field | Type | Description |
|---|---|---|
idrequired | string | UUID of the threshold.5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e |
usageTyperequired | enumDATAVOICESMSMMS | 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 |
scoperequired | enumorganizationteamuser | Whose threshold this is: the organization's default, a team's, or one user's own.team |
teamIdrequired | string | The team, for a team threshold.2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70 |
userIdrequired | string | The user, for a user threshold.null |
maxAmountrequired | number | What one person may spend on the usage type per month, in `currency`.50 |
currencyrequired | string | ISO 4217 code of the threshold's money: the team's cost-center currency, else the organization's primary.EUR |
periodrequired | enummonthly | The period the spend is counted in. Always the calendar month.monthly |
validFromrequired | string | When the threshold opens (ISO 8601). A threshold lowered below someone's spend opens next month.2026-10-01T00:00:00.000Z |
validTorequired | string | When the threshold closes (ISO 8601), or null while it stands.null |
Operations
List cost thresholds
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
| Parameter | In | Type | Description |
|---|---|---|---|
usageType | query | enum | 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 |
teamId | query | string (uuid) | UUID of the team the threshold is for. Omit with `userId` for the organization's own.2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70 |
userId | query | string (uuid) | UUID of the user the threshold is for. Omit with `teamId` for the organization's own.9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01 |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | The thresholds in force or opening next month. | ListCostThresholdsResponse |
400 | Request failed schema validation, or named both a team and a user | none |
401 | Missing or invalid API key in the X-API-Key header | UnauthorizedError |
403 | Insufficient permissions to view policies | ForbiddenError |
404 | No 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 |
422 | No threshold can stand on this usage type yet, so nothing was read or changed. | UnprocessableEntityError |
429 | The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets. | TooManyRequestsError |
500 | Internal server error. Contact support if this persists. | InternalError |
Problems this endpoint can return
| Status | Problem | When |
|---|---|---|
404 | Team not found | A cost threshold is listed, set or removed for a team id your organization does not hold. |
404 | User not found | A cost threshold is listed, set, removed or read for a user id your organization does not hold. |
422 | Usage type not supported | A cost threshold is set, removed or read on a usage type the platform cannot yet enforce. |
Response fields
200 ListCostThresholdsResponse
| Field | Type | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thresholdsrequired | array of CostThreshold | The organization's thresholds in force or opening next month, and the named team's or user's own. | |||||||||||||||||||||||||||||||||
Show 10 child fields of | |||||||||||||||||||||||||||||||||||
| Field | Type | Description |
|---|---|---|
idrequired | string | UUID of the threshold.5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e |
usageTyperequired | enumDATAVOICESMSMMS | 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 |
scoperequired | enumorganizationteamuser | Whose threshold this is: the organization's default, a team's, or one user's own.team |
teamIdrequired | string | The team, for a team threshold.2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70 |
userIdrequired | string | The user, for a user threshold.null |
maxAmountrequired | number | What one person may spend on the usage type per month, in `currency`.50 |
currencyrequired | string | ISO 4217 code of the threshold's money: the team's cost-center currency, else the organization's primary.EUR |
periodrequired | enummonthly | The period the spend is counted in. Always the calendar month.monthly |
validFromrequired | string | When the threshold opens (ISO 8601). A threshold lowered below someone's spend opens next month.2026-10-01T00:00:00.000Z |
validTorequired | string | When the threshold closes (ISO 8601), or null while it stands.null |
currencyEUR/v1/cost-thresholdsRequest
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
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
| Parameter | In | Type | Description |
|---|---|---|---|
idempotency-key | header | string | 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.0b7e4f1c-6a2d-4c9e-8f35-d1a7b2c93e60 |
Request body
| Field | Type | Description |
|---|---|---|
usageTyperequired | enumDATAVOICESMSMMS | 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 |
teamId | string (uuid) | UUID of the team the threshold is for. Omit with `userId` for the organization's own.2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70 |
userId | string (uuid) | UUID of the user the threshold is for. Omit with `teamId` for the organization's own.9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01 |
maxAmountrequired | number | What one person may spend on the usage type per month, at most two decimals.50 |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | The threshold as written, and what it did on the way in. | SetCostThresholdResponse |
400 | Request failed schema validation, or named both a team and a user | none |
401 | Missing or invalid API key in the X-API-Key header | UnauthorizedError |
403 | Insufficient permissions to manage policies | ForbiddenError |
404 | No 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 |
409 | Another write of the same threshold landed at the same moment, so this one was refused and nothing was changed. | ConflictError |
422 | No 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 |
429 | The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets. | TooManyRequestsError |
500 | Internal server error. Contact support if this persists. | InternalError |
Problems this endpoint can return
| Status | Problem | When |
|---|---|---|
404 | Team not found | A cost threshold is listed, set or removed for a team id your organization does not hold. |
404 | User not found | A cost threshold is listed, set, removed or read for a user id your organization does not hold. |
422 | No currency for the threshold | A cost threshold is set for a team with no cost center while the organization has no primary one. |
422 | Currency not convertible | A cost threshold is set for a scope whose cost center bills in a currency the European Central Bank does not quote. |
409 | Threshold written at the same moment | Two calls set the same scope's cost threshold at once. |
422 | Usage type not supported | A cost threshold is set, removed or read on a usage type the platform cannot yet enforce. |
Response fields
200 SetCostThresholdResponse
| Field | Type | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thresholdrequired | object | The threshold as written. | |||||||||||||||||||||||||||||||||
Show 10 child fields of | |||||||||||||||||||||||||||||||||||
| Field | Type | Description |
|---|---|---|
idrequired | string | UUID of the threshold.5d0b2c1e-7f3a-4b6c-9e8d-2a1f0c3b4d5e |
usageTyperequired | enumDATAVOICESMSMMS | 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 |
scoperequired | enumorganizationteamuser | Whose threshold this is: the organization's default, a team's, or one user's own.team |
teamIdrequired | string | The team, for a team threshold.2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70 |
userIdrequired | string | The user, for a user threshold.null |
maxAmountrequired | number | What one person may spend on the usage type per month, in `currency`.50 |
currencyrequired | string | ISO 4217 code of the threshold's money: the team's cost-center currency, else the organization's primary.EUR |
periodrequired | enummonthly | The period the spend is counted in. Always the calendar month.monthly |
validFromrequired | string | When the threshold opens (ISO 8601). A threshold lowered below someone's spend opens next month.2026-10-01T00:00:00.000Z |
validTorequired | string | When the threshold closes (ISO 8601), or null while it stands.null |
appliesFromNextMonthrequiredfalsereleasedNumberCountrequired0/v1/cost-thresholdsRequest
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
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
| Parameter | In | Type | Description |
|---|---|---|---|
usageTyperequired | query | enum | 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 |
teamId | query | string (uuid) | UUID of the team the threshold is for. Omit with `userId` for the organization's own.2f6b0d3a-8c1e-4a7f-9b2d-1e3c4d5f6a70 |
userId | query | string (uuid) | UUID of the user the threshold is for. Omit with `teamId` for the organization's own.9c1f2a6e-3b7d-4e0a-8f21-5d6c7b8a9e01 |
idempotency-key | header | string | 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.0b7e4f1c-6a2d-4c9e-8f35-d1a7b2c93e60 |
Responses
| Status | Meaning | Body |
|---|---|---|
204 | The threshold is ended, or none was set. | none |
400 | Request failed schema validation, or named both a team and a user | none |
401 | Missing or invalid API key in the X-API-Key header | UnauthorizedError |
403 | Insufficient permissions to manage policies | ForbiddenError |
404 | No 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 |
422 | No threshold can stand on this usage type yet, so nothing was read or changed. | UnprocessableEntityError |
429 | The API key has used its request quota for the current window. `Retry-After` says how many seconds until it resets. | TooManyRequestsError |
500 | Internal server error. Contact support if this persists. | InternalError |
Problems this endpoint can return
| Status | Problem | When |
|---|---|---|
404 | Team not found | A cost threshold is listed, set or removed for a team id your organization does not hold. |
404 | User not found | A cost threshold is listed, set, removed or read for a user id your organization does not hold. |
422 | Usage type not supported | A cost threshold is set, removed or read on a usage type the platform cannot yet enforce. |
/v1/cost-thresholdsRequest
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"
}