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

# Execute an option for a specific intent



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api post /intent/{intentId}/execute
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/{intentId}/execute:
    post:
      tags:
        - Intent
      summary: Execute an option for a specific intent
      operationId: executeIntent
      parameters:
        - name: intentId
          in: path
          required: true
          description: The id of the intent that should be executed
          schema:
            type: integer
          example: 1211221
      requestBody:
        description: >-
          Optional additional parameters to override/validate the existing data
          in the intent or trigger a response to the customer
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                intentId:
                  type: number
                code:
                  type: string
                  example: process_meter_reading
                  description: >-
                    This field is necessary for creating new intent when we
                    don't have intentId
                ticketId:
                  type: number
                  example: 1010
                  description: >-
                    This field is necessary for creating new intent when we
                    don't have intentId
                informCustomer:
                  type: boolean
                  description: >-
                    If true, an email is being sent to the customer informing
                    him about the outcome, and the corresponding ticket is
                    closed (if the operation was successful)
                  default: false
                  example: false
                dryRun:
                  type: boolean
                  description: >-
                    If true, the execution is simulated without any write API
                    calls triggered to the backend systems
                  default: false
                  example: true
                data:
                  type: object
                  description: >-
                    Intent-specific data object that should be used to process
                    the intent
                  allOf:
                    - type: object
                      properties:
                        _action:
                          type: string
                          description: >-
                            The way how this intent should be resolved. Must
                            have been listed as option when retrieving the
                            intent
                          example: enter_into_system
                    - type: object
                      description: Any Intent-specific data
                contractId:
                  type: string
                  description: >-
                    Optional contract id. If provided, the backend verifies that
                    the provided contractId matches the contract id associated
                    to the intent and throws an error if it does not match
                  example: '376189'
      responses:
        '200':
          description: Option was processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntentOutcome'
              examples:
                success:
                  value:
                    responseCode: entered_into_system
                    success: true
                    messageLocalized: Meter reading successfully entered into system
                    internalData:
                      requestEndpoint: saveReadingByContractId
                      requestParams: readingValue=21;date=2022-12-31
                    executedAt: 1672410060
                    userId: 1
                    sent: true
                    ticketClosed: true
                    recipient: john@smith.com
                    message: >-
                      We successfully processed your meter reading of 21 kWh
                      dated Dec 31, 2022
                    template: >-
                      <p>Dear John,</p><p>%MESSAGE%</p><i>Mike from your service
                      team</i>
                    txId: c916167c94
                failure:
                  value:
                    responseCode: reading_rejected
                    success: false
                    messageLocalized: >-
                      ERP system rejected reading: Contract has 2 registers, but
                      only one was provided
                    internalData:
                      requestEndpoint: saveReadingByContractId
                      requestParams: readingValue=21;date=2022-12-31
                    executedAt: 1672410060
                    userId: 1
                    ticketClosed: false
                    sent: false
                    recipient: john@smith.com
                    message: null
                    template: null
                    txId: c916167c94
        '403':
          description: Unauthorized
        '404':
          description: Intent not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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
    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.
    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

````