curl --request POST \
--url https://sandbox.rx.tera.health/v1/patient/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"legal_document_id": "4f6a8c0e-2b1d-4e3f-8a5b-9c1d3e5f7a9b"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({legal_document_id: '4f6a8c0e-2b1d-4e3f-8a5b-9c1d3e5f7a9b'})
};
fetch('https://sandbox.rx.tera.health/v1/patient/consents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.rx.tera.health/v1/patient/consents"
payload = { "legal_document_id": "4f6a8c0e-2b1d-4e3f-8a5b-9c1d3e5f7a9b" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "0190f5c8-3c4d-7e5f-9a61-7b8c9d0e1f2a",
"document_code": "privacy",
"document_version": "2026-01",
"accepted_at": "2026-10-22T09:05:12Z",
"withdrawn_at": null,
"source": "brand_app"
}Accept a legal document
Records the patient’s acceptance in the app. Accepting a document already accepted returns the existing
record with 200. Error code: unknown_legal_document (422).
Plans: AI + health and fitness coaches (ai_health_fitness), AI only (ai_only).
curl --request POST \
--url https://sandbox.rx.tera.health/v1/patient/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"legal_document_id": "4f6a8c0e-2b1d-4e3f-8a5b-9c1d3e5f7a9b"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({legal_document_id: '4f6a8c0e-2b1d-4e3f-8a5b-9c1d3e5f7a9b'})
};
fetch('https://sandbox.rx.tera.health/v1/patient/consents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.rx.tera.health/v1/patient/consents"
payload = { "legal_document_id": "4f6a8c0e-2b1d-4e3f-8a5b-9c1d3e5f7a9b" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "0190f5c8-3c4d-7e5f-9a61-7b8c9d0e1f2a",
"document_code": "privacy",
"document_version": "2026-01",
"accepted_at": "2026-10-22T09:05:12Z",
"withdrawn_at": null,
"source": "brand_app"
}Authorizations
A 15-minute token bound to one patient and one enrollment, issued by POST /v1/oauth/token with the
token-exchange grant. Treat it as opaque. When it expires, exchange a fresh assertion; there is no refresh token.
Headers
A unique key per logical request, for example a UUID. Retrying with the same key and the same body
within 24 hours returns the first response (with Idempotent-Replayed: true) instead of creating a duplicate.
The same key with a different body is refused with 422 idempotency_key_reused.
8 - 255Body
"2d4f6a8c-0e1b-4c3d-9e5f-7a9b1c3d5e7f"
Response
Already accepted; the existing record.
"0190f5c8-2b3c-7d4e-8f50-6a7b8c9d0e1f"
"coaching_consent"
"2026-01"
ISO 8601 in UTC.
"2026-10-26T14:05:00Z"
Set by the API from the caller. brand_api for brand servers, brand_app for patient tokens issued to a brand.
app, brand_app, brand_api, wearable, coach, ai, system "brand_app"
null

