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

# Share session

> Create a shareable link for a session, allowing others to view the conversation.



## OpenAPI

````yaml /openapi.json post /session/{sessionID}/share
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /session/{sessionID}/share:
    post:
      summary: Share session
      description: >-
        Create a shareable link for a session, allowing others to view the
        conversation.
      operationId: session.share
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
        - in: path
          name: sessionID
          schema:
            type: string
            pattern: ^ses.*
          required: true
      responses:
        '200':
          description: Successfully shared session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.session.share({
              ...
            })
components:
  schemas:
    Session:
      type: object
      properties:
        id:
          type: string
          pattern: ^ses.*
        slug:
          type: string
        projectID:
          type: string
        workspaceID:
          type: string
          pattern: ^wrk.*
        directory:
          type: string
        parentID:
          type: string
          pattern: ^ses.*
        forkedFrom:
          type: string
          pattern: ^ses.*
        summary:
          type: object
          properties:
            additions:
              type: number
            deletions:
              type: number
            files:
              type: number
            diffs:
              type: array
              items:
                $ref: '#/components/schemas/SnapshotFileDiff'
          required:
            - additions
            - deletions
            - files
        share:
          type: object
          properties:
            url:
              type: string
          required:
            - url
        title:
          type: string
        tags:
          default: []
          type: array
          items:
            type: string
        version:
          type: string
        time:
          type: object
          properties:
            created:
              type: number
            updated:
              type: number
            compacting:
              type: number
            archived:
              type: number
          required:
            - created
            - updated
        permission:
          $ref: '#/components/schemas/PermissionRuleset'
        revert:
          type: object
          properties:
            messageID:
              type: string
              pattern: ^msg.*
            partID:
              type: string
              pattern: ^prt.*
            snapshot:
              type: string
            checkpointId:
              type: string
            diff:
              type: string
          required:
            - messageID
      required:
        - id
        - slug
        - projectID
        - directory
        - title
        - version
        - time
    BadRequestError:
      type: object
      properties:
        data: {}
        errors:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
        success:
          type: boolean
          const: false
      required:
        - data
        - errors
        - success
    NotFoundError:
      type: object
      properties:
        name:
          type: string
          const: NotFoundError
        data:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - name
        - data
    SnapshotFileDiff:
      type: object
      properties:
        file:
          type: string
        patch:
          type: string
        additions:
          type: number
        deletions:
          type: number
        status:
          type: string
          enum:
            - added
            - deleted
            - modified
      required:
        - file
        - patch
        - additions
        - deletions
    PermissionRuleset:
      type: array
      items:
        $ref: '#/components/schemas/PermissionRule'
    PermissionRule:
      type: object
      properties:
        permission:
          type: string
        pattern:
          type: string
        action:
          $ref: '#/components/schemas/PermissionAction'
      required:
        - permission
        - pattern
        - action
    PermissionAction:
      type: string
      enum:
        - allow
        - deny
        - ask

````

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