List intramail messages
curl --request GET \
--url https://api.maxcare.ai/v4/intramail/messages \
--header 'Authorization: Bearer <token>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.maxcare.ai/v4/intramail/messages"
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Organization-Id': '<x-organization-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.maxcare.ai/v4/intramail/messages', 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/v4/intramail/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.maxcare.ai/v4/intramail/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.maxcare.ai/v4/intramail/messages")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v4/intramail/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"messages": [
{
"id": "iml_5f1c0000000040000000000000000001",
"mailboxId": "imb_5f1c0000000040000000000000000003",
"folder": "inbox",
"subject": "<string>",
"body": "<string>",
"priority": "low",
"author": {
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
},
"to": [
{
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
}
],
"cc": [
{
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
}
],
"deliveredTo": [
{
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
}
],
"patientId": "<string>",
"noteId": "<string>",
"attachments": [
{
"ehrId": "9",
"name": "<string>",
"size": "12 KB"
}
],
"read": true,
"flagged": true,
"createdAt": "<string>",
"modifiedAt": "<string>",
"syncedAt": "<string>"
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"totalCount": 123,
"totalPages": 123
}
}
}{
"code": "bad_request",
"message": "'id' must be a valid UUID",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"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"
}Intramail
List intramail messages
One folder of the user’s mailbox (see X-Session-Token), newest first, as of the last sync (see syncedAt and GET /intramail/status).
GET
/
intramail
/
messages
List intramail messages
curl --request GET \
--url https://api.maxcare.ai/v4/intramail/messages \
--header 'Authorization: Bearer <token>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.maxcare.ai/v4/intramail/messages"
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Organization-Id': '<x-organization-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.maxcare.ai/v4/intramail/messages', 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/v4/intramail/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.maxcare.ai/v4/intramail/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.maxcare.ai/v4/intramail/messages")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v4/intramail/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"messages": [
{
"id": "iml_5f1c0000000040000000000000000001",
"mailboxId": "imb_5f1c0000000040000000000000000003",
"folder": "inbox",
"subject": "<string>",
"body": "<string>",
"priority": "low",
"author": {
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
},
"to": [
{
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
}
],
"cc": [
{
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
}
],
"deliveredTo": [
{
"type": "staff",
"ehrId": "1671336",
"name": "Enea Gjoka"
}
],
"patientId": "<string>",
"noteId": "<string>",
"attachments": [
{
"ehrId": "9",
"name": "<string>",
"size": "12 KB"
}
],
"read": true,
"flagged": true,
"createdAt": "<string>",
"modifiedAt": "<string>",
"syncedAt": "<string>"
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"totalCount": 123,
"totalPages": 123
}
}
}{
"code": "bad_request",
"message": "'id' must be a valid UUID",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"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
The App Bridge token of the logged-in user (maxcare.appToken()), verified for this app and organization. With it the request reaches that user's own mail; without it, the mail of the API key's creator. A token that does not verify is 401 authorizer_unverified. Sent as a header so GET requests keep it out of URLs.
Target clinic organization ID
Query Parameters
Available options:
inbox, archived, sent, draft Only messages linked to this patient (pat_…)
Mailbox (imb_…) from GET /intramail/status: one of the acting user's EHR logins. Defaults to the one marked isDefault.
Required range:
x >= 1Required range:
1 <= x <= 100