Create permission request
Evaluate and, when approval is required, create a permission request for a session.
POST
/api/session/{sessionID}/permissionPath parameters
sessionIDobjectrequiredRequest body
requiredapplication/jsonidobject | anyShow propertiesHide properties
Any of:
object
objectany
anyactionstringrequiredresourcesstring[]requiredsavestring[]metadataobjectsourcePermissionV2.SourceShow propertiesHide properties
Any of:
object
typestringrequiredAllowed:
toolmessageIDstringrequiredcallIDstringrequiredagentstring | anyShow propertiesHide properties
Any of:
string
stringany
anyResponses
200Success
dataobjectrequiredShow propertiesHide properties
idobjectrequiredShow propertiesHide properties
objecteffectPermissionV2.EffectrequiredAllowed:
allowdenyask400InvalidRequestError
_tagstringrequiredAllowed:
InvalidRequestErrormessagestringrequiredkindstring | anyShow propertiesHide properties
Any of:
string
stringany
anyfieldstring | anyShow propertiesHide properties
Any of:
string
stringany
any401UnauthorizedError
_tagstringrequiredAllowed:
UnauthorizedErrormessagestringrequired404SessionNotFoundError
Any of:
SessionNotFoundError
_tagstringrequiredAllowed:
SessionNotFoundErrorsessionIDstringrequiredmessagestringrequiredSessionNotFoundError
_tagstringrequiredAllowed:
SessionNotFoundErrorsessionIDstringrequiredmessagestringrequiredRequest
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"
}'const response = await fetch("/api/session/%5Bobject%20Object%5D/permission", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"id": {},
"action": "string",
"resources": [
"string"
],
"save": [
"string"
],
"metadata": {},
"source": {
"type": "tool",
"messageID": "string",
"callID": "string"
},
"agent": "string"
})
});import requests
response = requests.post(
"/api/session/%5Bobject%20Object%5D/permission",
headers={
"Content-Type": "application/json"
},
json={
"id": {},
"action": "string",
"resources": [
"string"
],
"save": [
"string"
],
"metadata": {},
"source": {
"type": "tool",
"messageID": "string",
"callID": "string"
},
"agent": "string"
},
)Response
{
"data": {
"id": {},
"effect": "allow"
}
}{
"_tag": "InvalidRequestError",
"message": "string",
"kind": "string",
"field": "string"
}{
"_tag": "UnauthorizedError",
"message": "string"
}{
"_tag": "SessionNotFoundError",
"sessionID": "string",
"message": "string"
}