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
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
policy_id | path | string | Yes | |
project | query | string | Yes | The project the call is about. Every route is scoped to one. |
Pod-Organisation | header | string | No | The organization, for a person who belongs to several. An API key's organization is its own, and a different one here is forbidden. |
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
rules | string | Yes | Rules 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. |
preset | PresetRef | null | No | The preset the policy would pin, or null for none; left out keeps the one it pins. |
Answer
200. What the change would do.
{
"valid": false,
"problems": [
{
"line": null,
"message": "example"
}
],
"newly_allows": ["example"],
"no_longer_allows": ["example"],
"reading_on": false
}| Field | Type | Always | What it is |
|---|---|---|---|
valid | boolean | Yes | |
problems | Problem[] | Yes | |
newly_allows | string[] | Yes | What the change newly allows, in plain words. |
no_longer_allows | string[] | Yes | |
reading_on | boolean | Yes |
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.