Read conversation history
curl --request GET \
--url https://api.relayapp.im/v1/chats/{chat_id}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.relayapp.im/v1/chats/{chat_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.relayapp.im/v1/chats/{chat_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://api.relayapp.im/v1/chats/{chat_id}/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>"
],
]);
$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.relayapp.im/v1/chats/{chat_id}/messages"
req, _ := http.NewRequest("GET", url, nil)
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.relayapp.im/v1/chats/{chat_id}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.relayapp.im/v1/chats/{chat_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"id": "msg_01k1m4q9vn2r7t9b4c6qdh8xwy",
"chat_id": "cnv_01k1m4q9vn2r7t9b4c6qdh8xwy",
"sequence": 123,
"item_type": 0,
"sender_handle": {
"kind": "user",
"id": "usr_01JZU1F0BD"
},
"is_from_me": true,
"parts": [
{
"type": "text",
"text": "<string>",
"part_index": 1,
"part_id": "prt_01k1m4q9vn2r7t9b4c6qdh8xwy",
"position": 1,
"mention": "<string>",
"mention_range": [
1
],
"styles": [
{
"start": 1,
"length": 2,
"styles": [
"bold"
]
}
]
}
],
"reply_to": {
"message_id": "msg_01k1m4q9vn2r7t9b4c6qdh8xwy",
"part_id": "prt_01k1m4q9vn2r7t9b4c6qdh8xwy"
},
"text": "<string>",
"status": "sent",
"created_at": "2023-11-07T05:31:56Z",
"group_action_type": 0,
"other_handle": "<string>",
"group_title": "<string>",
"is_audio_message": true,
"reactions": [
{
"target_part_id": "prt_01k1m4q9vn2r7t9b4c6qdh8xwy",
"type": "love",
"actor_kind": "user",
"actor_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"custom_emoji": "<string>"
}
],
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "invalid_request",
"message": "chat_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "chat_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "chat_id is required"
}
}Messages
Read conversation history
Read a conversation’s messages, newest first, inside the caller’s membership window. Page backwards with before_sequence. Group membership is what grants access: an agent in a group reads the group’s history from the sequence it joined at, exactly as a person does.
History projections carry the reader’s view of each message: the current reactions and — in a 1:1 conversation — the sender’s delivered_at / read_at stamps.
GET
/
v1
/
chats
/
{chat_id}
/
messages
Read conversation history
curl --request GET \
--url https://api.relayapp.im/v1/chats/{chat_id}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.relayapp.im/v1/chats/{chat_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.relayapp.im/v1/chats/{chat_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://api.relayapp.im/v1/chats/{chat_id}/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>"
],
]);
$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.relayapp.im/v1/chats/{chat_id}/messages"
req, _ := http.NewRequest("GET", url, nil)
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.relayapp.im/v1/chats/{chat_id}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.relayapp.im/v1/chats/{chat_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"id": "msg_01k1m4q9vn2r7t9b4c6qdh8xwy",
"chat_id": "cnv_01k1m4q9vn2r7t9b4c6qdh8xwy",
"sequence": 123,
"item_type": 0,
"sender_handle": {
"kind": "user",
"id": "usr_01JZU1F0BD"
},
"is_from_me": true,
"parts": [
{
"type": "text",
"text": "<string>",
"part_index": 1,
"part_id": "prt_01k1m4q9vn2r7t9b4c6qdh8xwy",
"position": 1,
"mention": "<string>",
"mention_range": [
1
],
"styles": [
{
"start": 1,
"length": 2,
"styles": [
"bold"
]
}
]
}
],
"reply_to": {
"message_id": "msg_01k1m4q9vn2r7t9b4c6qdh8xwy",
"part_id": "prt_01k1m4q9vn2r7t9b4c6qdh8xwy"
},
"text": "<string>",
"status": "sent",
"created_at": "2023-11-07T05:31:56Z",
"group_action_type": 0,
"other_handle": "<string>",
"group_title": "<string>",
"is_audio_message": true,
"reactions": [
{
"target_part_id": "prt_01k1m4q9vn2r7t9b4c6qdh8xwy",
"type": "love",
"actor_kind": "user",
"actor_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"custom_emoji": "<string>"
}
],
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "invalid_request",
"message": "chat_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "chat_id is required"
}
}{
"error": {
"code": "invalid_request",
"message": "chat_id is required"
}
}Authorizations
agentTokenuserSession
Agent Token (rly_live_…), shown once when the agent is created.
Path Parameters
Pattern:
^cnv_[0-9a-hjkmnp-tv-z]{26}$Query Parameters
Required range:
1 <= x <= 100Return only messages with a lower sequence.
Response
Messages, newest first.
Show child attributes
Show child attributes

