Doctors Endpoints

Retrieve and manage doctor records

Overview

The Doctors API allows you to retrieve doctor information and create new doctor records. Manage physician data including specialties, qualifications, and consultation fees.

API Endpoints

GEThttps://server.nyraai.io/api/external/doctors

List all doctors with filtering and pagination

Permission: doctors:read

Headers

x-api-keyrequired

API key

x-api-secretrequired

API secret

Authorizationrequired

Bearer hospital token

Query Parameters

page(integer)

Page number (default: 1)

limit(integer)

Records per page (default: 20, max: 100)

q(string)

Search on name, email, phone

status(string)

Filter by status (ACTIVE, INACTIVE)

branch_id(uuid)

Filter by branch

Response

{
  "success": true,
  "data": {
    "total": 2,
    "results": [
      {
        "id": "doctor-uuid",
        "name": "Dr. Priya Rao",
        "phone": "9876543210",
        "email": "priya.rao@example.com",
        "hospital_id": "hospital-uuid",
        "branch_id": "branch-uuid",
        "specialty": "Cardiologist",
        "department": "Cardiology",
        "qualification": "MBBS, MD",
        "experience_years": 8,
        "op_fee": 500,
        "currency": "INR",
        "status": "ACTIVE",
        "created_at": "2026-04-08T08:00:00.000Z",
        "updated_at": "2026-04-08T08:00:00.000Z"
      }
    ],
    "page": 1,
    "limit": 20,
    "total_pages": 1
  }
}
POSThttps://server.nyraai.io/api/external/doctors

Create a new doctor record

Permission: doctors:create

Headers

x-api-keyrequired

API key

x-api-secretrequired

API secret

Authorizationrequired

Bearer hospital token

Content-Typerequired

application/json

Request Body

{
  "name": "Dr. Priya Rao",
  "phone": "9876543210",
  "email": "priya.rao@example.com",
  "password": "NyraDoctor@123",
  "branch_id": "2c353178-8a77-4e0d-b66f-973a02cc631f",
  "specialty": "Cardiologist",
  "department": "Cardiology",
  "qualification": "MBBS, MD",
  "experience_years": 8,
  "op_fee": 500,
  "currency": "INR",
  "license_number": "TSMC12345",
  "bio": "Consultant cardiologist",
  "status": "ACTIVE"
}

Response

{
  "success": true,
  "message": "Doctor created successfully",
  "data": {
    "id": "doctor-uuid",
    "name": "Dr. Priya Rao",
    "email": "priya.rao@example.com",
    "status": "ACTIVE"
  }
}

Important Notes

Required Fields

  • name - Doctor's full name (required)
  • • At least one of phone or email is required

Optional Fields

  • password - Doctor login password (optional)
  • license_number - Medical license number
  • bio - Doctor biography

Branch-scoped keys

Branch-scoped API keys may create doctors only in their own branch. The server ties new doctors to that branch; a different branch_idin the body will not move them outside the key's branch.

Usage Examples

List All Doctors

curl -X GET "https://server.nyraai.io/api/external/doctors?page=1&limit=20" \
  -H "x-api-key: nyra_..." \
  -H "x-api-secret: secret..." \
  -H "Authorization: Bearer token..."

Search Doctors by Specialty

curl -X GET "https://server.nyraai.io/api/external/doctors?q=cardiologist&status=ACTIVE" \
  -H "x-api-key: nyra_..." \
  -H "x-api-secret: secret..." \
  -H "Authorization: Bearer token..."

Create a New Doctor

curl -X POST "https://server.nyraai.io/api/external/doctors" \
  -H "x-api-key: nyra_..." \
  -H "x-api-secret: secret..." \
  -H "Authorization: Bearer token..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Dr. Priya Rao",
    "phone": "9876543210",
    "email": "priya.rao@example.com",
    "branch_id": "branch-uuid",
    "specialty": "Cardiologist",
    "department": "Cardiology",
    "qualification": "MBBS, MD",
    "experience_years": 8,
    "op_fee": 500,
    "currency": "INR",
    "license_number": "TSMC12345",
    "bio": "Consultant cardiologist with 8 years of experience",
    "status": "ACTIVE"
  }'