HomeGuidesAPI ReferenceRelease notes
Log In
API Reference

Create Policy

Creates a new Policy

  • payload (PolicySchema): Required. The policy data to be created:
    • name (str): A descriptive name for this policy.
    • data_config: Configuration relevant to the retrieval of data for this policy: for compare distribution policy:
      • query_a (Query): Cube.js query.
      • query_b (Query): Cube.js query.
      • query_a_time_range_config: (TimeRangeConfig or None): Time range configuration for query A.
      • query_b_time_range_config: (TimeRangeConfig or None): Time range configuration for query B.
      • distance_function (DistanceFunction): Distance function to use. for statistics policy:
      • query (Query): Cube.js query.
      • time_range_config: (TimeRangeConfig): Time range configuration for the query.
    • cron_expression (str): Cron expression for policy evaluation.
    • condition_above_value (float or None): Condition above value.
    • condition_below_value (float or None): Condition below value.
    • destination_ids (list of UUID): List of communication channels to get notified through.
    • alert_on_status (AlertOnStatusDirection): Trigger policy action if the value is above/below.
    • alert_on_policy_level (bool): Trigger policy action on a single group/entire groups.
    • dataset_id (str): The dataset this policy is monitoring.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
boolean
required

Trigger policy action on a single group/entire groups

string
required

A descriptive name for this policy

string
required

The dataset this policy is monitoring

destination_ids
array of uuids
required

List of communication channels to get notified through

Destination Ids*
string
required

Cron expression for policy evaluation

threshold_settings
required
string
enum
required

Trigger policy action if the value is above/below

Allowed:
data_config
required

The second dataset this policy is monitoring

A description for this policy

boolean
Defaults to false

If true, the policy will be initialized with historic data

Responses

422

Unprocessable Entity

500

Internal Server Error

Language
Credentials
OAuth2
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json