Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

Create permission request

Evaluate and, when approval is required, create a permission request for a session.

POST/api/session/{sessionID}/permission
Path parameters
sessionIDobjectrequired
Request body
requiredapplication/json
idobject | any
Show properties
Any of:
object
object
any
any
actionstringrequired
resourcesstring[]required
savestring[]
metadataobject
sourcePermissionV2.Source
Show properties
Any of:
object
typestringrequired
Allowed:tool
messageIDstringrequired
callIDstringrequired
agentstring | any
Show properties
Any of:
string
string
any
any
Responses
200Success
dataobjectrequired
Show properties
idobjectrequired
Show properties
object
effectPermissionV2.Effectrequired
Allowed:allowdenyask
400InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
404SessionNotFoundError
Any of:
SessionNotFoundError
_tagstringrequired
Allowed:SessionNotFoundError
sessionIDstringrequired
messagestringrequired
SessionNotFoundError
_tagstringrequired
Allowed:SessionNotFoundError
sessionIDstringrequired
messagestringrequired
Request
curl -X POST "/api/session/%5Bobject%20Object%5D/permission" \
  -H "Content-Type: application/json" \
  -d '{
  "id": {},
  "action": "string",
  "resources": [
    "string"
  ],
  "save": [
    "string"
  ],
  "metadata": {},
  "source": {
    "type": "tool",
    "messageID": "string",
    "callID": "string"
  },
  "agent": "string"
}'
Response
{
  "data": {
    "id": {},
    "effect": "allow"
  }
}