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

# Create Conversation (Browser / Chat)

> Create a conversation record for a browser (WebRTC) or chat session. This does not place a phone call: use `POST /agents/{agent_id}/calls` (or the agent's API trigger), which takes `phone_number` and `initial_context`.



## OpenAPI

````yaml /api-reference/openapi.en.json post /api/v1/agents/{agent_id}/conversations
openapi: 3.1.0
info:
  title: Brosbots API
  description: >
    The public Brosbots REST API. Build and manage voice agents, run outbound

    campaigns, read calls and usage, and manage phone numbers, tools,

    knowledge bases and integrations.


    ## Authentication


    Every request must include your organization's API key in the

    `X-API-Key` header:


    ```

    X-API-Key: bb_live_...

    ```


    You create and revoke keys in the dashboard:

    click your account in the bottom-left corner of the sidebar, then **Brosbots
    API**.


    ## Base URL


    ```

    https://app.brosbots.com/api/v1

    ```


    ## Conventions


    - Request and response bodies are JSON (`Content-Type: application/json`).

    - Timestamps are ISO 8601 with a timezone.

    - Lists are paginated with `page` / `limit` parameters; responses include
      `total_count` / `total_pages`.
    - Errors use standard HTTP status codes with a JSON body:
      `{"detail": "a human-readable reason"}`.
    - `{agent_id}` accepts the agent's public ID (`agent_...`) or its number.


    ## Limits


    There is no fixed per-key request-rate limit today. `429` comes from the

    calling endpoints (`POST /agents/{agent_id}/calls` and

    `POST /triggers/{trigger_id}/calls`) when every outbound channel is busy;
    its `Retry-After` header says how many seconds to wait. Handle `429`

    generally: wait as long as `Retry-After` says, or back off exponentially
    when

    it is absent. A request-rate limit may be introduced.
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/v1/agents/{agent_id}/conversations:
    post:
      tags:
        - Agents & Calls
      summary: Create Conversation (Browser / Chat)
      description: >-
        Create a conversation record for a browser (WebRTC) or chat session.
        This does not place a phone call: use `POST /agents/{agent_id}/calls`
        (or the agent's API trigger), which takes `phone_number` and
        `initial_context`.
      operationId: post_agents_agent_id_conversations
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                pattern: ^agent_[A-Za-z0-9]{20}$
              - type: integer
            examples:
              - agent_7fK2mQ9xLp3RtV8wYb1N
              - 42
          description: >-
            The agent's ID: the public `agent_` + 20 characters identifier shown
            in the dashboard (recommended), or the legacy number. Both address
            the same agent.
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConversationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateConversationResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateConversationRequest:
      properties:
        mode:
          type: string
          description: >-
            Where the conversation will take place. `webrtc` or `smallwebrtc`
            for a voice session in the browser (what the dashboard's test call
            uses), `chat` for a text session. Telephony values are accepted for
            compatibility but only create a record - to place a phone call use
            POST /agents/{agent_id}/calls.
          examples:
            - webrtc
        name:
          type: string
          description: Your label for the conversation.
          examples:
            - test-1
        initial_context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Variables the agent can use as {{initial_context.<key>}} in its
            prompts. Merged over the agent's own default variables.
          examples:
            - first_name: Anna
      type: object
      required:
        - mode
        - name
      title: CreateConversationRequest
      description: >-
        A conversation record for a browser or chat session. It does not dial
        anyone.
    CreateConversationResponse:
      properties:
        id:
          type: integer
        workflow_id:
          type: integer
        name:
          type: string
        mode:
          type: string
        created_at:
          type: string
          format: date-time
        definition_id:
          type: integer
        initial_context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
      type: object
      required:
        - id
        - workflow_id
        - name
        - mode
        - created_at
        - definition_id
      title: CreateConversationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your organization's API key (account in the bottom-left of the dashboard
        → Brosbots API).

````

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