Check a change to a policy without saving it

Runs the compiler's checks on the rules as they would be and says, in plain words, what the change newly allows and no longer allows, and whether it switches traffic reading on.

POST/v1/policies/{policy_id}/check

Runs the compiler's checks on the rules as they would be and says, in plain words, what the change newly allows and no longer allows, and whether it switches traffic reading on. Changes nothing.

A key with the permissions:read scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/policies/example/check?project=example" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rules":"example"}'

Parameters

NameInTypeRequiredWhat it is
policy_idpathstringYes
projectquerystringYesThe project the call is about. Every route is scoped to one.
Pod-OrganisationheaderstringNoThe organization, for a person who belongs to several. An API key's organization is its own, and a different one here is forbidden.
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
rulesstringYesRules in the simple form, one a line: a verdict, an action and a thing (Allow net api.github.com GET /repos/*). At most 1,000 rules a policy.
presetPresetRef | nullNoThe preset the policy would pin, or null for none; left out keeps the one it pins.

Answer

200. What the change would do.

200
{
  "valid": false,
  "problems": [
    {
      "line": null,
      "message": "example"
    }
  ],
  "newly_allows": ["example"],
  "no_longer_allows": ["example"],
  "reading_on": false
}
FieldTypeAlwaysWhat it is
validbooleanYes
problemsProblem[]Yes
newly_allowsstring[]YesWhat the change newly allows, in plain words.
no_longer_allowsstring[]Yes
reading_onbooleanYes

Errors

The refusals this call is known for: invalid, unauthorized, forbidden, not_found. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.