إنتقل إلى المحتوى الرئيسي

Medical Provider

Manage medical provider records (hospitals, clinics, labs, pharmacies) in the system. Providers are referenced when creating Prior Authorizations and can be associated with Networks.

Base URL

https://api.{client_namespace}.najeeb.ai/v4.0/health

Authentication

All API requests are authenticated using an API key passed in a dedicated header:

access-key: YOUR_API_KEY

For access key provisioning, please contact Najeeb support.

API Endpoints

Create Medical Provider

POST /medical-provider/create

Register a new medical provider in the system.

Request Headers

HeaderTypeRequiredDescription
access-keystringYesAPI key for authentication
Content-TypestringYesMust be application/json

Request Body Parameters

ParameterTypeRequiredDescriptionAccepted Values
name *stringYesProvider nameString, 1-255 characters
nphies_idstringNoNPHIES IDString, 1-50 characters
phone_numberstringNoPhone numberString, 1-50 characters
city *stringYesCity nameString, 1-100 characters
cchi_no *stringYesCCHI numberString, 1-50 characters
typestringNoProvider typeEnum: CLINIC, POLYCLINIC, DENTAL_CLINIC, HOSPITAL, PHARMACY, PHYSIOTHERAPY, LABS, OPTICAL_CENTER, AMBULANCE_SERVICES, ONE_DAY_SURGERY_CENTER
lngstringNoLongitudeString, 1-50 characters
latstringNoLatitudeString, 1-50 characters

Example Request

curl -X POST "https://api.{client_namespace}.najeeb.ai/v4.0/health/medical-provider/create" \
-H "access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Al Noor Hospital",
"nphies_id": "NP-98765",
"phone_number": "+966501234567",
"city": "Riyadh",
"cchi_no": "1234567890",
"type": "HOSPITAL",
"lng": "46.6753",
"lat": "24.7136"
}'

Response

Success Response (201 Created)
{
"internal_id": 1,
"cchi_no": "1234567890",
"code": 201,
"message": "Created successfully"
}
Response Fields
FieldTypeDescription
internal_idnumberInternal identifier assigned to the provider
cchi_nostringThe CCHI number of the created provider
codenumberHTTP status code (201)
messagestringSuccess message

Error Responses

Error Response Structure
{
"ErrorCode": "string",
"message": "string",
"details": ["string"]
}
Error Codes
Error CodeHTTP StatusDescription
E_BAD_REQUEST_400400Request validation failed — see details for errors
401 Unauthorized401Missing or invalid access-key
E_EMP_02409CCHI number already in use
E_CITY_01404City not found
Example Error Responses

Bad Request:

{
"ErrorCode": "E_BAD_REQUEST_400",
"message": "Bad request",
"details": [
"name must be a string",
"type must be one of the following values: HOSPITAL, CLINIC, LAB, PHARMACY"
]
}

Unauthorized:

{
"ErrorCode": "API key is required",
"message": "Unauthorized",
"details": []
}

Conflict:

{
"ErrorCode": "E_EMP_02",
"message": "Medical provider with this CCHI number already exists",
"details": []
}

City Not Found:

{
"ErrorCode": "E_CITY_01",
"message": "City not found",
"details": []
}

Update Medical Provider

PATCH /medical-provider/:cchi_no

Update an existing medical provider. Only the fields you include in the request body will be updated.

Request Headers

HeaderTypeRequiredDescription
access-keystringYesAPI key for authentication
Content-TypestringYesMust be application/json

Path Parameters

ParameterTypeRequiredDescriptionAccepted Values
cchi_no *stringYesCCHI number of the provider to updateString, 1-50 characters

Request Body Parameters

All fields are optional (partial update).

ParameterTypeRequiredDescriptionAccepted Values
namestringNoProvider nameString, 1-255 characters
nphies_idstringNoNPHIES IDString, 1-50 characters
phone_numberstringNoPhone numberString, 1-50 characters
citystringNoCity nameString, 1-100 characters
typestringNoProvider typeEnum:
lngstringNoLongitudeString, 1-50 characters
latstringNoLatitudeString, 1-50 characters

Example Request

curl -X PATCH "https://api.{client_namespace}.najeeb.ai/v4.0/health/medical-provider/1234567890" \
-H "access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Al Noor General Hospital",
"phone_number": "+966509876543",
"type": "HOSPITAL"
}'

Response

Success Response (200 OK)
{
"internal_id": 1,
"name": "Al Noor General Hospital",
"nphies_id": "NP-98765",
"phone_number": "+966509876543",
"city": "Riyadh",
"cchi_no": "1234567890",
"type": "HOSPITAL",
"lng": "46.6753",
"lat": "24.7136",
"code": 200,
"message": "Updated successfully"
}
Response Fields
FieldTypeDescription
internal_idnumberInternal identifier of the provider
namestringProvider name
nphies_idstringNPHIES ID
phone_numberstringPhone number
citystringCity name
cchi_nostringCCHI number
typestringProvider type
lngstringLongitude
latstringLatitude
codenumberHTTP status code (200)
messagestringSuccess message

Error Responses

Error Response Structure
{
"ErrorCode": "string",
"message": "string",
"details": ["string"]
}
Error Codes
Error CodeHTTP StatusDescription
E_BAD_REQUEST_400400Request validation failed — see details for errors
401 Unauthorized401Missing or invalid access-key
E_EMP_01404Provider with given CCHI number not found
E_EMP_02409Duplicate CCHI unique constraint violation
Example Error Responses

Bad Request:

{
"ErrorCode": "E_BAD_REQUEST_400",
"message": "Bad request",
"details": [
"type must be one of the following values: HOSPITAL, CLINIC, LAB, PHARMACY"
]
}

Unauthorized:

{
"ErrorCode": "API key is required",
"message": "Unauthorized",
"details": []
}

Provider Not Found:

{
"ErrorCode": "E_EMP_01",
"message": "Medical provider not found",
"details": []
}

Conflict:

{
"ErrorCode": "E_EMP_02",
"message": "Duplicate CCHI",
"details": []
}