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

# Call received

> Called when a call is received (inbound) or initiated (outbound).

For inbound calls (direction=in, default): creates a ticket, attempts customer identification from phone number, and returns the ticket ID. Routing happens later via getRouting.

For outbound calls (direction=out): creates a ticket, creates a queue entry (no routing needed), and links customer/contract data if available. Requires 'to'. No human initiator is required — the call can be fully autonomous/callflow-driven. If a human initiator is provided ('agentId'/'userId'), they are set to 'interacting' and the ticket is assigned to them. For bot/callflow-driven calls with no human on the line, omit 'agentId'/'userId' — presence is not touched and the queue is created as Unknown (out of routing).




## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api post /telephony/callReceived
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /telephony/callReceived:
    post:
      tags:
        - Telephony
      summary: Call received
      description: >
        Called when a call is received (inbound) or initiated (outbound).


        For inbound calls (direction=in, default): creates a ticket, attempts
        customer identification from phone number, and returns the ticket ID.
        Routing happens later via getRouting.


        For outbound calls (direction=out): creates a ticket, creates a queue
        entry (no routing needed), and links customer/contract data if
        available. Requires 'to'. No human initiator is required — the call can
        be fully autonomous/callflow-driven. If a human initiator is provided
        ('agentId'/'userId'), they are set to 'interacting' and the ticket is
        assigned to them. For bot/callflow-driven calls with no human on the
        line, omit 'agentId'/'userId' — presence is not touched and the queue is
        created as Unknown (out of routing).
      operationId: callReceived
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                routing:
                  type: string
                  description: >
                    Determines how this call should be routed to an agent.
                    Possible values are 'none', 'external', and 'native'.

                    - none: Call is not routed, creates a new ticket in status
                    closed, does not run AI agents.

                    - external: Call should be routed, but routing engine is
                    external. Enneo processes the ticket via its AI, and either
                    connects to a specified agent (property 'userId' must be
                    provided) or expects a later connection through a subsequent
                    /agentConnected call.

                    - native: Call should be routed using Enneo as the call
                    routing engine. Returns a ticketId that can be polled to
                    query agent availability.
                  enum:
                    - none
                    - external
                    - native
                  example: none
                contractId:
                  type: string
                  description: >-
                    Optional contract id, if provided will be used for customer
                    identification
                  nullable: true
                  example: '123456'
                customerId:
                  type: string
                  description: >-
                    Optional customer id, if provided will be used for customer
                    identification
                  nullable: true
                  example: '789012'
                phone:
                  type: string
                  description: >-
                    Phone number of the caller. Used for customer identification
                    on inbound calls. For outbound calls, use 'to' instead.
                  nullable: true
                  example: '+491234567890'
                to:
                  type: string
                  description: >-
                    Customer phone number being called. Required for outbound
                    calls (direction=out). Used for customer identification.
                  nullable: true
                  example: '+491234567890'
                agentId:
                  type: integer
                  description: >-
                    ID of the agent initiating an outbound call where the human
                    is on the line. Optional for outbound calls — if provided,
                    the agent will be set to 'interacting' and assigned to the
                    queue entry. Omit for bot/callflow-driven calls where no
                    human is on the call.
                  nullable: true
                  example: 1
                aiAgentId:
                  type: integer
                  description: >-
                    ID of the AI agent conducting the outbound call. When
                    present with direction=out, the call is handled by a
                    voicebot — no human agent is required, and any supplied
                    human agent (userId/agentId) is recorded on the ticket but
                    not set to interacting. Sufficient alone as the sole
                    initiator for bot-only outbound calls. Ignored for inbound
                    calls (direction=in).
                  nullable: true
                  example: 456
                transcript:
                  type: array
                  description: Array of previous bot transcript entries
                  items:
                    $ref: '#/components/schemas/Transcript'
                userId:
                  type: integer
                  description: >-
                    Optional id of user that should be associated with the call.
                    If that user has a browser window of enneo open, user will
                    be redirected to the newly created ticket. Same effect as a
                    subsequent /telephony/agentConnected API call. Requires
                    property 'routing' to be set to 'external' or 'none'.
                  nullable: true
                  example: 42
                channelId:
                  type: string
                  description: >-
                    Optional unique identifier of a third party system of this
                    call. If provided, then it can be used as reference for any
                    future updates to this call flow
                  nullable: true
                  example: call_123abc456
                callerName:
                  type: string
                  description: >-
                    Optional name of the caller. Used for the fromName field of
                    the ticket.
                  nullable: true
                  example: John Smith
                triggeredBy:
                  type: integer
                  description: >-
                    ID of the user who triggered an autonomous/callflow-driven
                    outbound call. Recorded in the ticketCreated event for
                    attribution only — not put on the call (no
                    presence/'interacting' change), not assigned to the ticket,
                    not placed in the queue. Use 'agentId'/'userId' instead if
                    the human is actually on the line.
                  nullable: true
                  example: 1
                direction:
                  type: string
                  description: >-
                    Direction of the call. Defaults to 'in' if not provided.
                    Outbound calls (direction=out) require 'to'. A human
                    initiator ('agentId'/'userId') is optional — omit for fully
                    autonomous/callflow-driven calls.
                  nullable: true
                  enum:
                    - in
                    - out
                  example: in
                subchannelId:
                  type: integer
                  description: >-
                    Optional Enneo subchannel ID to associate with the ticket.
                    Usually the ID of the call line as defined in the Enneo
                    settings
                  nullable: true
                  example: 5
                externalTicketId:
                  type: string
                  description: Optional external ticket ID to associate with the ticket
                  nullable: true
                  example: ext-123
                status:
                  type: string
                  description: >-
                    Status to set for the ticket. Defaults to 'closed' for
                    routing 'none', 'open' for routing 'external' or 'native'.
                  nullable: true
                  enum:
                    - open
                    - closed
                    - pending
                  example: open
                triggerAiProcessing:
                  type: boolean
                  description: >-
                    Whether to trigger AI processing. Defaults to false for
                    routing 'none', true for routing 'external' or 'native'.
                  nullable: true
                  example: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  ticketId:
                    type: integer
                    description: ID of the newly created enneo ticket
                    example: 2142
                  contractId:
                    type: string
                    description: Contract ID associated with the call, if any
                    nullable: true
                    example: null
                  customerId:
                    type: string
                    description: Customer ID associated with the call, if any
                    nullable: true
                    example: null
                  ioResponse:
                    type: string
                    description: >-
                      Response from IO system when routing is external,
                      otherwise 'None'
                    example: None, as routing is not external
                  queueId:
                    type: integer
                    description: >-
                      Unique ID of the queue the call was assigned to (only
                      returned if routing is 'native')
                    example: 123
        '400':
          description: Invalid input
        '500':
          description: Internal error
components:
  schemas:
    Transcript:
      type: object
      description: A single entry in a conversation transcript
      required:
        - speaker
        - message
      properties:
        speaker:
          type: string
          description: >
            Who spoke this message. Determines conversation direction and type:

            - 'customer': Customer/caller message (direction=in, type=text)

            - 'agent': Bot/assistant message (direction=out, type=text)

            - 'agent_request': AI agent tool call request (direction=internal,
            type=agent_request)

            - 'agent_response': AI agent tool call response (direction=internal,
            type=agent_response)
          enum:
            - customer
            - agent
            - agent_request
            - agent_response
          example: customer
        message:
          type: string
          description: The actual message that was spoken
          example: Hello, my name is AI Assistant. How can I help you today?
        timestamp:
          type: string
          format: date-time
          description: When this message was spoken
          nullable: true
          example: '2024-01-23T14:32:11Z'
      example:
        speaker: agent
        message: Hello, my name is AI Assistant. How can I help you today?
        timestamp: '2024-01-23T14:32:11Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````