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

# Get the session log

> The settled record of a migration: what was planned, which files went
in, who approved what, how many rows were written, and whether existing
rows were replaced.

Intended to be fetched once and stored, so you can explain a migration
to your own customer later. It does **not** include the conversation
transcript — that is `/thread` — and it does not include individual row
values.

Available once nothing is in flight, including for migrations that
failed: a run can write rows and then fail, which is exactly when this
matters. While a run is active the endpoint returns `409`.

Pass `?format=md` for the same record as a readable Markdown report.

A migration can be imported again later, so the log always covers every
run to date — a re-fetch is a superset of an earlier one. Use
`generated_at` to tell snapshots apart.




## OpenAPI

````yaml /api-reference/openapi.json get /migrations/{migration_id}/log
openapi: 3.1.0
info:
  title: Vern Migration API
  version: 1.0.0
  description: >-
    Run Vern as a headless migration engine. Create a migration, upload a
    customer's files, run the managed agent to generate a preview, then execute
    and export clean data. See the Migration API guides for concepts and
    walkthroughs.
servers:
  - url: https://app.vern.so/api/v1
security:
  - apiKey: []
tags:
  - name: Catalog
    description: Discover the sources and templates you set up in the Vern UI.
  - name: Migrations
    description: Create a migration workspace and upload a customer's files.
  - name: Runs
    description: 'Drive the managed agent: generate, refine, execute, answer, and observe.'
  - name: Export
    description: Download a migration's validated data as CSV.
  - name: Log
    description: The settled record of what a migration did.
  - name: Knowledge
    description: Durable context the agent reads before every run.
  - name: Exports
    description: Download imported data.
  - name: Extractions
    description: >-
      Turn an unstructured file into structured data, without running a
      migration.
paths:
  /migrations/{migration_id}/log:
    parameters:
      - $ref: '#/components/parameters/MigrationId'
    get:
      tags:
        - Log
      summary: Get the session log
      description: |
        The settled record of a migration: what was planned, which files went
        in, who approved what, how many rows were written, and whether existing
        rows were replaced.

        Intended to be fetched once and stored, so you can explain a migration
        to your own customer later. It does **not** include the conversation
        transcript — that is `/thread` — and it does not include individual row
        values.

        Available once nothing is in flight, including for migrations that
        failed: a run can write rows and then fail, which is exactly when this
        matters. While a run is active the endpoint returns `409`.

        Pass `?format=md` for the same record as a readable Markdown report.

        A migration can be imported again later, so the log always covers every
        run to date — a re-fetch is a superset of an earlier one. Use
        `generated_at` to tell snapshots apart.
      operationId: getSessionLog
      parameters:
        - name: format
          in: query
          schema:
            type: string
            enum:
              - json
              - md
              - markdown
            default: json
      responses:
        '200':
          description: The session log.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionLog'
            text/markdown:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/MigrationNotFound'
        '409':
          description: >-
            The migration is still in progress. Body carries the current
            `status` and `retry_after_seconds`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    properties:
                      status:
                        $ref: '#/components/schemas/MigrationStatus'
                      retry_after_seconds:
                        type: integer
                        example: 30
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          description: The log could not be assembled. Retryable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    MigrationId:
      name: migration_id
      in: path
      required: true
      description: The migration ID returned by Create a migration.
      schema:
        type: string
        format: uuid
      example: c0a8012e-4f1b-4d3a-9b2c-7e6f5a4b3c2d
  schemas:
    SessionLog:
      type: object
      properties:
        migration_id:
          type: string
        generated_at:
          type: string
        status:
          $ref: '#/components/schemas/MigrationStatus'
        covers:
          type: object
          properties:
            runs:
              type: integer
            from:
              type: string
              nullable: true
            to:
              type: string
              nullable: true
        runs:
          type: array
          items:
            $ref: '#/components/schemas/SessionLogRun'
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable error message.
      required:
        - error
    MigrationStatus:
      type: string
      enum:
        - awaiting_files
        - ready
        - awaiting_approval
        - completed
      description: |
        - `awaiting_files` — no files uploaded and no source connection
        - `ready` — inputs present, no plan yet
        - `awaiting_approval` — a preview is waiting to be executed
        - `completed` — an import has run successfully
    SessionLogRun:
      type: object
      properties:
        run_id:
          type: string
        kind:
          type: string
          description: '`generate`, `update`, `reuse`, `clarify` or `execute`.'
        status:
          type: string
        started_at:
          type: string
          nullable: true
        completed_at:
          type: string
          nullable: true
        started_by:
          type: string
          nullable: true
          description: Null when the run was started through this API.
        files:
          type: array
          items:
            type: string
        plan:
          type: string
          nullable: true
        questions:
          type: array
          items:
            type: object
        answers:
          type: object
        outcome:
          type: object
          nullable: true
          properties:
            ok:
              type: boolean
              nullable: true
            rows_written:
              type: integer
              nullable: true
            per_sheet:
              type: array
              items:
                type: object
                properties:
                  sheet:
                    type: string
                    nullable: true
                  rows:
                    type: integer
                    nullable: true
            invalid_rows:
              type: integer
              nullable: true
            error:
              type: string
              nullable: true
            replaced_existing_data:
              type: boolean
              description: >-
                True when this run emptied its destination sheets before writing
                — it replaced the previous import rather than adding to it.
        audit:
          type: array
          description: Who did what, in order.
          items:
            type: object
            properties:
              at:
                type: string
              event:
                type: string
                enum:
                  - started
                  - resumed
                  - templates_adjusted
                  - plan_approved
                  - unknown
              actor:
                type: string
                nullable: true
              mode:
                type: string
              answers_excerpt:
                type: string
              changes:
                type: array
                items:
                  type: object
              plan:
                type: string
  responses:
    Unauthorized:
      description: API key missing, malformed, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MigrationNotFound:
      description: >-
        No migration with this id in your organisation. Returned rather than
        `403` so the existence of another organisation's migration is not
        disclosed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit hit — back off and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Vern API key. Create one at Settings → API keys.

````