List online rules
const url = 'http://localhost:8080/api/v1/projects/example/online-rules?limit=50';const options = {method: 'GET', headers: {cookie: 'cetra_session=<cetra_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/api/v1/projects/example/online-rules?limit=50' \ --cookie cetra_session=<cetra_session>Any project member can read. org_enabled_rules counts the enabled rules of the whole org (D-I-32).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Query Parameters
Section titled “Query Parameters”Page size. Default 50, accepted range 1–1000.
Spec 09 § Conventions.
Maximum number of items to return (1–1000, default 50).
Opaque cursor from a previous page.
Responses
Section titled “Responses”One page of online rules.
One page of online rules. next_cursor is null when there is no next page.
object
Rules in this page.
An online rule. Spec 09 § Evaluation & alerts.
object
Period of the budget. Present exactly when budget_usd is.
Budget per period, in USD. Omitted when the rule has none.
Creation time. JSON is RFC 3339.
User who created the rule. Omitted when that user is unknown.
Live matches dropped by the hourly cap in the current UTC hour. Counted in memory, so 0 after a restart.
Whether the rule runs.
The evaluator the rule runs. Immutable.
Filter over the target’s view. Omitted when the rule has none.
Rule id.
Jobs of the rule created in the last 24 hours, by status.
object
Finished jobs with a score.
Jobs that failed for good.
Jobs waiting to run.
Jobs running now.
Jobs left out before they ran.
Display name, 1 to 128 characters.
When the rule was paused. Omitted when it is not paused.
Detail of the pause: an error text or a fixed text. Never payload content.
Why the rule is paused. Omitted when it is not paused.
Share of the matching targets that are evaluated, in (0, 1].
Budget spend of the current period. Omitted when the rule has no budget.
object
Start of the current UTC day or month.
Estimated cost of the running jobs, in USD.
Cost of the finished jobs in the period, in USD.
What the rule matches. Immutable.
Last change time. JSON is RFC 3339.
Prompt variable to mapping expression.
object
Opaque cursor for the next page, or null when this is the last page.
Enabled rules of the whole org, counted for the plan’s active-rule limit.
Example
{ "data": [ { "budget_period": "day", "paused_reason": "budget", "target": "trace" } ]}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}