Create a chat session
curl --request POST \
--url https://backend.drivehealth.ai/api/v1/chat/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assistant_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}
'import requests
url = "https://backend.drivehealth.ai/api/v1/chat/create"
payload = { "assistant_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({assistant_id: '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d'})
};
fetch('https://backend.drivehealth.ai/api/v1/chat/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"err": false,
"msg": "Success",
"results": {
"chat_id": "9f8e7d6c-5b4a-4938-8271-6a5b4c3d2e1f"
}
}Chat
Create a chat session
Start a chat with a caregiver. The caregiver must belong to your organization. The session it creates is owned by that same organization and appears in the chat results.
POST
/
api
/
v1
/
chat
/
create
Create a chat session
curl --request POST \
--url https://backend.drivehealth.ai/api/v1/chat/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assistant_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}
'import requests
url = "https://backend.drivehealth.ai/api/v1/chat/create"
payload = { "assistant_id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({assistant_id: '1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d'})
};
fetch('https://backend.drivehealth.ai/api/v1/chat/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"err": false,
"msg": "Success",
"results": {
"chat_id": "9f8e7d6c-5b4a-4938-8271-6a5b4c3d2e1f"
}
}Authorizations
organizationBearerorganizationApiKey
An organization API key starting with dh_, sent as Authorization: Bearer dh_your_api_key.
Body
application/json
ID of the caregiver to chat with. It must belong to your organization.
