Skip to main content
Create Policy
curl --request POST \
  --url https://api.coralogix.com/mgmt/openapi/latest/dataplans/policies/v1 \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My Policy",
  "priority": "PRIORITY_TYPE_UNSPECIFIED",
  "applicationRule": {
    "name": "<string>",
    "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED"
  },
  "archiveRetention": {
    "id": "<string>"
  },
  "description": "My Policy Description",
  "disabled": true,
  "placement": {
    "first": {}
  },
  "spanRules": {
    "actionRule": {
      "name": "<string>",
      "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED"
    },
    "serviceRule": {
      "name": "<string>",
      "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED"
    },
    "tagRules": [
      {
        "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
        "tagName": "tag_name",
        "tagValue": "tag_value"
      }
    ]
  },
  "subsystemRule": {
    "name": "<string>",
    "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED"
  }
}
'
{
  "policy": {
    "companyId": 1234,
    "deleted": false,
    "enabled": true,
    "id": "policy_id",
    "name": "My Policy",
    "order": 1,
    "priority": "PRIORITY_TYPE_UNSPECIFIED",
    "applicationRule": {
      "name": "<string>",
      "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED"
    },
    "archiveRetention": {
      "id": "<string>"
    },
    "createdAt": "2021-01-01T00:00:00.000Z",
    "description": "My Policy Description",
    "logRules": {
      "severities": [
        "SEVERITY_UNSPECIFIED"
      ]
    },
    "subsystemRule": {
      "name": "<string>",
      "ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED"
    },
    "updatedAt": "2021-01-01T00:00:00.000Z"
  }
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

This data structue is used to create a new policy.

name
string
required
Example:

"My Policy"

priority
enum<string>
required
Available options:
PRIORITY_TYPE_UNSPECIFIED,
PRIORITY_TYPE_BLOCK,
PRIORITY_TYPE_LOW,
PRIORITY_TYPE_MEDIUM,
PRIORITY_TYPE_HIGH
applicationRule
object
archiveRetention
object
description
string
Example:

"My Policy Description"

disabled
boolean
placement
object
spanRules
object
subsystemRule
object

Response

This data structue is obtained when creating a policy.

policy
Policy · object
required

A policy is a set of rules that define the behavior of the Coralogix system for a specific company.