Policy

Update a policy

Updates the conditions or selector of an existing policy.

patch/approval/policy/{id}

Path parameters

idinteger required

The ID of the policy.

Request body

conditionsobject

A JSON object defining the conditions under which this policy applies.

selectorobject

A JSON object that acts as a pre-filter. If the selector does not match the request context, the policy is skipped entirely and its conditions are not evaluated.

Note: We recommend using selectors for services, as they allow you to target specific service specifications.

Example request

{
  "conditions": {
    "scope.requested_spec.memory_in_gb": {
      "$lte": 4
    }
  },
  "selector": {
    "service.spec.id": {
      "$eq": 2
    }
  }
}

Response

The operation was successful.

idinteger required

A unique identifier for the policy.

nrnstring required

A resource identifier (NRN) specifying where the policy applies.

namestring required

The name of the policy.

slugstring

A URL-friendly identifier derived from the policy name. Generated automatically on creation.

status'active' | 'deleted'

The current status of the policy.

conditionsobject required

A JSON object defining the conditions under which this policy applies. Uses MongoDB query syntax.

selectorobject

A JSON object that acts as a pre-filter. If the selector does not match the request context, the policy is skipped entirely and its conditions are not evaluated. Useful when multiple policies are attached to the same action and each should apply only to a specific subset of requests.

Example response

{
  "id": 5678,
  "nrn": "organization=1:account=2:namespace=3:application=4",
  "name": "Crypto Kong Policies",
  "slug": "crypto-kong-policies",
  "status": "active",
  "conditions": {
    "scope.requested_spec.memory_in_gb": {
      "$lte": 4
    }
  },
  "selector": {
    "service.spec.id": {
      "$eq": 2
    }
  }
}

Changes