Consent requires the tenant's owner and checks every selected reference belongs to that tenant before creating the grant and key. Session start checks the live catalogs.
const url = 'https://api.canopyhq.dev/consent/example';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"extra_tools":[{"connection":"example","tool":"example"}],"inference":"example","policies":[{"allow":true,"items":[{"arg":"example","effect":"allow","op":"is","operand":{"value":"example"}}],"posture":"permissive","project":["example"],"tool":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.canopyhq.dev/consent/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "extra_tools": [ { "connection": "example", "tool": "example" } ], "inference": "example", "policies": [ { "allow": true, "items": [ { "arg": "example", "effect": "allow", "op": "is", "operand": { "value": "example" } } ], "posture": "permissive", "project": [ "example" ], "tool": "example" } ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”One proposal. Minted per POST, so two proposals of one document are two requests, each with its own secret and its own key.
The request being consented to.
Request Bodyrequired
Section titled “Request Bodyrequired”What the tenant lands at consent. Inference must be selected; an empty policy
list allows every tool and an empty extra-tools list adds nothing. The
policies name tools as the model sees them and compile in policy, against
the surface the resolved connections give, which is not this type’s to know.
object
A tool the tenant brings that the vendor did not state: a pre-registered remote, such as an MCP server the tenant already links to.
object
The name by which an MCP server identifies and invokes a tool.
The tenant’s rules for one tool, named by the name the model sees.
object
The tool enable. Off, nothing else here matters.
What a tool’s allow items do: nothing under Permissive, where only deny
items bind; bind under Restrictive, where a conditioned arg must satisfy
one of them.
Args projected for evidence alone, conditioned or not.
Responses
Section titled “Responses”The install the consent created, or the existing install an update kept with its key.
object
Opaque; never the key, never anything the vendor chose.
Examplegenerated
{ "install": "example"}Parse errors identify the field and reason when available. The tenant config may not fit the vendor’s, or may name an inference option, connection, or tool the tenant does not own.
No console token, or one that did not verify.
Only an owner of the tenant may consent for it.
No such request, or it lapsed.
The request was granted already.