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

# Create Frames

> Post the ack, result and deregister frames of a registered instance. Addressed with the instance token in the X-Agent-Instance-Token header.



## OpenAPI

````yaml POST /api/v1/agents/connect/frames
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/frames:
    post:
      tags:
        - Agents
      description: >-
        Post the ack, result and deregister frames of a registered instance.
        Addressed with the instance token in the X-Agent-Instance-Token header.
      operationId: postConnectedAgentFrames
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                frames:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          protocol:
                            type: number
                            enum:
                              - 1
                          type:
                            type: string
                            enum:
                              - ack
                          callId:
                            type: string
                            minLength: 1
                        required:
                          - protocol
                          - type
                          - callId
                        additionalProperties: false
                      - type: object
                        properties:
                          protocol:
                            type: number
                            enum:
                              - 1
                          type:
                            type: string
                            enum:
                              - result
                          callId:
                            type: string
                            minLength: 1
                          output:
                            anyOf:
                              - type: string
                              - type: object
                                properties:
                                  role:
                                    type: string
                                    minLength: 1
                                required:
                                  - role
                                additionalProperties: true
                              - type: array
                                items:
                                  type: object
                                  properties:
                                    role:
                                      type: string
                                      minLength: 1
                                  required:
                                    - role
                                  additionalProperties: true
                          session: {}
                          error:
                            type: object
                            properties:
                              code:
                                type: string
                                minLength: 1
                                maxLength: 64
                              message:
                                type: string
                                maxLength: 4000
                            required:
                              - code
                              - message
                            additionalProperties: false
                        required:
                          - protocol
                          - type
                          - callId
                        additionalProperties: false
                      - type: object
                        properties:
                          protocol:
                            type: number
                            enum:
                              - 1
                          type:
                            type: string
                            enum:
                              - deregister
                        required:
                          - protocol
                          - type
                        additionalProperties: false
                  minItems: 1
                  maxItems: 100
                  description: Ack, result and deregister frames, in order.
              required:
                - frames
              additionalProperties: false
      responses:
        '200':
          description: The frames were taken
          content:
            application/json:
              schema:
                type: object
                properties:
                  accepted:
                    type: integer
                    description: How many frames were taken.
                required:
                  - accepted
        '401':
          description: 'The API key is not valid: a refused frame'
        '410':
          description: The instance token is not known; register the instance again
        '422':
          description: A frame is not one the endpoint takes
      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.

````