Send emails
curl --request POST \
--url https://api.maxcare.ai/v1/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"from": "notifications",
"subject": "Your upcoming appointment on March 25",
"html": "<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>",
"emailType": "appointment_reminder",
"patientIds": [
"8de03039-3a9e-417a-b2b3-a8b8df183631"
],
"userIds": [
"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0"
],
"scheduledAt": "2026-03-25T10:00:00Z"
}
'import requests
url = "https://api.maxcare.ai/v1/emails/send"
payload = {
"from": "notifications",
"subject": "Your upcoming appointment on March 25",
"html": "<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>",
"emailType": "appointment_reminder",
"patientIds": ["8de03039-3a9e-417a-b2b3-a8b8df183631"],
"userIds": ["1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0"],
"scheduledAt": "2026-03-25T10:00:00Z"
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'notifications',
subject: 'Your upcoming appointment on March 25',
html: '<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>',
emailType: 'appointment_reminder',
patientIds: ['8de03039-3a9e-417a-b2b3-a8b8df183631'],
userIds: ['1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0'],
scheduledAt: '2026-03-25T10:00:00Z'
})
};
fetch('https://api.maxcare.ai/v1/emails/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.maxcare.ai/v1/emails/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => 'notifications',
'subject' => 'Your upcoming appointment on March 25',
'html' => '<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>',
'emailType' => 'appointment_reminder',
'patientIds' => [
'8de03039-3a9e-417a-b2b3-a8b8df183631'
],
'userIds' => [
'1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0'
],
'scheduledAt' => '2026-03-25T10:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Organization-Id: <x-organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxcare.ai/v1/emails/send"
payload := strings.NewReader("{\n \"from\": \"notifications\",\n \"subject\": \"Your upcoming appointment on March 25\",\n \"html\": \"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>\",\n \"emailType\": \"appointment_reminder\",\n \"patientIds\": [\n \"8de03039-3a9e-417a-b2b3-a8b8df183631\"\n ],\n \"userIds\": [\n \"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0\"\n ],\n \"scheduledAt\": \"2026-03-25T10:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maxcare.ai/v1/emails/send")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"notifications\",\n \"subject\": \"Your upcoming appointment on March 25\",\n \"html\": \"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>\",\n \"emailType\": \"appointment_reminder\",\n \"patientIds\": [\n \"8de03039-3a9e-417a-b2b3-a8b8df183631\"\n ],\n \"userIds\": [\n \"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0\"\n ],\n \"scheduledAt\": \"2026-03-25T10:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v1/emails/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"notifications\",\n \"subject\": \"Your upcoming appointment on March 25\",\n \"html\": \"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>\",\n \"emailType\": \"appointment_reminder\",\n \"patientIds\": [\n \"8de03039-3a9e-417a-b2b3-a8b8df183631\"\n ],\n \"userIds\": [\n \"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0\"\n ],\n \"scheduledAt\": \"2026-03-25T10:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"sent": [
{
"id": "a7c3f1e2-8b4d-4a9e-b5c6-d7e8f9012345",
"recipientEmail": "jane.doe@example.com",
"recipientType": "patient",
"recipientId": "8de03039-3a9e-417a-b2b3-a8b8df183631",
"emailType": "appointment_reminder",
"subject": "Your upcoming appointment on March 25",
"fromAddress": "notifications@accounts.maxcare.ai",
"status": "sent",
"scheduledAt": null,
"sentAt": "2026-03-25 10:00:01.234+00",
"deliveredAt": "2026-03-25 10:00:03.567+00",
"openedAt": null,
"bouncedAt": null,
"createdAt": "2026-03-25 09:59:58.891+00"
}
],
"errors": [
{
"recipientId": "8de03039-3a9e-417a-b2b3-a8b8df183631",
"recipientType": "patient",
"error": "Patient has no email address on file"
}
]
}
}{
"code": "unauthorized",
"message": "Invalid or missing API key",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "forbidden",
"message": "Insufficient scope",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Emails
Send emails
Send emails to patients and/or staff users by their IDs. Returns sent records and any errors.
POST
/
emails
/
send
Send emails
curl --request POST \
--url https://api.maxcare.ai/v1/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"from": "notifications",
"subject": "Your upcoming appointment on March 25",
"html": "<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>",
"emailType": "appointment_reminder",
"patientIds": [
"8de03039-3a9e-417a-b2b3-a8b8df183631"
],
"userIds": [
"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0"
],
"scheduledAt": "2026-03-25T10:00:00Z"
}
'import requests
url = "https://api.maxcare.ai/v1/emails/send"
payload = {
"from": "notifications",
"subject": "Your upcoming appointment on March 25",
"html": "<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>",
"emailType": "appointment_reminder",
"patientIds": ["8de03039-3a9e-417a-b2b3-a8b8df183631"],
"userIds": ["1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0"],
"scheduledAt": "2026-03-25T10:00:00Z"
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'notifications',
subject: 'Your upcoming appointment on March 25',
html: '<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>',
emailType: 'appointment_reminder',
patientIds: ['8de03039-3a9e-417a-b2b3-a8b8df183631'],
userIds: ['1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0'],
scheduledAt: '2026-03-25T10:00:00Z'
})
};
fetch('https://api.maxcare.ai/v1/emails/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.maxcare.ai/v1/emails/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => 'notifications',
'subject' => 'Your upcoming appointment on March 25',
'html' => '<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>',
'emailType' => 'appointment_reminder',
'patientIds' => [
'8de03039-3a9e-417a-b2b3-a8b8df183631'
],
'userIds' => [
'1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0'
],
'scheduledAt' => '2026-03-25T10:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Organization-Id: <x-organization-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxcare.ai/v1/emails/send"
payload := strings.NewReader("{\n \"from\": \"notifications\",\n \"subject\": \"Your upcoming appointment on March 25\",\n \"html\": \"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>\",\n \"emailType\": \"appointment_reminder\",\n \"patientIds\": [\n \"8de03039-3a9e-417a-b2b3-a8b8df183631\"\n ],\n \"userIds\": [\n \"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0\"\n ],\n \"scheduledAt\": \"2026-03-25T10:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maxcare.ai/v1/emails/send")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"notifications\",\n \"subject\": \"Your upcoming appointment on March 25\",\n \"html\": \"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>\",\n \"emailType\": \"appointment_reminder\",\n \"patientIds\": [\n \"8de03039-3a9e-417a-b2b3-a8b8df183631\"\n ],\n \"userIds\": [\n \"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0\"\n ],\n \"scheduledAt\": \"2026-03-25T10:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v1/emails/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"notifications\",\n \"subject\": \"Your upcoming appointment on March 25\",\n \"html\": \"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>\",\n \"emailType\": \"appointment_reminder\",\n \"patientIds\": [\n \"8de03039-3a9e-417a-b2b3-a8b8df183631\"\n ],\n \"userIds\": [\n \"1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0\"\n ],\n \"scheduledAt\": \"2026-03-25T10:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"sent": [
{
"id": "a7c3f1e2-8b4d-4a9e-b5c6-d7e8f9012345",
"recipientEmail": "jane.doe@example.com",
"recipientType": "patient",
"recipientId": "8de03039-3a9e-417a-b2b3-a8b8df183631",
"emailType": "appointment_reminder",
"subject": "Your upcoming appointment on March 25",
"fromAddress": "notifications@accounts.maxcare.ai",
"status": "sent",
"scheduledAt": null,
"sentAt": "2026-03-25 10:00:01.234+00",
"deliveredAt": "2026-03-25 10:00:03.567+00",
"openedAt": null,
"bouncedAt": null,
"createdAt": "2026-03-25 09:59:58.891+00"
}
],
"errors": [
{
"recipientId": "8de03039-3a9e-417a-b2b3-a8b8df183631",
"recipientType": "patient",
"error": "Patient has no email address on file"
}
]
}
}{
"code": "unauthorized",
"message": "Invalid or missing API key",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "forbidden",
"message": "Insufficient scope",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Authorizations
Marketplace API key
Headers
Target clinic organization ID
Body
application/json
Email sender prefix (becomes @accounts.maxcare.ai)
Example:
"notifications"
Email subject line
Example:
"Your upcoming appointment on March 25"
Email body as raw HTML
Example:
"<h1>Appointment Reminder</h1><p>You have an appointment scheduled for March 25 at 10:00 AM.</p>"
Email type for categorization
Example:
"appointment_reminder"
Patient IDs to send to
Example:
["8de03039-3a9e-417a-b2b3-a8b8df183631"]
Staff user IDs to send to
Example:
["1231b6f3-2b4f-4b8f-8eeb-4f7806bc45b0"]
Schedule send time (ISO 8601)
Example:
"2026-03-25T10:00:00Z"
