curl --request POST \
--url https://mcp.arlohealth.ai/api/consultations/{id}/messages \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
"<string>"
],
"text": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": true
}
'import requests
url = "https://mcp.arlohealth.ai/api/consultations/{id}/messages"
payload = {
"messages": ["<string>"],
"text": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
messages: ['<string>'],
text: '<string>',
lastSeenMessageId: '<string>',
waitForReply: true
})
};
fetch('https://mcp.arlohealth.ai/api/consultations/{id}/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://mcp.arlohealth.ai/api/consultations/{id}/messages",
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([
'messages' => [
'<string>'
],
'text' => '<string>',
'lastSeenMessageId' => '<string>',
'waitForReply' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://mcp.arlohealth.ai/api/consultations/{id}/messages"
payload := strings.NewReader("{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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://mcp.arlohealth.ai/api/consultations/{id}/messages")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcp.arlohealth.ai/api/consultations/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}"
response = http.request(request)
puts response.read_body{
"sent": true,
"messagesSent": 123,
"status": "<string>",
"reply": {
"id": "<string>",
"type": "text",
"content": "<string>",
"sender": "user",
"timestamp": "2023-11-07T05:31:56Z",
"senderId": "<string>"
},
"replies": [
{
"id": "<string>",
"type": "text",
"content": "<string>",
"sender": "user",
"timestamp": "2023-11-07T05:31:56Z",
"senderId": "<string>"
}
],
"stillWaiting": true,
"connected": true,
"statusChanged": "<string>",
"paymentRequired": true,
"paymentGate": {
"consultationSummary": "<string>",
"ctaText": "<string>",
"gateType": "NONE",
"isLoading": true,
"paymentType": "pay_per_use"
},
"latestMessageId": "<string>",
"conversation": {
"conversationId": "<string>",
"status": "IDLE",
"statusDescription": "<string>",
"region": "<string>",
"providerVisit": {
"active": true,
"providerName": "<string>",
"consultId": "<string>"
},
"pastVisits": [
{
"consultId": "<string>",
"closedAt": "<string>",
"hasNotes": true
}
],
"messages": [
{
"id": "<string>",
"type": "text",
"content": "<string>",
"sender": "user",
"timestamp": "2023-11-07T05:31:56Z",
"senderId": "<string>"
}
],
"omittedOlderMessages": 123,
"lastActivityAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"informationNeed": [
{
"prompt": "<string>",
"why": "<string>",
"priority": "required",
"redFlagGate": true
}
],
"informationNeedAsOfMessageId": "<string>",
"paymentGate": {
"consultationSummary": "<string>",
"ctaText": "<string>",
"gateType": "NONE",
"isLoading": true,
"paymentType": "pay_per_use"
},
"nextSteps": [
"<string>"
]
},
"userMessage": "<string>",
"agentInstructions": [
"<string>"
],
"note": "<string>",
"nextStep": "<string>",
"nextStepArgs": {}
}{
"error": "<string>",
"reason": "<string>",
"code": "<string>"
}{
"error": "<string>",
"needsAuth": true
}Send Message
Sends one or more text messages in a consultation, written in the first person as the patient speaking.
A send must be made with the newest message in hand: pass lastSeenMessageId, or read GET /api/consultations/ first. A stale send is refused with status READ_REQUIRED and the latest conversation state inline.
With waitForReply (the default) the response also carries whatever happens next: the reply, a provider connecting, or the payment gate when the send completed triage.
curl --request POST \
--url https://mcp.arlohealth.ai/api/consultations/{id}/messages \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
"<string>"
],
"text": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": true
}
'import requests
url = "https://mcp.arlohealth.ai/api/consultations/{id}/messages"
payload = {
"messages": ["<string>"],
"text": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
messages: ['<string>'],
text: '<string>',
lastSeenMessageId: '<string>',
waitForReply: true
})
};
fetch('https://mcp.arlohealth.ai/api/consultations/{id}/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://mcp.arlohealth.ai/api/consultations/{id}/messages",
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([
'messages' => [
'<string>'
],
'text' => '<string>',
'lastSeenMessageId' => '<string>',
'waitForReply' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://mcp.arlohealth.ai/api/consultations/{id}/messages"
payload := strings.NewReader("{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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://mcp.arlohealth.ai/api/consultations/{id}/messages")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcp.arlohealth.ai/api/consultations/{id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}"
response = http.request(request)
puts response.read_body{
"sent": true,
"messagesSent": 123,
"status": "<string>",
"reply": {
"id": "<string>",
"type": "text",
"content": "<string>",
"sender": "user",
"timestamp": "2023-11-07T05:31:56Z",
"senderId": "<string>"
},
"replies": [
{
"id": "<string>",
"type": "text",
"content": "<string>",
"sender": "user",
"timestamp": "2023-11-07T05:31:56Z",
"senderId": "<string>"
}
],
"stillWaiting": true,
"connected": true,
"statusChanged": "<string>",
"paymentRequired": true,
"paymentGate": {
"consultationSummary": "<string>",
"ctaText": "<string>",
"gateType": "NONE",
"isLoading": true,
"paymentType": "pay_per_use"
},
"latestMessageId": "<string>",
"conversation": {
"conversationId": "<string>",
"status": "IDLE",
"statusDescription": "<string>",
"region": "<string>",
"providerVisit": {
"active": true,
"providerName": "<string>",
"consultId": "<string>"
},
"pastVisits": [
{
"consultId": "<string>",
"closedAt": "<string>",
"hasNotes": true
}
],
"messages": [
{
"id": "<string>",
"type": "text",
"content": "<string>",
"sender": "user",
"timestamp": "2023-11-07T05:31:56Z",
"senderId": "<string>"
}
],
"omittedOlderMessages": 123,
"lastActivityAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"informationNeed": [
{
"prompt": "<string>",
"why": "<string>",
"priority": "required",
"redFlagGate": true
}
],
"informationNeedAsOfMessageId": "<string>",
"paymentGate": {
"consultationSummary": "<string>",
"ctaText": "<string>",
"gateType": "NONE",
"isLoading": true,
"paymentType": "pay_per_use"
},
"nextSteps": [
"<string>"
]
},
"userMessage": "<string>",
"agentInstructions": [
"<string>"
],
"note": "<string>",
"nextStep": "<string>",
"nextStepArgs": {}
}{
"error": "<string>",
"reason": "<string>",
"code": "<string>"
}{
"error": "<string>",
"needsAuth": true
}Path Parameters
Consultation/conversation ID
Body
Array of message texts to send
Single message text (alternative to messages array)
Newest message id you have seen. Satisfies the read-first gate without a separate read; a stale value is refused.
Wait up to ~55s for the next reply and return it inline. On timeout the response carries stillWaiting - the message is already sent, so never re-send.
Response
Message sent
False on a READ_REQUIRED or PAYMENT_REQUIRED refusal
Conversation status, or READ_REQUIRED / PAYMENT_REQUIRED on a refusal
A message in a consultation
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The wait timed out; the message is sent, keep waiting
A provider joined while waiting (status WITH_PROVIDER)
The status the conversation moved to during the wait
The send completed triage, so the patient must confirm payment
Payment gate information when triage is complete
Show child attributes
Show child attributes
On READ_REQUIRED, retry with this as lastSeenMessageId
Full conversation details with messages
Show child attributes
Show child attributes
Patient-facing wording to relay
Suggested follow-up call
Arguments to pass to nextStep
Was this page helpful?