Budgets
List budgets
GET /{website-id}/budgets
The result looks like this:
200 OK
{
"result": {
"list": [
{
"id": "x7wcqghdlo",
"metric": "lcp",
"operator": "lt",
"value": "700",
"device": "desktop",
"status": "at-risk",
"pages": [
{
"id": "l2o71voacg",
"device": "desktop",
"alias": "Blog overview",
"status": "at-risk"
}
]
},
{
"id": "ky60fto1rt",
"metric": "dom_elements",
"operator": "lt",
"value": "1000",
"device": "all",
"status": "ok",
"pages": []
},
...
]
}
}
The result.list
array shows the budgets:
Property | Description |
---|---|
id | The internal ID of the budget |
metric | The metric the budget is measuring |
operator | Either "lt" (less than) or "gt" (greater than) |
value | The threshold value of the budget |
device | desktop, mobile or all |
status | ok, at-risk or exceeded. At-risk means within 10% of the threshold |
pages | An array of the pages that either exceed or are at risk of exceeding the budget |
Each page item represents a page-device combination and has these properties:
Property | Description |
---|---|
id | The internal ID of the page |
device | The device of the page |
alias | The page alias |
status | ok, at-risk or exceeded. At-risk means within 10% of the threshold |
Create new budget
Adds a new budgets to the website. admin
POST /{website-id}/budgets
{
"metric": "lcp",
"operator": "lt",
"value": 2500,
"device": "desktop"
}
Returns the same object, but with the id
added:
201 Created
{
"id": "x7wcqghdlo",
"metric": "lcp",
"operator": "lt",
"value": 2500,
"device": "desktop"
}
Edit budget
Edits an existing budget. admin
PUT /{website-id}/budgets/{budget-id}
{
"metric": "lcp",
"operator": "lt",
"value": 2500,
"device": "desktop"
}
Returns the budget object:
200 OK
{
"id": "x7wcqghdlo",
"metric": "lcp",
"operator": "lt",
"value": 2500,
"device": "desktop",
}
Delete budget
Removes the budget from the website. admin
DELETE /{website-id}/budgets/{budget-id}
If successful, you'll receive a 204 No Content
response.