Bind a policy to a new sandbox

Names the policy a sandbox about to be made runs under, with rules for that one sandbox.

POST/v1/bindings

Names the policy a sandbox about to be made runs under, with rules for that one sandbox. Pod's front door calls this during a create that names a policy or carries rules from a spec file, made by a person or with a project key, and passes on that caller's own credentials, so the callers below are the create's; the server must hold the compiled table before the sandbox runs anything. policy: null is the project's default. Rules for the sandbox are cut to the ceiling, and the answer says what was cut. A sandbox already bound in this project is conflict. Only attaching a policy closes the network. A sandbox id proves nothing by itself, and only the front door's registry knows the sandbox being made is in the caller's project. So only Pod's front door makes this call, while it creates a sandbox: a call you send yourself is forbidden. A sandbox bound in another project or organization is not_found, the same answer as for any sandbox this project does not have. A create made with a key issued inside a sandbox never reaches this route: that key is refused here like everywhere in this API. The front door binds such a child itself, and binds only the parent's policy or one whose table lists the parent's among those it narrows, never none and never the project's default.

A key with the permissions:write scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/bindings?project=example" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sandbox":"example","policy":"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
sandboxstringYes
policystring | nullYesThe policy; null for the project's default.
rulesstringNoRules for this sandbox alone, from a create call or a spec file. Cut to the ceiling.
parentstringNoFor a child, the sandbox it is made from. The child gets its parent's policy or a narrower one.
matterstringNoThe person it acts for must be cleared for the matter, or the call answers forbidden and the refusal is written to the matter's log; a sandbox made with a key acts for nobody and is never cleared. A child stays on its parent's matter.

Answer

201. The binding, and what was cut to the ceiling.

201
{
  "binding": {
    "sandbox": "example",
    "policy": null,
    "sandbox_rules": "example",
    "version": 1,
    "table_hash": null,
    "applied_version": null,
    "parent": null,
    "bound_at": "2026-11-23T12:00:00.000Z",
    "updated_at": "2026-11-23T12:00:00.000Z",
    "updated_by": "example",
    "person": null,
    "groups": [
      {
        "group_policy": "example",
        "group": "example",
        "group_name": "example",
        "policy": "example"
      }
    ],
    "matter": null,
    "cleared": null
  },
  "cut": [
    {
      "line": 1,
      "rule": "example",
      "reason": "example",
      "group": {
        "group_policy": "example",
        "group": "example",
        "group_name": "example",
        "policy": "example"
      },
      "matter": "example",
      "wall": false
    }
  ]
}
FieldTypeAlwaysWhat it is
bindingBindingYesThe policy one sandbox runs under, and its rules for that sandbox alone.
cutCutRule[]Yes

Errors

The refusals this call is known for: invalid, unauthorized, forbidden, not_found, conflict. 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.