Get usage alerts
Shows the alert setting and what the usage rules find right now.
GET/v1/workspaces/{regionId}/usage-alerts
Returns
200 OK with the object shown in the response.
More details
Returns the workspace's alert setting and what the rules find this month, and writes nothing. Each alert carries its finding with its figures, its text in English (title, body) with titleMessageId, bodyMessageId and their params to show it in the reader's language, and sentAt once this month's notification went out. Needs 'view' access to suppliers or to invoices.
Response fields
periodstringThe month the findings are for, YYYY-MM.
presetobjectWhat the sensitivity means: spikePct, how far above its trend a subject must run; pacePct, how far above last month the month must be on pace; minAmount, the least a finding must add over a month before it is scaled to a currency.
currencies[]objectEach currency the workspace is billed in by a connected supplier, with the minimum a finding in it must reach; custom is true where the administrator set it.
alerts[].finding.type"spike" | "pace" | "contract_cap" | "contract_tier" | "contract_commitment" | "ai_commitment"spike: above its own trend. pace: the month on pace above last month. contract_cap, contract_tier and contract_commitment: the month's projection breaking a contract's spend cap, reaching its next spend tier or ending short of its minimum commitment. ai_commitment: an AI spend commitment on pace to end short.
alerts[].sentAtstringWhen this month's notification for the finding went out; absent when none has yet.
Errors
- 403 Forbidden - The caller's Bearer token or API key doesn't grant access to this workspace (workspaceId), or lacks the required role.
- 401 Unauthorized - No credential was presented, or the Bearer token / X-Api-Key value is missing, invalid, expired, or revoked.
curl "$PLEAXY_API_BASE_URL/v1/workspaces/{regionId}/usage-alerts" \
-H "X-Api-Key: $PLEAXY_API_KEY"{
"period": "string",
"settings": {
"enabled": boolean,
"sensitivity": "low" | "medium" | "high",
"minimums": { "string": number },
"updatedAt": "string"
},
"preset": { "spikePct": number, "pacePct": number, "minAmount": number },
"currencies": [
{ "currency": "string", "minimum": number, "defaultMinimum": number, "custom": boolean }
],
"alerts": [
{
"key": "string",
"finding": { "type": "string", ... },
"title": "string",
"titleMessageId": "string",
"titleParams": { },
"body": "string",
"bodyMessageId": "string",
"bodyParams": { },
"sentAt": "string"
}
],
"generatedAt": "string"
}