Grant an agent or a Kratos human Use on an item. Same grant object. Not MCP. Not a family vault.
POST
/v1/grantsAuthorization
AuthorizationBearer token (JWT) · headerrequiredHydra JWT. Identity is the bound agent or a Keto member human. The host is not identity.
Request body
requiredapplication/jsonagentstringAgent id. XOR human/group.
humanstringKratos identity id. Same Grant.agent_id. Not email. XOR agent/group.
itemstringrequiredlevelstringrequiredAllowed:
level1level2expiresstringGo duration. Empty is forever.
groupstringOrg group name — the shared vault. XOR agent/human.
Responses
200Grant
idstringrequiredorg_idstringrequiredagent_idstringrequireditem_idstringrequiredlevelstringrequiredexpires_atstring<date-time>subject_kindstringrequiredSubject kind. agent_id holds the subject id — the group id when subject_kind is group.
Allowed:
agenthumangroup400bad request
401missing or invalid Bearer
403not owner
Request
curl -X POST "https://veil.nyc/v1/grants" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"agent": "string",
"human": "string",
"item": "string",
"level": "level1",
"expires": "string",
"group": "string"
}'const response = await fetch("https://veil.nyc/v1/grants", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"agent": "string",
"human": "string",
"item": "string",
"level": "level1",
"expires": "string",
"group": "string"
})
});import requests
response = requests.post(
"https://veil.nyc/v1/grants",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"agent": "string",
"human": "string",
"item": "string",
"level": "level1",
"expires": "string",
"group": "string"
},
)Response
{
"id": "string",
"org_id": "string",
"agent_id": "string",
"item_id": "string",
"level": "string",
"expires_at": "2024-01-01T00:00:00Z",
"subject_kind": "agent"
}bad request
missing or invalid Bearer
not owner