Skip to contentSkip to page list

Docs

Create a full-access API key

Mint the caller's own API key for the project their sign-in session is bound to, as langwatch login --project does: it can do everything the caller can do in that project (prompts, datasets, evaluations, simulations, traces). Only one shape is accepted: keyType "personal", owned by the caller, one ADMIN binding to that project and permissionMode "all". Name it after the machine; omit expiresAt for a key that never expires. Requires a person's project session holding project:manage; an API key cannot mint one.

POST/api/v1/api-keys/full-access
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/api-keys/full-access"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,    "Content-Type": "application/json",}payload = {}​response = requests.post(    origin + path,    headers=headers,    json=payload,)print(response.json())

Success

application/json · Generated from schema

{  "token": "string",  "apiKey": {    "id": "string",    "name": "string",    "createdAt": "2026-01-01T00:00:00Z"  }}
api-reference/api-keys/create-a-full-access-api-key

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Request body

application/json · Required

keyTypestring

A personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.

One of"personal""service"
Default: "personal"
namestringrequired

Human-readable name for this key

At least 1 characterUp to 100 characters
descriptionstring
Up to 500 characters
expiresAtstring (date-time)

ISO 8601 timestamp after which the key stops working

assignedToUserIdstring

Organization admins only: the member who owns the key and whose access caps it. Defaults to the caller.

At least 1 character
permissionModestring

'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list.

One of"all""readonly""restricted"
Default: "all"
permissionsstring[]

Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant.

bindingsobject[]

What this key may do, and where. Required for a personal key.

rolestringrequired

CUSTOM grants exactly the listed permissions and requires permissionMode 'restricted'.

One of"ADMIN""MEMBER""VIEWER""CUSTOM"
scopeTypestringrequired
One of"ORGANIZATION""TEAM""PROJECT"
scopeIdstringrequired
At least 1 character
projectIdsstring[]

Service keys only: restricts the key to these projects

Responses

201

Success

application/json

tokenstringrequired
At least 1 character
apiKeyobjectrequired
idstringrequired
At least 1 character
namestringrequired
createdAtstring (date-time)required
401

Invalid or missing API key token

403

The caller is not a person's sign-in session, lacks project:manage, or asked for any other shape (api_key_scope_violation)

422

Validation error (validation_error)

Documentation