Skip to main content
POST
Import sessions from a Langfuse trace export

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Body

text
string
required

The Langfuse trace export as a JSON string.

Minimum string length: 1
versionId
string

Id of the Version the imported sessions belong to. Optional: when omitted, provide productId and the API reuses the product's latest version (creating a default first version if the product has none).

Example:

"ver_123"

productId
string

Id of the Product to anchor the import when versionId is omitted. Ignored when versionId is provided.

Example:

"prod_123"

originalFilename
string

Optional filename to associate with the upload. Defaults to "pasted_trace.json".

isProduction
boolean

Whether the imported sessions are production traffic. Defaults to true.

Response

Import accepted; poll the returned jobId for completion.

jobId
string
required

Id of the BullMQ job processing the import. Poll GET /jobs/{jobId}/status for state.

Example:

"job_abc123"

versionId
string
required

Id of the Version the imported sessions will belong to: the versionId sent in the request, or the version resolved from productId (issue #3011).

Example:

"ver_123"