POST /enroll
- Purpose: Enroll a patient in a CBO’s GLP-1 weight-loss program. This call also internally runs
/checkProgramAvailability(to ensure program availability) and, if the request includes aprescriberID, verifies provider credentialing. - Auth:
Authorization: Bearer <access_token> - Content-Type:
application/json - Idempotent: No – a second call for the same patient/CBO returns a 400 Bad Request error.
Request body schema
| Field | Type | Required | Notes |
|---|---|---|---|
thcoPatientID |
string | Yes | Tele-health platform’s patient identifier (opaque to this API). |
cboID |
integer | Yes | Target CBO for enrollment. |
insuranceType |
string | Yes | "Commercial" | "Government" |
zipCode |
string | Yes | 5-digit U.S. ZIP code. |
{
"thcoPatientID": "10",
"cboID": 1,
"insuranceType": "Commercial",
"zipCode": "75034"
}
Success 201 Created — User enrolled successfully
{
"data": {
"credentialedPrescriberNPIs": [
{
"NPI": "NPI001",
"name": "Jane Credentialed",
"prescriberID": 1
},
{
"NPI": "NPI002",
"name": "Jane Smith",
"prescriberID": 2
}
],
"patient": {
"cboID": 1,
"cboPatientID": null,
"createdBy": null,
"createdDate": "2025-06-08T09:12:40",
"dob": null,
"firstName": null,
"insuranceType": null,
"isActive": true,
"lastName": null,
"middleName": null,
"patientID": 19,
"reason": null,
"shippingAddress": null,
"state": null,
"status": "ENROLLED",
"thcoID": 4,
"thcoPatientID": "10",
"updatedBy": null,
"updatedDate": "2025-06-08T09:12:40",
"zipCode": null
}
},
"message": "User enrolled successfully",
"success": true
}
| Field | Type | Notes |
|---|---|---|
data.credentialedPrescriberNPIs |
array |
List of all credentialed providers for this CBO. |
data.patient |
Patient | The newly enrolled patient record. |
| See Data Models section for definitions of CredentialedPrescriberNPI and Patient. |
Conditional 200 OK — Program Unavailable
If enrollment fails due to program unavailability (ZIP + insurance combo), you receive a successful envelope with eligible = false:
{
"data": {
"cbos": [],
"eligible": false,
"reason": "Unavailable due to insurance type"
},
"message": "Program is Unavailable",
"success": true
}
Error Responses for POST /enroll
400 Bad Request - User Already Enrolled
If a request is made to enroll a patient with a tchoPatientID that is already actively enrolled in a program, this error response will be given with the message "patient is already enrolled".
{
"error": {
"code": "BAD_REQUEST",
"details": "patient is already enrolled."
},
"message": "Bad request",
"success": false
}
400 Bad Request - Invalid Zip Code
If a request is made to enroll a patient with a zip code that does not contain the necessary 5 digits that would be expected from a typical zip code.
{
"error": {
"code": "BAD_REQUEST",
"details": "Invalid length for fields: Patient Zip Code (length 4, expected min 5 to max 5)"
},
"message": "Bad request",
"success": false
}
400 Bad Request - Invalid CBO ID
If a request is made to enroll a patient with a CBO ID that is not an integer.
{
"error": {
"code": "BAD_REQUEST",
"details": "Invalid type for fields: CBO ID (expected int)"
},
"message": "Bad request",
"success": false
}
400 Bad Request - Missing Required Fields
If a request is made to enroll a patient with one of the required fields missing.
{
"error": {
"code": "BAD_REQUEST",
"details": "Missing required fields: Patient Zip Code, CBO ID"
},
"message": "Bad request",
"success": false
}
401 Unauthorized
This error occurs when there is a missing/invalid bearer token (see global Auth section).
404 Not Found
This error occurs when the endpoint path is incorrect and is presented as a standard 404 HTML/JSON response from the gateway.