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

# Create WebRTC agent routing code

> Creates a code that lets WebRTC clients connect to your agent.



## OpenAPI

````yaml https://app.goguava.ai/openapi.json post /v1/webrtc/codes
openapi: 3.1.0
info:
  title: Guava API Server
  version: guava-release-0.51.0
servers:
  - url: https://app.goguava.ai
security: []
paths:
  /v1/webrtc/codes:
    post:
      tags:
        - WebRTC
      summary: Create WebRTC agent routing code
      description: Creates a code that lets WebRTC clients connect to your agent.
      operationId: create_webrtc_agent_v1_webrtc_codes_post
      parameters:
        - name: expires_in
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            description: >-
              Lifetime of the code in seconds. If omitted, the code never
              expires.
            title: Expires In
          description: Lifetime of the code in seconds. If omitted, the code never expires.
        - name: label
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 200
              - type: 'null'
            description: Human-readable label for the code.
            title: Label
          description: Human-readable label for the code.
        - name: require_token
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, clients must present a token to connect, not just the
              code.
            default: false
            title: Require Token
          description: If true, clients must present a token to connect, not just the code.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebRTCAgentCodeResponse'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
components:
  schemas:
    WebRTCAgentCodeResponse:
      properties:
        webrtc_code:
          type: string
          title: Webrtc Code
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        require_token:
          type: boolean
          title: Require Token
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - webrtc_code
        - label
        - require_token
        - created_at
        - expires_at
      title: WebRTCAgentCodeResponse
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKey:
      type: http
      description: 'A Guava API key, sent as `Authorization: Bearer <key>`.'
      scheme: bearer

````

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