Skip to contentSkip to page list

Docs

Get a grant

Read one grant. An id outside the caller's organization answers 404 grant_not_found.

GET/api/v1/grants/{grantId}
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/grants/<grantId>"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

{  "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"}
api-reference/grants/get-a-grant

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}.

Path parameters

grantIdstringrequired
At least 1 characterUp to 128 characters

Responses

200

Success

application/json

idstringrequired
principalobjectrequired
typestringrequired
One of"user""group""apiKey"
idstringrequired
namestring | nullrequired
roleobjectrequired
idstringrequired
namestring | nullrequired
builtInbooleanrequired
scopeobjectrequired
typestringrequired
One of"organization""team""project"
idstringrequired
namestring | nullrequired
statusstringrequired
One of"active""expired"
expiresAtstring (date-time) | nullrequired
Option 1string (date-time)
Option 2null
createdAtstring (date-time)required

Documentation