YourMD Primary API Documentation

Back to Overview All Portals

API Documentation

API Version: v1.0
Base URL: https://api.yourmd.online/v1
Sandbox URL: https://sandbox-api.yourmd.online/v1

Authentication

The YourMD Primary API uses Bearer token authentication. Include your API key in the Authorization header of every request:

Authorization: Bearer YOUR_API_KEY

Obtaining API Credentials

  1. Register for a developer account at developer.yourmd.online
  2. Create a new application in your dashboard
  3. Generate API keys for your application
  4. Configure allowed domains and webhook endpoints
Security Notice: Never expose your API key in client-side code. Always make API calls from your backend server.

Rate Limits

API rate limits vary by plan:

Rate limit information is included in response headers:

X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9987
X-RateLimit-Reset: 1642521600

Error Handling

The API returns standard HTTP status codes and detailed error messages:

Error Response Format
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": [
      {
        "field": "dateOfBirth",
        "message": "Date must be in YYYY-MM-DD format"
      }
    ]
  }
}

Patient Resource

GET /patients

Retrieve a list of patients with optional filtering and pagination.

Query Parameters

Parameter Type Required Description
page integer Optional Page number for pagination (default: 1)
limit integer Optional Number of results per page (default: 20, max: 100)
search string Optional Search by name, MRN, or phone number
status string Optional Filter by status: active, inactive, deceased

Example Request

curl -X GET https://api.yourmd.online/v1/patients?search=smith&limit=10 \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

200 OK
{
  "data": [
    {
      "id": "pat_123456",
      "firstName": "John",
      "lastName": "Smith",
      "dateOfBirth": "1985-05-15",
      "gender": "male",
      "mrn": "MRN-2024-0142",
      "phone": "+1-555-123-4567",
      "email": "john.smith@email.com",
      "address": {
        "street": "123 Main St",
        "city": "Anytown",
        "state": "CA",
        "zip": "90210"
      },
      "insurance": {
        "provider": "BlueCross BlueShield",
        "memberId": "XYZ123456789",
        "groupNumber": "GRP001"
      },
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-18T14:20:00Z"
    }
  ],
  "meta": {
    "currentPage": 1,
    "totalPages": 5,
    "totalCount": 87,
    "perPage": 20
  }
}
POST /patients

Create a new patient record.

Request Body Parameters

Parameter Type Required Description
firstName string Required Patient's first name
lastName string Required Patient's last name
dateOfBirth string Required Date of birth (YYYY-MM-DD)
gender string Required Gender: male, female, other
phone string Optional Phone number
email string Optional Email address
address object Optional Address object with street, city, state, zip
insurance object Optional Insurance information

Example Request

curl -X POST https://api.yourmd.online/v1/patients \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Doe",
    "dateOfBirth": "1990-08-20",
    "gender": "female",
    "phone": "+1-555-987-6543",
    "email": "jane.doe@email.com",
    "address": {
      "street": "456 Oak Ave",
      "city": "Springfield",
      "state": "IL",
      "zip": "62701"
    }
  }'

Prescription Resource

POST /prescriptions

Create a new electronic prescription.

Request Body Parameters

Parameter Type Required Description
patientId string Required Patient ID
providerId string Required Prescribing provider ID
medication object Required Medication details
medication.name string Required Medication name
medication.strength string Required Dosage strength
medication.form string Required Dosage form (tablet, capsule, etc.)
sig string Required Directions for use
quantity integer Required Quantity to dispense
refills integer Required Number of refills (0-11)
pharmacyId string Required Target pharmacy ID
Drug Interaction Check: The API automatically performs drug interaction checks against the patient's active medications and allergies before creating the prescription.

Webhooks

YourMD Primary API supports webhooks for real-time event notifications. Configure webhook endpoints in your application settings.

Available Webhook Events

Webhook Payload Format

{
  "id": "evt_1234567890",
  "type": "patient.created",
  "created": "2024-01-20T15:30:00Z",
  "data": {
    "object": {
      // Event-specific data
    }
  }
}

Webhook Security

All webhook requests include a signature header for verification:

X-YourMD-Signature: sha256=SIGNATURE_HASH

FHIR Support

YourMD Primary API supports FHIR R4 for healthcare data interoperability. Access FHIR endpoints at:

https://fhir.yourmd.online/v1/
FHIR Resources Available: Patient, Encounter, Observation, MedicationRequest, DiagnosticReport, Procedure, AllergyIntolerance, Immunization