Skip to main content
POST
/
api
/
v1
/
contexts
/
{context_id}
/
token
Generate Context Token
curl --request POST \
  --url https://api.example.com/api/v1/contexts/{context_id}/token \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "grant_global_permissions": {
    "files": [
      "read"
    ],
    "feedback": [
      "<string>"
    ],
    "vector_stores": [
      "read"
    ],
    "llm": [
      "<string>"
    ],
    "embeddings": [
      "<string>"
    ],
    "model_providers": [
      "read"
    ],
    "a2a_proxy": [
      "<string>"
    ],
    "providers": [
      "read"
    ],
    "provider_variables": [
      "read"
    ],
    "contexts": [
      "read"
    ],
    "context_data": [
      "read"
    ],
    "connectors": [
      "read"
    ]
  },
  "grant_context_permissions": {
    "files": [
      "read"
    ],
    "vector_stores": [
      "read"
    ],
    "context_data": [
      "read"
    ]
  }
}
'
{
  "token": "<string>",
  "expires_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

context_id
string<uuid>
required

Body

application/json
grant_global_permissions
GlobalPermissionGrant · object

Global permissions granted by the token. Must be subset of the users permissions

grant_context_permissions
ContextPermissionsGrant · object

Context permissions granted by the token. Must be subset of the users permissions

Response

Successful Response

Response schema for context token generation.

token
string
required
expires_at
string<date-time> | null
required