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

# Get agent by number

> Fetch agent details for a given user mobile number.



## OpenAPI

````yaml GET /external/getagentbynumber/{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:
  /external/getagentbynumber/{examid}:
    get:
      tags:
        - Agent
      summary: Get agent by number
      operationId: getAgentByNumber
      parameters:
        - name: examid
          in: path
          required: true
          schema:
            type: string
        - name: number
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Agent details
          content:
            application/json:
              examples:
                success:
                  summary: Agent found
                  value:
                    error: false
                    agentId: 123
                    agentName: Agent Name
                    transactionId: 456
                    message: ''
                noActiveTransaction:
                  summary: Agent exists but no active transaction
                  value:
                    error: true
                    message: No active transaction found
        '401':
          description: Auth failure
          content:
            application/json:
              example:
                error: true
                result: auth failed
        '404':
          description: Agent not found
          content:
            application/json:
              example:
                error: true
                message: Agent not found
      x-codeSamples:
        - lang: cURL
          label: Fetch agent
          source: >-
            curl --location
            'https://domain-c.neuroncx.in/external/getagentbynumber/{examid}?number=8888XXXXXX'
            \

            --header 'Authorization: Bearer Token'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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