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

# Event handler (v2)

> V2 event handler. Also handles prescription events (eventId: 88).



## OpenAPI

````yaml POST /prod/v2/event-handler/{examId}
openapi: 3.0.3
info:
  title: NeuronCx API
  version: 1.0.0
  description: >-
    API collection of NeuronCx — Omnichannel Automations & Reasoning. NeuronCx
    APIs use Bearer as an authorization layer. Every API request must contain an
    `Authorization` HTTP header with a token. Tokens can be generated by admin
    role users on https://dash.neuroncx.in/.
servers:
  - url: https://domain-c.neuroncx.in
    description: Carrier domain (domain_c)
  - url: https://domain-g.neuroncx.in
    description: Get/lead domain (domain_g)
  - url: https://domain-i.neuroncx.in
    description: Interactive/messaging domain (domain_i)
  - url: https://events.neuroncx.in
    description: Event handler domain
  - url: https://automation.neuroncx.in
    description: Automation domain
security:
  - bearerAuth: []
tags:
  - name: Prospects
  - name: Messages
  - name: Attributes
  - name: Agent
  - name: Events
paths:
  /prod/v2/event-handler/{examId}:
    post:
      tags:
        - Events
      summary: Event handler (v2)
      description: 'V2 event handler. Also handles prescription events (`eventId: 88`).'
      operationId: handleEventV2
      parameters:
        - name: examId
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - eventId
                - patientNumber
                - data
              properties:
                eventId:
                  type: integer
                patientNumber:
                  type: string
                sourceId:
                  type: integer
                data:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
            example:
              eventId: 53
              patientNumber: 919XXXXXXXX8
              data:
                - attributeId: 4555719
                  payload: 4443
                  patientName: John Doe
                  externalLink: www.*****.com
      responses:
        '200':
          description: Handled
          content:
            application/json:
              examples:
                success:
                  summary: Success
                  value:
                    success: true
                    message: Event handled successfully
                    traceId: <traceId>
                failure:
                  summary: Failure
                  value:
                    success: false
                    message: error message
                    traceId: <traceId>
                prescriptionSuccess:
                  summary: Prescription success
                  value:
                    message: Success message
                    error: 'false'
                    uuid: 12023few2-1d2e3d-2s22dsced
                    data:
                      dataList:
                        - subCategoryName: Lab Tests
                          nightPrice: '0'
                          prandial: 'NO'
                prescriptionFailure:
                  summary: Prescription failure
                  value:
                    message: Error message
                    error: 'true'
                    uuid: 12023few2-1d2e3d-2s22dsced
      x-codeSamples:
        - lang: JSON
          label: Generic event
          source: |-
            {
              "eventId": 53,
              "patientNumber": "919XXXXXXXX8",
              "data": [
                {
                  "attributeId": 4555719,
                  "payload": 4443,
                  "patientName": "John Doe",
                  "externalLink": "www.*****.com"
                }
              ]
            }
        - lang: JSON
          label: Prescription event
          source: |-
            {
              "eventId": 88,
              "patientNumber": "",
              "sourceId": 23,
              "data": [
                {
                  "attributeId": 144,
                  "document": "",
                  "AgentId": "",
                  "FirmNo": ""
                }
              ]
            }
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.