Skip to main content
POST
Create an ingestion API key

Authorizations

X-Auth-Token
string
header
required

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.

Body

application/json
name
string
required

Human-readable name for this key

Required string length: 1 - 100
keyType
enum<string>
default:personal

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

Available options:
personal,
service
description
string
Maximum string length: 500
expiresAt
string<date-time>

ISO 8601 timestamp after which the key stops working

assignedToUserId
string

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

Minimum string length: 1
permissionMode
enum<string>
default:all

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

Available options:
all,
readonly,
restricted
permissions
string[]

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

Pattern: ^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$
bindings
object[]

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

Maximum array length: 20
projectIds
string[]

Service keys only: restricts the key to these projects

Maximum array length: 50
Minimum string length: 1

Response

Success

token
string
required
Minimum string length: 1
apiKey
object
required
Last modified on October 12, 2026