Skip to Content
Webhook IntegrationError Handling

Error Handling

HTTP status codes

CodeMeaningAction
200SuccessAll or some appointments processed successfully. Check warnings for partial failures.
400Bad RequestCheck the errors array for field-level validation details.
401UnauthorizedAPI key is missing, invalid, or the signature does not match. Verify your API key and signing key.
403ForbiddenAPI key is valid but not authorized for the EHR in the URL path.
500Internal Server ErrorUnexpected error on our side. Safe to retry. Contact Insight Health if persistent.

Response examples

Authentication error (401)

{ "error": "Missing X-API-Key header", "success": false }
{ "error": "Invalid X-Webhook-Signature header. Ensure the request body is signed with the correct signing key using HMAC-SHA256.", "success": false }

EHR mismatch (403)

{ "message": "API key is not authorized for EHR 'medicat'. This key is registered for 'nexus'.", "success": false, "code": 403 }

Validation error (400)

When none of the appointments pass validation, you get a 400 with an errors array listing every field-level issue. Each error is prefixed with the appointment index.

{ "message": "Validation failed. None of the provided appointments could be processed.", "errors": [ "appointments[0].appointment.id is required.", "appointments[0].appointment.status is required.", "appointments[0].appointment.start_time is required.", "appointments[0].patient.birth_date is required. Format: MM/DD/YYYY.", "appointments[1]: 'patient' object is required." ], "success": false, "code": 400 }

Partial success (200 with warnings)

When some appointments sync but others fail validation, you get a 200 with a warnings array for the failures.

{ "message": "1 appointment(s) synced successfully. 2 validation error(s) on other appointments.", "success": true, "code": 200, "warnings": [ "appointments[1].appointment.id is required.", "appointments[1].patient.id is required." ] }

Full success (200)

{ "message": "2 appointment(s) synced successfully.", "success": true, "code": 200 }

Required fields validation

The following fields are validated on each appointment. If any required field is missing, that appointment is rejected with a descriptive error.

PropertyTypeDescription
appointment*
objectThe appointment object itself must be present.
id*
stringappointment.id is required.
status*
stringappointment.status is required.
start_time*
stringappointment.start_time is required.
start_date*
stringappointment.start_date is required. Format: MM/DD/YYYY.
type*
stringappointment.type is required.
created_time*
stringappointment.created_time is required.
patient*
objectThe patient object itself must be present.
id*
stringpatient.id is required.
first_name*
stringpatient.first_name is required (or provide 'name').
last_name*
stringpatient.last_name is required (or provide 'name').
birth_date*
stringpatient.birth_date is required. Format: MM/DD/YYYY.
gender*
stringpatient.gender is required.
practitioner*
objectThe practitioner object itself must be present.
id*
stringpractitioner.id is required.
first_name*
stringpractitioner.first_name is required (or provide 'name').
last_name*
stringpractitioner.last_name is required (or provide 'name').
* Required field

Retry guidance

ScenarioAction
401 / 403Do not retry. Fix credentials or configuration.
400Do not retry. Fix the request payload using the errors array.
500Retry with exponential backoff (1s, 2s, 4s, up to 60s max).
Network timeoutRetry up to 3 times with backoff.
Last updated on