> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Import sessions from a Langfuse LangGraph 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`.



## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /sessions/import
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /sessions/import:
    post:
      tags:
        - sessions
      summary: Import sessions from a Langfuse LangGraph trace export
      description: >-
        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`.
      operationId: importSessions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraceImportText'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TraceImportUpload'
      responses:
        '202':
          description: Import accepted; poll the returned jobId for completion.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceImportResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Uploaded file exceeds the 25MB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    TraceImportText:
      type: object
      properties:
        text:
          type: string
          minLength: 1
          description: The Langfuse trace export as a JSON string.
        versionId:
          type: string
          description: Id of the Version the imported sessions belong to.
          example: ver_123
        originalFilename:
          type: string
          description: >-
            Optional filename to associate with the upload. Defaults to
            "pasted_trace.json".
        isProduction:
          type: boolean
          description: >-
            Whether the imported sessions are production traffic. Defaults to
            true.
      required:
        - text
        - versionId
    TraceImportUpload:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: The Langfuse trace export (JSON/JSONL/CSV). Max 25MB.
        versionId:
          type: string
          description: Id of the Version the imported sessions belong to.
          example: ver_123
        isProduction:
          type: string
          enum:
            - 'true'
            - 'false'
          description: >-
            Whether the imported sessions are production traffic. Defaults to
            "true".
      required:
        - file
        - versionId
    TraceImportResponse:
      type: object
      properties:
        jobId:
          type: string
          description: >-
            Id of the BullMQ job processing the import. Poll `GET
            /jobs/{jobId}/status` for state.
          example: job_abc123
      required:
        - jobId
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        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-...`.

````