Send message in a consultation
curl --request POST \
--url https://mcp.arlohealth.ai/api/consultations/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
"<string>"
],
"text": "<string>",
"region": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": true
}
'import requests
url = "https://mcp.arlohealth.ai/api/consultations/{id}/messages"
payload = {
"messages": ["<string>"],
"text": "<string>",
"region": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": True
}
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({
messages: ['<string>'],
text: '<string>',
region: '<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>',
'region' => '<string>',
'lastSeenMessageId' => '<string>',
'waitForReply' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 \"region\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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://mcp.arlohealth.ai/api/consultations/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"region\": \"<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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"region\": \"<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",
"paymentUrl": "<string>",
"collects": [
"name"
],
"expiresAt": "<string>"
},
"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",
"paymentUrl": "<string>",
"collects": [
"name"
],
"expiresAt": "<string>"
},
"nextSteps": [
"<string>"
]
},
"userMessage": "<string>",
"agentInstructions": [
"<string>"
],
"note": "<string>",
"nextStep": "<string>",
"nextStepArgs": {}
}{
"error": "<string>",
"reason": "<string>",
"message": "<string>",
"field": "<string>",
"code": "<string>"
}{
"error": "<string>",
"needsAuth": true
}Consultations
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.
POST
/
api
/
consultations
/
{id}
/
messages
Send message in a consultation
curl --request POST \
--url https://mcp.arlohealth.ai/api/consultations/{id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
"<string>"
],
"text": "<string>",
"region": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": true
}
'import requests
url = "https://mcp.arlohealth.ai/api/consultations/{id}/messages"
payload = {
"messages": ["<string>"],
"text": "<string>",
"region": "<string>",
"lastSeenMessageId": "<string>",
"waitForReply": True
}
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({
messages: ['<string>'],
text: '<string>',
region: '<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>',
'region' => '<string>',
'lastSeenMessageId' => '<string>',
'waitForReply' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 \"region\": \"<string>\",\n \"lastSeenMessageId\": \"<string>\",\n \"waitForReply\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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://mcp.arlohealth.ai/api/consultations/{id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"region\": \"<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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n \"<string>\"\n ],\n \"text\": \"<string>\",\n \"region\": \"<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",
"paymentUrl": "<string>",
"collects": [
"name"
],
"expiresAt": "<string>"
},
"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",
"paymentUrl": "<string>",
"collects": [
"name"
],
"expiresAt": "<string>"
},
"nextSteps": [
"<string>"
]
},
"userMessage": "<string>",
"agentInstructions": [
"<string>"
],
"note": "<string>",
"nextStep": "<string>",
"nextStepArgs": {}
}{
"error": "<string>",
"reason": "<string>",
"message": "<string>",
"field": "<string>",
"code": "<string>"
}{
"error": "<string>",
"needsAuth": true
}Body
application/json
Single message text (alternative to messages array)
Response
Message sent
Was this page helpful?