> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore session into workspace

> Replay a session's sync events into the target workspace in batches.



## OpenAPI

````yaml /openapi.json post /experimental/workspace/{id}/session-restore
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /experimental/workspace/{id}/session-restore:
    post:
      summary: Restore session into workspace
      description: Replay a session's sync events into the target workspace in batches.
      operationId: experimental.workspace.sessionRestore
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
        - in: path
          name: id
          schema:
            type: string
            pattern: ^wrk.*
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionID:
                  type: string
                  pattern: ^ses.*
              required:
                - sessionID
      responses:
        '200':
          description: Session replay started
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                required:
                  - total
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.experimental.workspace.sessionRestore({
              ...
            })
components:
  schemas:
    BadRequestError:
      type: object
      properties:
        data: {}
        errors:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
        success:
          type: boolean
          const: false
      required:
        - data
        - errors
        - success

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.