CorefinityCorefinityDocs
Open the Control PanelControl Panel
Logs · 23 of 25

Create a site's saved log query

Saves a query, filters or neither with a source and a time range: for this site when site_id is sent, for every site otherwise. You can keep 50 saved queries.

POST/api/corestack/sites/{site}/logs/saved-queries

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Body

filtersobject or any or null

Filters, kept with the query.

namestringRequired

Up to 60 characters.

querystring or null

A LogsQL query. Up to 4 KB. Up to 4,096 characters.

rangestringRequired

The time range the query opens with. custom means a range chosen each time.

15m1h6h24h7d30dcustom
sourcestringRequired

A log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue
site_idinteger or null

The {site} of the request, to keep the query for this site. Left out or null, the query is kept for every site. At least 1.

Returns

201 The saved query.

Fields of the 201 answer
can_deletebooleanRequired

True when you may delete it.

clusterobject or any or null

The CoreCluster the query is kept for. Sent only for a query kept for a CoreCluster.

created_atstring or nullRequired

Format: date-time.

filtersobject or array or any or nullRequired

The saved filters. Null when none were sent, and an empty list when they were saved as an empty object.

idintegerRequired

At least 1.

namestringRequired
querystring or nullRequired

The LogsQL query. Null for a query saved as filters.

rangestringRequired
15m1h6h24h7d30dcustom
sharedbooleanRequired

True for a query Corefinity support shared with everyone on the site or CoreCluster.

siteobject or any or nullRequired

The site the query is kept for. Null for one kept for every site, or for a CoreCluster.

sourcestringRequired

A log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/logs/saved-queries \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": {
      "level": [
        "warning",
        "error"
      ]
    },
    "name": "PHP warnings",
    "range": "7d",
    "source": "php"
  }'
{
  "can_delete": true,
  "created_at": "2026-11-03T10:00:00Z",
  "filters": null,
  "id": 3318,
  "name": "Checkout errors",
  "query": "status:>=500",
  "range": "24h",
  "shared": false,
  "site": {
    "domain": "harbourandfinch.example.com",
    "id": 1042
  },
  "source": "web-access"
}
Try it
Held in this tab's memory only. Never stored or sent to us.

This sends a real POST request and changes your account.

Use a token with only the write scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT