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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# List Poll

> Wait for the next call and cancel frames of a registered instance, up to 25 seconds, then answer with what is waiting or with an empty list. Each poll refreshes the instance presence, so a process that polls reads Online. Addressed with the instance token in the X-Agent-Instance-Token header.



## OpenAPI

````yaml GET /api/v1/agents/connect/poll
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/v1/agents/connect/poll:
    get:
      tags:
        - Agents
      description: >-
        Wait for the next call and cancel frames of a registered instance, up to
        25 seconds, then answer with what is waiting or with an empty list. Each
        poll refreshes the instance presence, so a process that polls reads
        Online. Addressed with the instance token in the X-Agent-Instance-Token
        header.
      operationId: pollConnectedAgentInstance
      responses:
        '200':
          description: The frames waiting for the instance, possibly none
          content:
            application/json:
              schema:
                type: object
                properties:
                  frames:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            protocol:
                              type: number
                              const: 1
                            type:
                              type: string
                              const: call
                            callId:
                              type: string
                            agentId:
                              type: string
                            threadId:
                              type: string
                            messages:
                              type: array
                              items:
                                type: object
                                properties:
                                  role:
                                    type: string
                                    minLength: 1
                                required:
                                  - role
                                additionalProperties: true
                            newMessages:
                              type: array
                              items:
                                type: object
                                properties:
                                  role:
                                    type: string
                                    minLength: 1
                                required:
                                  - role
                                additionalProperties: true
                            params:
                              type: object
                              propertyNames:
                                type: string
                                pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                              additionalProperties:
                                anyOf:
                                  - type: string
                                  - type: number
                                  - type: boolean
                            session: {}
                            traceparent:
                              type:
                                - string
                                - 'null'
                            deadlineAt:
                              type: integer
                            run:
                              type: object
                              properties:
                                scenarioRunId:
                                  type: string
                                scenarioName:
                                  type: string
                                batchRunId:
                                  type: string
                          required:
                            - protocol
                            - type
                            - callId
                            - agentId
                            - threadId
                            - messages
                            - newMessages
                            - params
                            - traceparent
                            - deadlineAt
                            - run
                        - type: object
                          properties:
                            protocol:
                              type: number
                              const: 1
                            type:
                              type: string
                              const: cancel
                            callId:
                              type: string
                              minLength: 1
                          required:
                            - protocol
                            - type
                            - callId
                    description: >-
                      The call and cancel frames waiting for the instance; empty
                      once the poll wait passes with none.
                required:
                  - frames
        '401':
          description: 'The API key is not valid: a refused frame'
        '410':
          description: The instance token is not known; register the instance again
      security:
        - project_api_key: []
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````