Skip to contentSkip to page list

Docs

List grants

List the organization's grants, oldest first unless order=newest, each naming its principal (user, group or API key), role and scope. Filter by principal, role, scope or status; status is derived from expiresAt. Pages by cursor: pass nextCursor back as cursor until it is null.

GET/api/v1/grants
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/grants"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "Authorization": "Bearer " + api_key,}​response = requests.get(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "grants": [    {      "id": "string",      "principal": {        "type": "user",        "id": "string",        "name": "string"      },      "role": {        "id": "string",        "name": "string",        "builtIn": false      },      "scope": {        "type": "organization",        "id": "string",        "name": "string"      },      "status": "active",      "expiresAt": "2026-01-01T00:00:00Z",      "createdAt": "2026-01-01T00:00:00Z"    }  ],  "nextCursor": "string"}
api-reference/grants/list-grants

Authorization

Authorizationstringheaderrequired

Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.

Query parameters

principalTypestring
principalIdstring
At least 1 characterUp to 128 characters
roleIdstring
At least 1 characterUp to 128 characters
scopeTypestring
scopeIdstring
At least 1 characterUp to 128 characters
statusstring
limitinteger
Minimum 1Maximum 200
cursorstring
Pattern ^\d{1,16}\.[A-Za-z0-9_-]{1,256}$
orderstring

Responses

200

Success

application/json

grantsobject[]required
idstringrequired
principalobjectrequired
roleobjectrequired
scopeobjectrequired
statusstringrequired
One of"active""expired"
expiresAtstring (date-time) | nullrequired
createdAtstring (date-time)required
nextCursorstring | nullrequired

Documentation