Network
The Network module allows you to create and manage medical networks. Networks group medical providers together and can be associated with insurance policies to define which providers are eligible to serve members under a given plan.
Base URL
https://api.{client_namespace}.najeeb.ai/v4.0/health
Replace {client_namespace} with your organization's assigned namespace.
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 Network
POST /network/create
Create a new medical network.
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
access-key | string | Yes | API key for authentication |
Content-Type | string | Yes | Must be application/json |
Request Body Parameters
| Parameter | Type | Required | Description | Accepted Values |
|---|---|---|---|---|
name * | string | Yes | The name of the network. Must be unique. | String, 1-255 characters |
is_vip | boolean | No | Whether this network is designated as VIP. | true, false (default: false) |
Response
Success Response (201 Created)
{
"internal_id": 1,
"name": "City General Hospital Network",
"is_vip": false,
"code": 201,
"message": "Network created successfully"
}
Response Fields
| Field | Type | Description |
|---|---|---|
internal_id | integer | The unique identifier of the created network |
name | string | The name of the network |
is_vip | boolean | VIP status of the network |
code | integer | HTTP status code (201) |
message | string | Human-readable success message |
Error Responses
Error Response Structure
{
"ErrorCode": "string",
"message": "string",
"details": ["string"]
}
Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
E_BAD_REQUEST_400 | 400 | Request validation failed -- the request body is malformed or missing required fields |
401 Unauthorized | 401 | Missing or invalid access-key |
E_CONFLICT_409 | 409 | A network with the same name already exists |
Example Error Responses
Bad Request:
{
"ErrorCode": "E_BAD_REQUEST_400",
"message": "Bad request",
"details": [
"name must be a string",
"name should not be empty"
]
}
Unauthorized:
{
"ErrorCode": "API key is required",
"message": "Unauthorized",
"details": []
}
Conflict:
{
"ErrorCode": "E_CONFLICT_409",
"message": "A network with this name already exists",
"details": []
}
Code Examples
- cURL
- JavaScript
- Python
curl -X POST "https://api.{client_namespace}.najeeb.ai/v4.0/health/network/create" \
-H "access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "City General Hospital Network",
"is_vip": false
}'
const response = await fetch(
"https://api.{client_namespace}.najeeb.ai/v4.0/health/network/create",
{
method: "POST",
headers: {
"access-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "City General Hospital Network",
is_vip: false,
}),
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
"https://api.{client_namespace}.najeeb.ai/v4.0/health/network/create",
headers={
"access-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"name": "City General Hospital Network",
"is_vip": False,
},
)
result = response.json()
print(result)
Update Network
PATCH /network/update/:id
Update an existing network by its ID. You can modify the network name, VIP status, or both.
important
At least one field (name or is_vip) must be provided in the request body.
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
access-key | string | Yes | API key for authentication |
Content-Type | string | Yes | Must be application/json |
Path Parameters
| Parameter | Type | Required | Description | Accepted Values |
|---|---|---|---|---|
id * | integer | Yes | The unique identifier of the network | Positive integer |
Request Body Parameters
| Parameter | Type | Required | Description | Accepted Values |
|---|---|---|---|---|
name | string | No | The updated name of the network. Must be unique. | String, 1-255 characters |
is_vip | boolean | No | The updated VIP status of the network. | true, false |
Response
Success Response (200 OK)
{
"id": 1,
"name": "Updated Network Name",
"is_vip": true,
"code": 200,
"message": "Network updated successfully"
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | integer | The unique identifier of the network |
name | string | The updated name of the network |
is_vip | boolean | The updated VIP status of the network |
code | integer | HTTP status code (200) |
message | string | Human-readable success message |
Error Responses
Error Response Structure
{
"ErrorCode": "string",
"message": "string",
"details": ["string"]
}
Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
E_BAD_REQUEST_400 | 400 | Request validation failed -- the request body is malformed or contains invalid data |
401 Unauthorized | 401 | Missing or invalid access-key |
E_NOT_FOUND_404 | 404 | No network exists with the specified id |
E_CONFLICT_409 | 409 | A network with the same name already exists |