Create a new user
Once a user completes your onboarding process, create a user within Counsel. We recommend passing an Idempotency-Key header to ensure that the user is created only once. Response replays are available for one day after the request completes.
Idempotency keys are best-effort and may be lost before the one-day window elapses. If a key is no longer available, a retry is executed as a new request rather than replayed, so do not rely on replays as a durable record of the original response. The API accepts a predefined ID as UUID for the user. If you do not pass an ID, the API will generate one for you.
Phone number must be unique per user. The API will throw if you try to create two users with the same number. On Sandbox, you can use +1 800 700 6000 as a test number which is permissioned to create multiple users.
Set the access_expires_at field to expire the user's access to the platform at a future date.
Request
- Base URLhttps://api.counselhealth.com (the document declares no server; this is the origin it was published from)
- AuthHTTP bearer
Headers
Optional idempotency key. Repeat requests with the same key and body return the original result.
Request body
Example request
{
"dob": "1990-01-01",
"phone": "+18007006000",
"addresses": [
{
"line1": "123 Main St",
"line2": "Apt 2",
"city": "San Francisco",
"state": "CA",
"zip": "12345"
}
],
"race": [
"White",
"Asian"
],
"medical_profile": {
"conditions": [
"Diabetes"
],
"medications": [
"Metformin"
],
"medication_allergies": [
"Tylenol"
],
"surgeries": [
"Appendectomy"
],
"family_history": [
"Diabetes"
],
"doctors": {
"pcp_name": "Dr. Joe Doe",
"specialist_types": [
"Cardiologist"
]
},
"additional_details": {}
},
"email": "john.doe@example.com",
"metadata": {
"plan": "pro",
"external_id": "1234567890"
},
"external_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"access_expires_at": "2030-01-01T00:00:00Z",
"first_name": "John",
"last_name": "Doe",
"preferred_name": "Bob",
"id": "550e8400-e29b-41d4-a716-446655440000"
}Response
A fully onboarded API user with clinical profile and contact info.
Example response
{
"created_at": "2030-01-01T00:00:00Z",
"dob": "1990-01-01",
"phone": "+18007006000",
"addresses": [
{
"line1": "123 Main St",
"line2": "Apt 2",
"city": "San Francisco",
"state": "CA",
"zip": "12345"
}
],
"race": [
"White",
"Asian"
],
"medical_profile": {
"conditions": [
"Diabetes"
],
"medications": [
"Metformin"
],
"medication_allergies": [
"Tylenol"
],
"surgeries": [
"Appendectomy"
],
"family_history": [
"Diabetes"
],
"doctors": {
"pcp_name": "Dr. Joe Doe",
"specialist_types": [
"Cardiologist"
]
},
"additional_details": {}
},
"access_expires_at": "2030-01-01T00:00:00Z",
"email": "john.doe@example.com",
"metadata": {
"plan": "pro",
"external_id": "1234567890"
},
"onboarded_at": "2030-01-01T00:00:00Z",
"external_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
}Changes
No recorded changes to this operation across all 1 revision of this API.