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

Webhook

Register and manage webhook endpoints to receive real-time event notifications from the Najeeb system. Webhooks allow your application to be notified when events occur, such as Prior Authorization processing completion and async bulk Policy operations.

Base URL:

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

Create Webhook

POST /webhook/create

Register a new webhook endpoint to receive event notifications. Once created, the webhook is immediately active and will begin receiving events of the specified type.

Request Body

FieldTypeRequiredDescription
webhook_urlstringYesThe URL that will receive webhook event payloads via HTTP POST
hook_typeenumYesEvent type to subscribe to. One of: CLAIM, PRE_AUTH, BOTH, POLICY, PRE_AUTH_RESULT (required to receive prior authorization decision results), COMMUNICATION, REOPENED, REFERRED
secret_tokenstringNoSecret token for verifying webhook payloads on your end

Request Example

curl -X POST \
"https://api.{client_namespace}.najeeb.ai/v4.0/health/webhook/create" \
-H "access-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"webhook_url": "https://example.com/my-webhook-endpoint",
"hook_type": "BOTH",
"secret_token": "1234567890"
}'

Response

201 Created

{
"id": 1,
"webhook_url": "https://example.com/my-webhook-endpoint",
"hook_type": "BOTH",
"secret_token": "1234567890",
"is_active": true,
"created_at": "2021-01-01T00:00:00.000Z"
}

Error Responses

StatusDescription
400Bad Request - Invalid or missing fields (e.g., invalid URL, missing hook_type)
401Unauthorized - Invalid or missing access-key

List Webhooks

GET /webhook/list

Returns all registered webhooks for your account.

Request Example

curl -X GET \
"https://api.{client_namespace}.najeeb.ai/v4.0/health/webhook/list" \
-H "access-key: your-api-key-here"

Response

200 OK

{
"data": [
{
"id": 1,
"webhook_url": "https://example.com/my-webhook-endpoint",
"hook_type": "BOTH",
"secret_token": "1234567890",
"is_active": true,
"created_at": "2021-01-01T00:00:00.000Z"
}
]
}

Error Responses

StatusDescription
401Unauthorized - Invalid or missing access-key

Remove Webhook

DELETE /webhook/remove/:id

Remove a registered webhook. The webhook will stop receiving event notifications.

Path Parameters

ParameterTypeRequiredDescription
idintegerYesID of the webhook to remove

Request Example

curl -X DELETE \
"https://api.{client_namespace}.najeeb.ai/v4.0/health/webhook/remove/1" \
-H "access-key: your-api-key-here"

Response

200 OK

Returns the removed webhook data with is_active set to false.

{
"id": 1,
"webhook_url": "https://example.com/my-webhook-endpoint",
"hook_type": "BOTH",
"secret_token": "1234567890",
"is_active": false,
"created_at": "2021-01-01T00:00:00.000Z"
}

Error Responses

StatusDescription
401Unauthorized - Invalid or missing access-key
404Not Found - Webhook with given ID not found

Event Example Payloads

Webhook event payloads vary by hook_type. Select a tab below for an example.

To receive prior authorization decision results, register a webhook with hook_type set to PRE_AUTH_RESULT. After the Najeeb Engine finishes processing a pre-authorization request, the final decision is delivered to your webhook endpoint as an HTTP POST.

For the full field reference, see Prior Authorization as a Service — Webhook Response.

{
"event_type": "PRE_AUTH_RESULT",
"data": {
"pre_auth_internal_id": 161081,
"transaction_id": "#tr-0001",
"authorization_number": "#A-0001",
"nphies_reopen_at": null,
"nphies_reopen_reason": null,
"submitter_erp_id": null,
"approval_remarks": "This is a test prior authorization",
"referral_remarks": null,
"internal_referral_notes": null,
"is_referred": false,
"internal_notes": null,
"request_alerts": [
"A prior authorization for the same diagnosis and service was previously submitted and rejected."
],
"status": "PENDING",
"reviewer_erp_id": null,
"member_id": "uat-a-002",
"source": "PORTAL",
"is_emergency": false,
"is_new_born": false,
"is_maternity": false,
"related_authorization_number": null,
"claim_type": null,
"treatment_date": "2025-12-05T19:40:28.542Z",
"period_start_date": "2025-12-05T19:40:28.542Z",
"doctor_id": "1",
"doctor_name": "Dr. Ahmed",
"doctor_speciality": "Cardiology",
"nphies_bundle_id": "1",
"provider_system_id": "Provider System ID",
"provider_comment": "Provider Comment",
"ERP_user_id": null,
"price_list_level": "Price List Level",
"patient_id": "uat-a-002",
"medical_provider_cchi_no": "22697412",
"ph_erp_id": "default",
"currency": "SAR",
"currency_rate": 1,
"is_reviewer_accepted_as_road_traffic_accident": false,
"is_traffic_accident": false,
"assign_to_erp_id": null,
"additional_remarks": null,
"total_recovery_utilized": 0,
"total_exgratia_utilized": 0,
"benefit_code": null,
"is_referral": false,
"referral_provider_cchi_code": null,
"valid_days": null,
"referred_at": null,
"encounter": {
"encounter_id": "Encounter ID",
"encounter_status": "active",
"encounter_class": "inpatient",
"encounter_priority": "urgent",
"encounter_start_date": "2025-12-05T19:40:28.542Z",
"encounter_end_date": "2025-12-05T19:40:28.542Z",
"encounter_arrival_code": "A01",
"encounter_department": "Cardiology",
"encounter_triage_category": "Category1",
"encounter_triage_date": "2025-12-05T19:40:28.542Z",
"encounter_death_cause": "Heart Failure",
"encounter_admit_source": "Referral",
"encounter_length_of_stay": "5 days",
"encounter_admission": "Admission details",
"encounter_discharge": "Discharge details"
},
"items_decisions": [
{
"item_erp_id": "16562",
"service_code": "9-420-05",
"duration": null,
"frequency": "10 times",
"admission_date": "2025-12-05T19:40:28.541Z",
"discharge_date": "2025-12-05T19:40:28.541Z",
"approved_quantity": 2,
"approved_amount": 4500,
"price": 0,
"request_amount": 4500,
"provider_deductible_amount": 0,
"net_request_amount": 4500,
"rejected_amount": 0,
"price_rejected_amount": 0,
"net_payable": null,
"decision": "PENDING",
"warning_message": null,
"benefit_code": 10,
"sub_benefit_code": 1001,
"reason_code": [
{
"najeeb_ai_code": "BE-1-5",
"najeeb_ai_description": "Claim information is inconsistent with preauthorized services",
"najeeb_ai_message": "Pharmaceutical service Hepsera 10 mg tablet is inconsistent with claim type PROFESSIONAL",
"nphies_code": "BE-1-5",
"nphies_description": "Claim information is inconsistent with preauthorized services",
"special_case_amount": null,
"erp_code": null,
"is_approved": false,
"source": "RULES"
},
{
"najeeb_ai_code": "AD-2-5",
"najeeb_ai_description": "Time limit for submission has expired",
"najeeb_ai_message": "The time difference between the treatment date and the request date is more than 48 hours.",
"nphies_code": "AD-2-5",
"nphies_description": "Time limit for submission has expired",
"special_case_amount": null,
"erp_code": null,
"is_approved": false,
"source": "RULES"
}
],
"najeeb_ai_alert": "Diagnosis \"Z24\" is invalid / inactive as per the ICD AM 10th Ed. Electronic Code List Edits.",
"najeeb_ai_score": 0,
"pbm_drug_info": {
"sfda_code": "9-420-05",
"name": "Hepsera 10 mg tablet",
"scientific_name": "adefovir dipivoxil",
"manufacture_name": "Hepsera",
"pharmaceutical_form": "Tablet",
"strength": "10",
"unit": "mg",
"package_size": "30.000",
"price": 1871.95
}
},
{
"item_erp_id": "16562",
"service_code": "179-186-02",
"duration": null,
"frequency": "10 times",
"admission_date": "2025-12-05T19:40:28.541Z",
"discharge_date": "2025-12-05T19:40:28.541Z",
"approved_quantity": 2,
"approved_amount": 4500,
"price": 0,
"request_amount": 4500,
"provider_deductible_amount": 0,
"net_request_amount": 4500,
"rejected_amount": 0,
"price_rejected_amount": 0,
"net_payable": null,
"decision": "PENDING",
"warning_message": null,
"benefit_code": 10,
"sub_benefit_code": 1001,
"reason_code": [
{
"najeeb_ai_code": "BE-1-5",
"najeeb_ai_description": "Claim information is inconsistent with preauthorized services",
"najeeb_ai_message": "Pharmaceutical service Albenda 200 mg tablet is inconsistent with claim type PROFESSIONAL",
"nphies_code": "BE-1-5",
"nphies_description": "Claim information is inconsistent with preauthorized services",
"special_case_amount": null,
"erp_code": null,
"is_approved": false,
"source": "RULES"
},
{
"najeeb_ai_code": "AD-2-5",
"najeeb_ai_description": "Time limit for submission has expired",
"najeeb_ai_message": "The time difference between the treatment date and the request date is more than 48 hours.",
"nphies_code": "AD-2-5",
"nphies_description": "Time limit for submission has expired",
"special_case_amount": null,
"erp_code": null,
"is_approved": false,
"source": "RULES"
}
],
"najeeb_ai_alert": "Diagnosis \"Z24\" is invalid / inactive as per the ICD AM 10th Ed. Electronic Code List Edits.",
"najeeb_ai_score": 0,
"pbm_drug_info": {
"sfda_code": "179-186-02",
"name": "Albenda 200 mg tablet",
"scientific_name": "albendazole",
"manufacture_name": "Albenda",
"pharmaceutical_form": "Film-coated tablet",
"strength": "200",
"unit": "mg",
"package_size": "2.000",
"price": 6.15
}
}
]
}
}