> ## 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.

# Get intent(s) detected/assigned for a ticket



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api get /intent/byTicketId/{ticketId}
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:
  /intent/byTicketId/{ticketId}:
    get:
      tags:
        - Intent
      summary: Get intent(s) detected/assigned for a ticket
      operationId: getIntentByTicketId
      parameters:
        - name: ticketId
          in: path
          required: true
          description: The id of the ticket for which the intents should be retrieved
          schema:
            type: integer
          example: 376189
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  ticketId:
                    type: integer
                    example: 376189
                  intentsFound:
                    description: Number of intents found
                    type: integer
                    example: 1
                  aiOutcome:
                    description: >
                      Outcome of the AI's detected processing 1) noDetection: AI
                      did not find anything useful 2) customerDetected: AI
                      detected the customer, but nothing else 3) agentAssist: AI
                      detected an intent, but is not confident enough to
                      excecute it without additional support 4) full: AI fully
                      resolved the issue. No agent interaction needed any more
                    type: string
                    enum:
                      - noDetection
                      - customerDetected
                      - agentAssist
                      - full
                    example: agentAssist
                  intents:
                    type: array
                    items:
                      $ref: '#/components/schemas/Intent'
        '403':
          description: Unauthorized
        '404':
          description: Customer not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Intent:
      type: object
      description: An intent of a customer that he wants to be resolved by contacting us
      properties:
        id:
          type: integer
          description: Internal ID of intent
          example: 1211221
        code:
          type: string
          nullable: true
          description: >-
            Intent model code that resolves a specific issue. Currently
            supported is process_meter_reading, process_bank_data and
            process_installment_change
          example: process_meter_reading
        name:
          type: string
          description: User-readable name of intent as defined by client
          example: Process a meter reading
        contractId:
          type: string
          example: '746839'
        status:
          type: string
          description: >
            Lifecycle status of the intent. `preview` — created as a
            non-persisted preview. `ready` — active, waiting for agent action.
            `executed` — action taken, but dialogue may continue (interaction
            with remaining options). `archived` — terminal: action taken and
            dialogue is closed (text reply sent, or interaction with no
            remaining options). Preserved as audit history. `invalidated` —
            underlying data changed, will be re-processed on next load.
            `deleted` — soft-deleted.
          enum:
            - preview
            - ready
            - executed
            - archived
            - invalidated
            - deleted
          example: ready
        confidence:
          type: number
          format: float
          description: >-
            Confidence how certain the AI is that this is correct. 0.95 means
            for example 95% certain. Defaults to 100% when verified by human.
          example: 0.95
        confidenceColor:
          type: string
          example: warning
          description: >-
            A color indication of an intent showing the user how much user
            interaction is needed. 'success' indicates the AI is ready to
            execute, all other codes require user interaction first
          enum:
            - success
            - neutral
            - warning
            - danger
        verified:
          type: boolean
          description: True if intent has been verified by human
          example: false
        context:
          type: object
          description: >-
            Intent-specific additional data to be shown to the user so he has
            relevant information about the intent. Data type varies by intent
            code
        messagePreview:
          type: string
          nullable: true
          description: >-
            A preview of the response a customer would receive when executing
            this intent. Not always available, e.g. when the respond depends on
            user-input
          example: We have successfully processed your meter reading
        recipient:
          type: string
          example: john@smith.com
        tags:
          type: string
          description: >-
            Tags to show to the user. prePopulated means that all properties are
            already pre-filled by the AI and the user can just insert the
            template to the body. adaptionNeeded is the opposite, and means the
            user still needs to modify the text. writesToErp means that upon
            execution of the intent a write is done to the ERP system, like a
            insertion of a meter reading or the creation of a bill.
          enum:
            - prePopulated
            - adaptionNeeded
            - writesToErp
        data:
          type: object
          description: >-
            Intent-specific data object showing all the data that was extracted
            from the ticket in a structured form. Data type varies by intent
            code
        options:
          description: >-
            Different options that the user is given. Every option is a new
            button in the UI
          type: array
          items:
            $ref: '#/components/schemas/IntentOption'
          example:
            - type: enter_into_system
              name: Eintragen
              icon: check
              recommended: true
              order: 1
            - type: ignore
              name: Ignorieren
              icon: cancel
              recommended: false
              order: 2
            - type: forward_to_vnb
              name: An VNB verweisen
              icon: questionMark
              recommended: false
              order: 3
        infos:
          type: array
          items:
            $ref: '#/components/schemas/IntentInfo'
        extraInfo:
          type: string
          example: null
          nullable: true
          description: Extra-Information shown in tooltip. Info-Icon only shown if not null
        outcome:
          $ref: '#/components/schemas/IntentOutcome'
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
    IntentOption:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
        icon:
          type: string
        recommended:
          type: boolean
        order:
          description: Buttons ordered from lowest (shown first) to highest (shown last)
          type: integer
    IntentInfo:
      type: object
      description: Info areas shown to the user
      properties:
        code:
          type: string
          nullable: true
          description: >-
            Machine-readable code identifying the info type, e.g. "plausible",
            "USER_WARNING", "TRACE_INFO", "ERROR_MESSAGE"
          example: USER_WARNING
        type:
          type: string
          example: warning
          enum:
            - success
            - neutral
            - warning
            - danger
        message:
          type: string
          example: Reading is plausible
        extraInfo:
          type: string
          example: >-
            Expected reading was 421 kWh. Plausbible because difference to 317
            kWh is below threshold of 200 kWh
          description: Extra-Information shown in tooltip. Info-Icon only shown if not null
          nullable: true
    IntentOutcome:
      type: object
      nullable: true
      description: Shows the outcome (if the intent was already executed)
      properties:
        aiAgentId:
          type: integer
          format: int32
          description: ID of the AI agent that was executed
          example: 1
        success:
          type: boolean
          example: true
        messageLocalized:
          description: >-
            Human-readable message, usually from the backend system. Already
            localized.
          type: string
          example: Powercloud accepted meter reading
        internalData:
          type: object
          description: Technical output for debugging purposes
          additionalProperties: true
          example:
            requestEndpoint: saveReadingByContractId
            requestParams: readingValue=21;date=2022-12-31
        executedAt:
          type: string
          description: Date and time when intent was executed
          format: DateTime
          example: '2022-12-13 22:18:06'
        userId:
          type: integer
          description: User ID of user that triggered the intent. 0 for system user
          example: 1
        sent:
          description: >-
            Was the email / chat message / etc. described in this object 
            successfully sent?
          type: boolean
        ticketClosed:
          description: Was the ticket closed?
          type: boolean
          example: true
        recipient:
          type: string
          example: john@smith.com
        message:
          type: string
          nullable: true
          example: >-
            We successfully processed your meter reading of 21 kWh dated Dec 31,
            2022
        template:
          type: string
          example: <p>Dear John,</p><p>%MESSAGE%</p><i>Mike from your service team</i>
          nullable: true
        sources:
          type: array
          description: Any sources that were used to create the result
          items:
            $ref: '#/components/schemas/Source'
        txId:
          type: string
          example: c916167c94
          description: Unique transaction id. Corresponds to a log entry in enneo
    Source:
      type: object
      description: A source that was used by an AI model / intent
      properties:
        type:
          type: string
          description: >
            The type of source used. ticket = A similar ticket existed and that
            response was used as a basis

            knowledgeSource = An external knowledge source was used, usually a
            company Wiki or FAQ

            template = A predefined text template could be applied

            languageModel = If the AI model did not use anything end created the
            answer by itself
          enum:
            - ticket
            - knowledgeSource
            - template
            - languageModel
          example: knowledgeSource
        id:
          type: integer
          description: Reference to the entry id, e.g. ticketId (if type=ticket)
          example: 376189
          nullable: true
        name:
          type: string
          description: Name of reference (e.g. FAQ title or ticket title)
          example: Opening hours
        url:
          type: string
          description: >-
            URL to associated source. null for sources with internal ids
            (tickets and templates) or if non-existant (language model source)
          example: https://company.com/faq/376189
          nullable: true
        text:
          type: string
          description: Full text that was used as source
          example: >-
            Our service hours are from 8am to 5pm. We are closed on weekends.
            [...]
  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

````