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

# Create Call

> Create call.



## OpenAPI

````yaml /openapi.json post /v1/calls
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.bey.dev
security: []
paths:
  /v1/calls:
    post:
      tags:
        - Calls
      summary: Create Call
      description: Create call.
      operationId: create_call_v1_calls_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCallRequest'
      responses:
        '201':
          description: Created Call with ID and LiveKit connection details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretCallResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateCallRequest:
      properties:
        agent_id:
          type: string
          title: Agent Id
          description: ID of agent managing the call.
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          title: User Name
          description: Name of the user.
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          title: User Email
          description: Email of the user.
        tags:
          additionalProperties:
            type: string
            maxLength: 100
            minLength: 1
          propertyNames:
            maxLength: 30
            minLength: 1
          type: object
          maxProperties: 10
          title: Tags
          description: Tags for the call
      type: object
      required:
        - agent_id
      title: CreateCallRequest
      description: Request body to create a call.
    SecretCallResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the object in the database.
          examples:
            - 01234567-89ab-cdef-0123-456789abcdef
        agent_id:
          type: string
          title: Agent Id
          description: ID of agent managing the call.
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          title: User Name
          description: Name of the user.
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          title: User Email
          description: Email of the user.
        tags:
          additionalProperties:
            type: string
            maxLength: 100
            minLength: 1
          propertyNames:
            maxLength: 30
            minLength: 1
          type: object
          maxProperties: 10
          title: Tags
          description: Tags for the call
        status:
          $ref: '#/components/schemas/CallStatus'
        livekit_url:
          type: string
          title: Livekit Url
          description: LiveKit server URL to connect to.
        livekit_token:
          type: string
          title: Livekit Token
          description: JWT for joining the LiveKit room.
      type: object
      required:
        - id
        - agent_id
        - status
        - livekit_url
        - livekit_token
      title: SecretCallResponse
      description: Response model for a call including LiveKit connection details.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CallStatus:
      oneOf:
        - $ref: '#/components/schemas/ToStartCallStatus'
        - $ref: '#/components/schemas/OngoingCallStatus'
        - $ref: '#/components/schemas/CompletedCallStatus'
      discriminator:
        propertyName: type
        mapping:
          completed:
            $ref: '#/components/schemas/CompletedCallStatus'
          ongoing:
            $ref: '#/components/schemas/OngoingCallStatus'
          to_start:
            $ref: '#/components/schemas/ToStartCallStatus'
    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
    ToStartCallStatus:
      properties:
        type:
          type: string
          const: to_start
          title: Type
          default: to_start
      type: object
      title: ToStartCallStatus
      description: Status for call that has not yet started.
    OngoingCallStatus:
      properties:
        type:
          type: string
          const: ongoing
          title: Type
          default: ongoing
        started_at:
          type: string
          title: Started At
          description: Start time in ISO 8601 format.
          examples:
            - '2022-01-01T00:00:00Z'
      type: object
      required:
        - started_at
      title: OngoingCallStatus
      description: Status for call that is currently ongoing.
    CompletedCallStatus:
      properties:
        type:
          type: string
          const: completed
          title: Type
          default: completed
        started_at:
          type: string
          title: Started At
          description: Start time in ISO 8601 format.
          examples:
            - '2022-01-01T00:00:00Z'
        ended_at:
          type: string
          title: Ended At
          description: End time in ISO 8601 format.
          examples:
            - '2022-01-01T00:00:00Z'
      type: object
      required:
        - started_at
        - ended_at
      title: CompletedCallStatus
      description: Status for call that has completed.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Your Beyond Presence API Key.
      in: header
      name: x-api-key

````