Create a preference.
USER: true SERVICE ACCOUNT: true
curl --request POST \
--url https://api.revoengine.com/api/v1/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "orders-grid-default",
"type": "GRID",
"data": [
{
"field": "status",
"width": 180,
"order": 0
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'orders-grid-default',
type: 'GRID',
data: [{field: 'status', width: 180, order: 0}]
})
};
fetch('https://api.revoengine.com/api/v1/preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/preferences"
payload = {
"name": "orders-grid-default",
"type": "GRID",
"data": [
{
"field": "status",
"width": 180,
"order": 0
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
Bearer JWT token or API Key (sk-*).
Body
Stable preference name.
"orders-grid-default"
Preference family that determines the allowed data payload.
GRID, FAVOURITE, DASHBOARD, SCRATCH, WEB_IDE, OBSERVABILITY "GRID"
Preference payload items validated against the selected preference type. OBSERVABILITY accepts exactly one saved view with schemaVersion: 1, reusable state (tab, timeframe, search, services, kind, outcome, resourceId, actorId, severity, event, anchorType, logFilter) and filtersOpen. Selected execution and investigation identifiers are excluded; the payload is limited to 64 KiB.
[
{
"field": "status",
"width": 180,
"order": 0
}
]
Optional operator-facing preference description.
"Default orders grid for support staff."
Reference type used when the preference is scoped to a resource family.
"orders"
Reference id used when the preference is scoped to one resource.
"support-dashboard"
Optional resource metadata. Values may use any JSON type. Maximum 16 KiB and 64 top-level keys. Top-level keys starting with "__" are reserved for backend use.
{ "layout": "support" }
Whether the preference is shared with all eligible users.
false
Whether this preference becomes the default selection.
true
Whether the grid should auto-fit columns when the preference is applied.
true
Response
OK.
curl --request POST \
--url https://api.revoengine.com/api/v1/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "orders-grid-default",
"type": "GRID",
"data": [
{
"field": "status",
"width": 180,
"order": 0
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'orders-grid-default',
type: 'GRID',
data: [{field: 'status', width: 180, order: 0}]
})
};
fetch('https://api.revoengine.com/api/v1/preferences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.revoengine.com/api/v1/preferences"
payload = {
"name": "orders-grid-default",
"type": "GRID",
"data": [
{
"field": "status",
"width": 180,
"order": 0
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
