curl --request POST \
--url https://api.example.com/v1/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "<string>",
"sender_id": "<string>",
"content": "<string>",
"reply_to_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/messages"
payload = {
"conversation_id": "<string>",
"sender_id": "<string>",
"content": "<string>",
"reply_to_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
sender_id: '<string>',
content: '<string>',
reply_to_id: '<string>'
})
};
fetch('https://api.example.com/v1/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.example.com/v1/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([
'conversation_id' => '<string>',
'sender_id' => '<string>',
'content' => '<string>',
'reply_to_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.example.com/v1/messages"
payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"content\": \"<string>\",\n \"reply_to_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.example.com/v1/messages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"content\": \"<string>\",\n \"reply_to_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"content\": \"<string>\",\n \"reply_to_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"conversation_id": "<string>",
"sender_id": "<string>",
"content": "<string>",
"message_type": "<string>",
"visibility": "<string>",
"reply_to_id": "<string>",
"created_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Create Message
Send an in-app message into a conversation.
sender_id must be an accepted member of your org and an active participant
of the target conversation (404 otherwise) — the API can’t impersonate a family
member or post into a thread it isn’t part of. The message is sent as plain text,
visible to everyone in the thread, and the normal bell/email notifications fire.
Honours Idempotency-Key.
curl --request POST \
--url https://api.example.com/v1/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "<string>",
"sender_id": "<string>",
"content": "<string>",
"reply_to_id": "<string>"
}
'import requests
url = "https://api.example.com/v1/messages"
payload = {
"conversation_id": "<string>",
"sender_id": "<string>",
"content": "<string>",
"reply_to_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: '<string>',
sender_id: '<string>',
content: '<string>',
reply_to_id: '<string>'
})
};
fetch('https://api.example.com/v1/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.example.com/v1/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([
'conversation_id' => '<string>',
'sender_id' => '<string>',
'content' => '<string>',
'reply_to_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.example.com/v1/messages"
payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"content\": \"<string>\",\n \"reply_to_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.example.com/v1/messages")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"content\": \"<string>\",\n \"reply_to_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"<string>\",\n \"sender_id\": \"<string>\",\n \"content\": \"<string>\",\n \"reply_to_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"conversation_id": "<string>",
"sender_id": "<string>",
"content": "<string>",
"message_type": "<string>",
"visibility": "<string>",
"reply_to_id": "<string>",
"created_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Authorizations
Org API key as Token token=ei_live_...
Headers
Body
POST /v1/messages → send an in-app message into a conversation. sender_id
must be an accepted org member who is an active participant of the conversation.
The message is always inserted as message_type='text', visibility='everyone'
(so the existing notify/email/mirror triggers fire normally); system/private
message types are not settable via the API.
Response
Successful Response
One message in a thread. Only visibility='everyone' (non-deleted) messages
are exposed by the read endpoints — family-private (student_only/parent_only)
messages are never returned.
Was this page helpful?