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

# List control requests

> List pending SDK control-channel requests for a session.



## OpenAPI

````yaml /openapi.json get /session/{sessionID}/control-requests
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /session/{sessionID}/control-requests:
    get:
      tags:
        - Session
      summary: List control requests
      description: List pending SDK control-channel requests for a session.
      operationId: session.controlChannel.list
      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: Pending control requests
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ControlRequest'
        '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.controlChannel.list({
              ...
            })
components:
  schemas:
    ControlRequest:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ControlRequestID'
        sessionID:
          type: string
          pattern: ^ses.*
        subtype:
          $ref: '#/components/schemas/ControlSubtype'
        payload:
          $ref: '#/components/schemas/ControlPayload'
        createdAt:
          type: number
        timeoutMs:
          type: number
      required:
        - id
        - sessionID
        - subtype
        - payload
        - createdAt
        - timeoutMs
    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
    ControlRequestID:
      type: string
      format: uuid
      pattern: >-
        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
    ControlSubtype:
      type: string
      enum:
        - can_use_tool
        - hook_callback
        - elicitation
        - mcp_message
    ControlPayload:
      type: object
      propertyNames:
        type: string
      additionalProperties: {}

````

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