Say what a sandbox's table would decide for a request

The connection test: decides a request against a sandbox's table and its live grants, or against a policy's table, without sending anything.

POST/v1/connection-tests

The connection test: decides a request against a sandbox's table and its live grants, or against a policy's table, without sending anything. Name exactly one of sandbox and policy (invalid otherwise). Changes nothing and records nothing. A sandbox's live grants are the newest grant list the publisher signed for it, used once the sandbox's server has applied it, as the server decides. A list that cannot be read, is not applied yet, or answers another table is not used (deny when unsure), and grants says so.

A key with the permissions:read scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/connection-tests?project=example" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"request":{"action":"read","thing":"example"}}'

Parameters

NameInTypeRequiredWhat it is
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
sandboxstringNoDecide with this sandbox's table and its live grants.
policystringNoDecide with this policy's table, with no grants.
requestTestRequestYes

Answer

200. What the table would decide, and why.

200
{
  "verdict": "allow",
  "rule": null,
  "reason": "example",
  "read": false,
  "log_only": false,
  "baseline": false,
  "cut_off": false,
  "grant": null,
  "grants": null,
  "policy": null,
  "policy_version": null
}
FieldTypeAlwaysWhat it is
verdict"allow" | "ask" | "deny"Yes
rulestring | nullYesThe rule that decided, in the simple form; null when the baseline, a cut-off or the verdict for everything else decided.
reasonstringYesWhy, in plain words.
readbooleanYesWhether the request would be read.
log_onlybooleanYesWhether log-only mode would let a net Deny or Ask through and record it.
baselinebooleanYesWhether the fixed baseline decided. It always blocks internal addresses, private networks and outbound mail.
cut_offbooleanYesWhether a cut-off decided.
grantstring | nullYesThe Ask whose answer decided, when a live grant of the sandbox's grant list did; null otherwise. An "allow once" grant is reported as allowing, and reason notes that the sandbox's server may already have used it: the server keeps which once grants it used.
grantsDecisionGrantListYesWhich grant list of the sandbox the answer was decided with; null for a policy's table, which has no grants. Only a list the sandbox's server has applied, bound to the table deciding here, is used; otherwise the request is decided with no grants (deny when unsure).
policystring | nullYes
policy_versioninteger | nullYes

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.