Skip to main content

Overview

The Doctors API provides endpoints for managing healthcare provider profiles, credentials, and assignments within the AllCare platform. Base URL: https://api.allcare.ai/v1/doctors Authentication: API Key or OAuth 2.0 required

Endpoints

List Providers

Get a list of all providers.
GET /v1/doctors
Query Parameters:
ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerResults per page (max: 100)
specialtystringFilter by specialty
statusstringFilter by status (active, inactive)
Example Request:
curl -X GET "https://api.allcare.ai/v1/doctors?limit=10&specialty=Internal%20Medicine" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
  "success": true,
  "data": [
    {
      "id": "doc_12345",
      "firstName": "John",
      "lastName": "Smith",
      "middleName": "Michael",
      "suffix": "MD",
      "npi": "1234567890",
      "specialty": "Internal Medicine",
      "email": "[email protected]",
      "phone": "+1-555-0123",
      "status": "active",
      "credentials": {
        "dea": [
          {
            "number": "AS1234567",
            "expirationDate": "2026-12-31",
            "schedule": ["II", "III", "IV", "V"]
          }
        ],
        "stateLicenses": [
          {
            "state": "CA",
            "number": "A12345",
            "expirationDate": "2025-06-30"
          }
        ]
      },
      "epcsEnabled": true,
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2025-01-10T14:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 45,
    "totalPages": 5
  }
}

Get Provider

Retrieve a specific provider by ID.
GET /v1/doctors/{id}
Path Parameters:
ParameterTypeDescription
idstringProvider ID
Example Request:
curl -X GET "https://api.allcare.ai/v1/doctors/doc_12345" \
  -H "Authorization: Bearer YOUR_API_KEY"

Create Provider

Create a new provider profile.
POST /v1/doctors
Required Permissions: write:doctors Request Body:
{
  "firstName": "Jane",
  "lastName": "Doe",
  "middleName": "Marie",
  "suffix": "MD",
  "npi": "9876543210",
  "specialty": "Family Medicine",
  "email": "[email protected]",
  "phone": "+1-555-0199",
  "address": {
    "street1": "123 Medical Plaza",
    "street2": "Suite 200",
    "city": "Los Angeles",
    "state": "CA",
    "zipCode": "90001"
  },
  "dea": {
    "number": "BD7654321",
    "expirationDate": "2027-03-31"
  },
  "stateLicense": {
    "state": "CA",
    "number": "C67890",
    "expirationDate": "2026-12-31"
  }
}
Example Response:
{
  "success": true,
  "data": {
    "id": "doc_67890",
    "firstName": "Jane",
    "lastName": "Doe",
    "npi": "9876543210",
    "status": "pending_verification",
    "createdAt": "2025-01-15T10:30:00Z"
  }
}

Update Provider

Update an existing provider profile.
PATCH /v1/doctors/{id}
Required Permissions: write:doctors Request Body: (partial updates supported)
{
  "email": "[email protected]",
  "phone": "+1-555-0200",
  "address": {
    "street1": "456 New Location"
  }
}

Delete Provider

Deactivate a provider (soft delete).
DELETE /v1/doctors/{id}
Required Permissions: write:doctors
This performs a soft delete. The provider is marked as inactive but not permanently removed.

Provider Credentials

Add DEA Registration

POST /v1/doctors/{id}/dea
Request Body:
{
  "number": "AS1234567",
  "expirationDate": "2027-12-31",
  "schedule": ["II", "III", "IV", "V"],
  "businessActivityCode": "C"
}

Add State License

POST /v1/doctors/{id}/licenses
Request Body:
{
  "state": "NY",
  "number": "123456",
  "expirationDate": "2026-06-30",
  "type": "MD"
}

Provider Assignments

Get Provider Assignments

Get facilities and patients assigned to a provider.
GET /v1/doctors/{id}/assignments

Assign Provider to Facility

POST /v1/doctors/{id}/facilities
Request Body:
{
  "facilityId": "fac_12345",
  "services": ["clinic", "prescribing"],
  "maxDailyPatients": 15,
  "activeDays": ["monday", "wednesday", "friday"]
}

EPCS Configuration

Enable EPCS

Enable electronic prescribing of controlled substances for a provider.
POST /v1/doctors/{id}/epcs/enable
Requirements:
  • Valid DEA with EPCS authority
  • Identity proofing completed
  • Two-factor authentication configured

Verify EPCS Status

GET /v1/doctors/{id}/epcs/status
Response:
{
  "epcsEnabled": true,
  "identityProofed": true,
  "twoFactorEnabled": true,
  "deaVerified": true,
  "lastVerificationDate": "2025-01-10T09:00:00Z"
}

Error Responses

400 Bad Request

Invalid request data:
{
  "error": "VALIDATION_ERROR",
  "message": "Invalid NPI format",
  "details": {
    "field": "npi",
    "value": "invalid",
    "requirement": "Must be 10 digits"
  }
}

404 Not Found

Provider not found:
{
  "error": "RESOURCE_NOT_FOUND",
  "message": "Provider with ID 'doc_99999' not found"
}

409 Conflict

Duplicate provider:
{
  "error": "DUPLICATE_RESOURCE",
  "message": "Provider with NPI '1234567890' already exists",
  "existingId": "doc_12345"
}

Best Practices

Rate Limits

  • Standard: 100 requests/minute
  • Burst: 200 requests
  • Create/Update: 20 requests/minute

Webhooks

Subscribe to provider events:
  • provider.created
  • provider.updated
  • provider.activated
  • provider.deactivated
  • provider.credential_expiring
Configure webhooks in your API settings.