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

# Create Connection

> Create a new connection for an AI Agent to start a voice conversation



## OpenAPI

````yaml openapi.json post /v1/connections
openapi: 3.1.0
info:
  title: Trata AI API
  description: >-
    Human like conversation to answer calls, drive engagement, automate
    follow-ups & schedule bookings 24/7  with end to end integrations ensuring
    you never miss a sales enquiry.
  version: 1.0.0
servers:
  - url: https://api.trata.ai
    description: Production
  - url: http://localhost:8000
    description: Development
security: []
paths:
  /v1/connections:
    post:
      tags:
        - Data Plane
      summary: Create Connection
      description: Create a new connection for an AI Agent to start a voice conversation
      operationId: createConnection
      parameters:
        - name: agentId
          in: query
          required: true
          schema:
            type: string
            title: Agentid
        - name: prospect_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Prospect Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectionSource'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ConnectionSource:
      properties:
        sourceName:
          type: string
          enum:
            - TWILIO
            - PLIVO
            - BROWSER
          maxLength: 512
          minLength: 1
          title: Sourcename
          description: Name of the source
          default: BROWSER
          example: TWILIO
        sourceId:
          type: string
          maxLength: 512
          minLength: 1
          title: Sourceid
          description: Unique identifier for the source
          example: id_123
        sourceProps:
          type: object
          maxProperties: 512
          minProperties: 0
          title: Sourceprops
          description: Extra properties of source
          example: Browser
      type: object
      required:
        - sourceId
        - sourceProps
      title: ConnectionSource
    Connection:
      properties:
        id:
          type: string
          title: Id
        orgId:
          type: string
          title: Orgid
        sourceName:
          type: string
          title: Sourcename
        sourceId:
          type: string
          title: Sourceid
        sourceProps:
          anyOf:
            - type: object
            - type: 'null'
          title: Sourceprops
        agentId:
          type: string
          title: Agentid
        prospectId:
          anyOf:
            - type: string
            - type: 'null'
          title: Prospectid
        createdBy:
          type: string
          title: Createdby
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedBy:
          type: string
          title: Updatedby
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      title: Connection
      description: This represents the connection between the user and the assistant
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````