bots.createGrant
POST
/v1/bots/{botId}/grants
const url = 'https://example.com/v1/bots/example/grants';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"capability":{"action":"tools.call","target":"example","arguments":{}},"effect":"allow","scope":"once","reason":"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://example.com/v1/bots/example/grants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "capability": { "action": "tools.call", "target": "example", "arguments": {} }, "effect": "allow", "scope": "once", "reason": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”botId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
capability
required
object
action
required
string
target
required
string
arguments
object
effect
required
string
scope
required
string
reason
string
Responses
Section titled “Responses”Success
Media typeapplication/json
object
id
required
string
bot
required
string
capability
required
object
action
required
string
target
required
string
arguments
object
effect
required
string
scope
required
string
chat
string
grantedBy
required
reason
string
parent
string
status
required
string
createdAt
required
number
Example
{ "capability": { "action": "tools.call" }, "effect": "allow", "scope": "once", "grantedBy": { "_tag": "Person" }, "status": "active"}BotInvalid | OrganizationRequired
AuthenticationRequired
Media typeapplication/json
object
_tag
required
string
Example
{ "_tag": "AuthenticationRequired"}@nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin
BotNotFound
Media typeapplication/json
object
_tag
required
string
bot
required
string
Example
{ "_tag": "BotNotFound"}@nmnmcc/ability/Authorizer/Pending | BotConflict
RateLimited
Media typeapplication/json
object
_tag
required
string
retryAfterSeconds
required
integer
Example
{ "_tag": "RateLimited"}BotStorageUnavailable | AuthenticationUnavailable | RequestFailed