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

# Stream migration progress

> Server-Sent Events stream of live run state — the same feed the StagingPro UI uses for its progress bar.

The stream emits a `state` event immediately, another on every engine update, and a single `end` event when the run reaches a terminal status. A run that has already finished receives `end` straight away, so the stream always closes cleanly. Comment pings keep the connection alive.

```js
const es = new EventSource('/v2/api/bc-migration/migrations/' + id + '/stream');
es.addEventListener('state', (e) => render(JSON.parse(e.data)));
es.addEventListener('end', () => es.close());
```



## OpenAPI

````yaml vortex-apps/staging-pro/api/openapi.json GET /migrations/{id}/stream
openapi: 3.1.0
info:
  title: StagingPro V2 Migration API (BigCommerce)
  version: 2.0.0
  description: >-
    REST API for the StagingPro V2 BC Migration app. Browse a connected store's
    catalogue, size a migration before you run it, launch bulk or selective
    store-to-store migrations, control runs, and follow live progress.


    All endpoints are served from `https://app.vortexiq.ai/v2/api/bc-migration`
    and are scoped to your organisation. Authenticate with a bearer token from
    the Login endpoint (scripts and services) or your signed-in session
    (browser). See
    [Authentication](/vortex-apps/staging-pro/api/authentication).
  contact:
    name: Vortex IQ Support
    url: https://www.vortexiq.ai/contact-us
servers:
  - url: https://app.vortexiq.ai/v2/api/bc-migration
    description: Vortex IQ platform (production)
security:
  - sessionAuth: []
  - bearerAuth: []
tags:
  - name: Authentication
    description: >-
      Exchange your identity and your organisation's API credential for a bearer
      token.
  - name: Migrations
    description: >-
      Create migrations, list history, read run detail and per-item issues, and
      follow live progress.
  - name: Migration Controls
    description: Pause, resume, cancel, and verify-only re-runs.
  - name: Counts & Forecast
    description: Size a migration before launching it. Neither endpoint creates a run.
paths:
  /migrations/{id}/stream:
    get:
      tags:
        - Migrations
      summary: Stream migration progress (SSE)
      description: >-
        Server-Sent Events stream of live run state — the same feed the
        StagingPro UI uses for its progress bar.


        The stream emits a `state` event immediately, another on every engine
        update, and a single `end` event when the run reaches a terminal status.
        A run that has already finished receives `end` straight away, so the
        stream always closes cleanly. Comment pings keep the connection alive.


        ```js

        const es = new EventSource('/v2/api/bc-migration/migrations/' + id +
        '/stream');

        es.addEventListener('state', (e) => render(JSON.parse(e.data)));

        es.addEventListener('end', () => es.close());

        ```
      operationId: streamMigration
      parameters:
        - $ref: '#/components/parameters/MigrationId'
      responses:
        '200':
          description: >-
            SSE stream (`text/event-stream`). Each `state` event carries a
            run-detail JSON payload.
          content:
            text/event-stream:
              schema:
                type: string
              example: >+
                event: state

                data:
                {"requestId":"5A3C…","status":"in_progress","progress":{"phase":"products","percent":42}}


                event: end

                data: {}

        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    MigrationId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The migration request id returned by Create migration.
      example: 5A3C1B2E-7F4D-4E6A-9B8C-0D1E2F3A4B5C
  responses:
    Forbidden:
      description: >-
        Store Migration is not enabled for your organisation. Requests with no
        valid bearer token or session return `401` instead.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Store Migration is not enabled for this organization.
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable explanation.
        status:
          type: integer
          description: 'Present on `bc_error`: the status BigCommerce returned.'
        errors:
          type: object
          additionalProperties: true
          description: 'Present on validation failures: field-level messages.'
  securitySchemes:
    sessionAuth:
      type: apiKey
      in: cookie
      name: vortexiq_session
      description: >-
        Your signed-in Vortex IQ session (browser calls). Requests are scoped to
        your organisation, which must have Store Migration enabled. For
        server-to-server calls use a bearer token instead — see
        [Authentication](/vortex-apps/staging-pro/api/authentication).
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A bearer token from [Login](/vortex-apps/staging-pro/api/login). Valid
        for 10 days; scoped to the user and organisation it was issued for.
        Rotating or disabling the organisation's API credential immediately
        invalidates all outstanding tokens.

````