FruxonDocs
Agent NetworkTriggers

Sets one of an automation's spend limits

Creates the limit for the window in the body (default `MONTHLY`), or replaces the amount, thresholds and enforce flag of the one already there. A daily, a weekly and a monthly limit can coexist, and must stay ordered daily ≤ weekly ≤ monthly. A new limit enforces and alerts at 80% and 100% unless the body says otherwise; `enforceLimit: false` makes it alert only. Spend already made in the current window counts against a new limit from the moment runs recording it settle; the limit does not reach back over runs before it existed.

PUT
/v1/tenants/{tenant}/triggers/{trigger}/budget
AuthorizationBearer <token>

JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.

In: header

Path Parameters

trigger*string

The automation (trigger) identifier.

Formatuuid
tenant*string

The tenant identifier

The limit: amount, window, thresholds and enforce flag.

amount?number

The limit, in USD. Must be greater than zero.

Formatdouble
period?string

The window the limit caps spend over: DAILY, WEEKLY or MONTHLY. Omitted means MONTHLY. It names which limit to set, so it cannot be changed on an existing one; set the other window's limit instead.

Value in"UNSPECIFIED" | "DAILY" | "WEEKLY" | "MONTHLY"
thresholdRules?|null

The percentages of the limit at which the automation's admins are told. Omitted keeps the existing ones on an update, and on a new limit means 80 and 100.

enforceLimit?boolean|null

Whether runs are refused once the limit is reached. Omitted keeps the existing value on an update; a new limit enforces. false makes it alert only.

[key: string]?never

Response Body

curl -X PUT "https://api.fruxon.com/v1/tenants/string/triggers/497f6eca-6276-4993-bfeb-53cbbbba6f08/budget" \  -H "Content-Type: application/json" \  -d '{}'
{
  "automationId": "00000000-0000-0000-0000-000000000000",
  "amount": 0,
  "period": "DAILY",
  "thresholdRules": [
    {
      "percent": 0
    }
  ],
  "enforceLimit": false,
  "currentPeriodCost": 0,
  "usagePercent": 0,
  "periodStart": 0,
  "periodEnd": 0,
  "createdAt": 0,
  "modifiedAt": 0
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}
Empty
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}