> ## 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.

# Replay sync events

> Validate and replay a complete sync event history.



## OpenAPI

````yaml /openapi.json post /sync/replay
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /sync/replay:
    post:
      summary: Replay sync events
      description: Validate and replay a complete sync event history.
      operationId: sync.replay
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                directory:
                  type: string
                events:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      aggregateID:
                        type: string
                      seq:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      type:
                        type: string
                      data:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - id
                      - aggregateID
                      - seq
                      - type
                      - data
              required:
                - directory
                - events
      responses:
        '200':
          description: Replayed sync events
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionID:
                    type: string
                required:
                  - sessionID
        '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.sync.replay({
              ...
            })
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.