latestOpenAPI 3.0.32026-08-10152216352.3 KB

eea119b4113f

Guardrails

List Guardrail Rules

Returns a list of guardrails rules based on filter criteria

post/guardrails/search

Query parameters

pageinteger
pageSizeinteger

Request body

projectionstring[]

Fields to include in the response

searchValuestring

Value to search for across searchable fields

Example request

{
  "filters": {
    "createdBy": [
      "John Doe"
    ],
    "type": [
      "policy",
      "cost"
    ],
    "labels": [
      "production"
    ],
    "repositories": [
      "my-repo"
    ],
    "workspaces": [
      "my-workspace"
    ],
    "branches": [
      "main"
    ],
    "$or": {
      "createdBy": [
        "John Doe"
      ],
      "type": [
        "policy",
        "cost"
      ],
      "labels": [
        "production"
      ],
      "repositories": [
        "my-repo"
      ],
      "workspaces": [
        "my-workspace"
      ],
      "branches": [
        "main"
      ]
    }
  }
}

Response

List of guardrail rules retrieved successfully

idstring

Unique identifier of the guardrail rule

accountIdstring

Unique identifier of the associated account

createdBystring

Name of the user who created the rule

namestring

Name of the guardrail rule

type'policy' | 'cost' | 'resource' | 'tag'

Type of the guardrail rule

isEnabledboolean

Whether the rule is enabled

createdAtstring date-time

Timestamp when the rule was created

updatedAtstring date-time

Timestamp when the rule was last updated

notificationIdstring

Unique identifier of the associated notification configuration

severity0 | 1 | 2 | 3 | 4

Severity level of the guardrail rule

enforceOnNoOpboolean

Whether to enforce the rule on no-op assets

Example response

[
  {
    "id": "507f1f77bcf86cd799439012",
    "accountId": "507f1f77bcf86cd799439012",
    "createdBy": "John Doe",
    "criteria": {
      "resource": {
        "actions": [
          "create"
        ]
      }
    },
    "notificationId": "507f1f77bcf86cd799439012"
  }
]