Skip to content

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 a prescriberID, 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.
pharmacyID string No Target Pharmacy ID for enrollment.
{
    "thcoPatientID": "10",
    "cboID": 1,
    "pharmacyID": "1",
    "insuranceType": "Commercial",
    "zipCode": "75034"
}

Success 201 CreatedUser enrolled successfully

{
    "data": {
        "credentialedPrescriberNPIs": [
            {
                "NPI": "NPI002",
                "name": "Jane Smith",
                "prescriberID": 2
            },
            {
                "NPI": "NPI001",
                "name": "Jane Credentialed",
                "prescriberID": 1
            }
        ],
        "patient": {
            "cboID": 1,
            "cboName": "Community Health Center 1",
            "cboPatientID": null,
            "createdBy": null,
            "createdDate": "2025-07-29T05:12:56",
            "isActive": true,
            "patientID": 1905,
            "reason": null,
            "status": "ENROLLED",
            "thcoID": 8,
            "thcoName": "Telehealth postman",
            "thcoPatientID": "THCO-8776d8",
            "updatedBy": null,
            "updatedDate": "2025-07-29T05:12:56"
        }
    },
    "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 OKProgram 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
}

Example curl

curl --location 'https://api.bridgehealthhub.com/enroll' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "thcoPatientID": "THCO99",
    "cboID": 1,
    "pharmacyID": "1",
    "insuranceType": "Commercial",
    "zipCode": "75034"
}
'

Example python

import requests
import json
url = "https://api.bridgehealthhub.com/enroll"
payload = json.dumps({
  "thcoPatientID": "THCO99",
  "cboID": 1,
  "pharmacyID": "1",
  "insuranceType": "Commercial",
  "zipCode": "75034"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '••••••'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)

Example java

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"thcoPatientID\": \"THCO99\",\n    \"cboID\": 1,\n    \"pharmacyID\": \"1\",\n    \"insuranceType\": \"Commercial\",\n    \"zipCode\": \"75034\"\n}\n");
Request request = new Request.Builder()
  .url("https://api.bridgehealthhub.com/enroll")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "••••••")
  .build();
Response response = client.newCall(request).execute();

Example c#

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.bridgehealthhub.com/enroll");
request.Headers.Add("Authorization", "••••••");
var content = new StringContent("{\n    \"thcoPatientID\": \"THCO99\",\n    \"cboID\": 1,\n    \"pharmacyID\": \"1\",\n    \"insuranceType\": \"Commercial\",\n    \"zipCode\": \"75034\"\n}\n", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

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.