Skip to Content
kosemdocs
ReferenceAPIAgents

Grant agent access

Grants or updates access profiles (with optional narrowing scope and expiry) and secrets on an agent. Takes agents.secretGrants.create on the agent plus the caller's own issue/access permission on each target, and enforces agents.maxGrantTtl. Returns the agent's current grants.

POST
/v1/projects/{project}/agents/{agent}/grants

Grants or updates access profiles (with optional narrowing scope and expiry) and secrets on an agent.

Takes agents.secretGrants.create on the agent plus the caller's own issue/access permission on each target, and enforces agents.maxGrantTtl. Returns the agent's current grants.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
agent*string

The agent's ID.

Match^ags_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
grants*array<>

Access profiles or secrets to grant or update on the agent.

Items1 <= items <= 100

Response Body

OK

application/json
  1. response
grants*array<>

Grants held by the agent, oldest first.

Example Request
curl -X POST 'https://api.kosem.ai/v1/projects/string/agents/string/grants' \
  -H 'Content-Type: application/json' \
  -d '{
  "grants": [
    {
      "target": "string"
    }
  ]
}'
Example Response
{
  "grants": [
    {
      "alias": "string",
      "createTime": "2019-08-24T14:15:22Z",
      "expireTime": "2019-08-24T14:15:22Z",
      "grantor": "string",
      "id": "string",
      "lastUsedTime": "2019-08-24T14:15:22Z",
      "provider": "string",
      "scope": {
        "property1": null,
        "property2": null
      },
      "target": "string",
      "targetKind": "ACCESS_PROFILE",
      "useCount": 0
    }
  ]
}