Import sessions from a Langfuse trace export
Imports production traces from a Langfuse export. The content is handed to a background BullMQ job; the response is the jobId to poll on GET /jobs/{jobId}/status. Semantic validation (Langfuse shape, drop rules) happens in the job, so a syntactically valid upload is accepted with 202 and rejections surface as failed job state. Send EITHER multipart/form-data with a file OR application/json with a text string — exactly one. isProduction defaults to true. versionId is optional: when omitted, provide productId and the API reuses the product’s latest version (creating a default first version if the product has none). One of versionId or productId is required.
Authorizations
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
The Langfuse trace export as a JSON string.
1Id 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).
"ver_123"
Id of the Product to anchor the import when versionId is omitted. Ignored when versionId is provided.
"prod_123"
Optional filename to associate with the upload. Defaults to "pasted_trace.json".
Whether the imported sessions are production traffic. Defaults to true.
Response
Import accepted; poll the returned jobId for completion.
Id of the BullMQ job processing the import. Poll GET /jobs/{jobId}/status for state.
"job_abc123"
Id of the Version the imported sessions will belong to: the versionId sent in the request, or the version resolved from productId (issue #3011).
"ver_123"