POST /disenroll
- Purpose: Disenroll an actively enrolled patient from a CBO’s GLP-1 weight-loss program
- Auth:
Authorization: Bearer <access_token>
- Content-Type:
application/json
- Idempotent: No – calling this a second time for the same patient yields a 400 Bad Request error
Request Body Schema
Field | Type | Required | Notes |
---|---|---|---|
thcoPatientID |
string | Yes | Telehealth platform’s patient identifier. |
reason |
string | No | Human-readable reason for disenrollment. |
{
"thcoPatientID": "10",
"reason": "No longer want to continue therapy"
}
Example curl
curl --location 'https://api.bridgehealthhub.com/disenroll' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{"reason": "not interested", "thcoPatientID": "THCO99"}'
Example python
import requests
import json
url = "https://api.bridgehealthhub.com/disenroll"
payload = json.dumps({
"reason": "not interested",
"thcoPatientID": "THCO99"
})
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, "{\"reason\": \"not interested\", \"thcoPatientID\": \"THCO99\"}");
Request request = new Request.Builder()
.url("https://api.bridgehealthhub.com/disenroll")
.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/disenroll");
request.Headers.Add("Authorization", "••••••");
var content = new StringContent("{\"reason\": \"not interested\", \"thcoPatientID\": \"THCO99\"}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Success 200 OK
— User is disenrolled
{"reason": "No longer want to continue therapy", "thcoPatientID": 10}
{
"data": {},
"message": "User is disenrolled",
"success": true
}
Error Responses for POST /disenroll
400 Bad Request
- Patient was not Enrolled
{
"error": {
"code": "BAD_REQUEST",
"details": "patient is not enrolled"
},
"message": "Bad request",
"success": false
}
400 Bad Request
- Missing thcoPatientID
{
"error": {
"code": "BAD_REQUEST",
"details": "patient id is not provided"
},
"message": "Bad request",
"success": false
}