Get messages from a chat
List visible Messages and group-history events in a Chat.
The default order is oldest first. Pass order=desc to open on the
newest Messages and page toward older ones: each next_cursor
continues in the same direction it was minted for, so a cursor from a
desc list is only valid with order=desc.
curl --request GET \
--url https://api.staging.relayapp.im/v1/chats/{chatId}/messages \
--header 'Authorization: Bearer <token>'{
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_from_me": true,
"delivery_status": "sent",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_system_message": true,
"from": "<string>",
"from_handle": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"joined_at": "2023-11-07T05:31:56Z",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"subtitle": "<string>",
"verified": true,
"is_contact": true,
"status": "active",
"left_at": "2023-11-07T05:31:56Z",
"is_me": true,
"owner": {
"kind": "organization",
"name": "<string>",
"verified": true
},
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"activity_version": "<string>",
"activity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"emoji": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
},
"parts": [
{
"type": "text",
"value": "<string>",
"reactions": [
{
"is_me": true,
"handle": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"joined_at": "2023-11-07T05:31:56Z",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"subtitle": "<string>",
"verified": true,
"is_contact": true,
"status": "active",
"left_at": "2023-11-07T05:31:56Z",
"is_me": true,
"owner": {
"kind": "organization",
"name": "<string>",
"verified": true
},
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"activity_version": "<string>",
"activity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"emoji": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
},
"type": "love",
"custom_emoji": "<string>"
}
],
"mentions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"is_me": true,
"range": [
1
]
}
],
"mention": "<string>",
"mention_range": "<array>"
}
],
"reply_to": {
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"part_index": 1
},
"thread": {
"originator_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"originator_part_index": 1
},
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z",
"silent": true,
"deliveries": [
{
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"joined_at": "2023-11-07T05:31:56Z",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"subtitle": "<string>",
"verified": true,
"is_contact": true,
"status": "active",
"left_at": "2023-11-07T05:31:56Z",
"is_me": true,
"owner": {
"kind": "organization",
"name": "<string>",
"verified": true
},
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"activity_version": "<string>",
"activity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"emoji": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
},
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z"
}
],
"system_event": {
"type": "chat_created",
"actor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor."
},
"subject": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor."
},
"value": "<string>",
"icon_attachment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_card": {
"first_name": "<string>",
"last_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"is_active": true,
"is_verified": true,
"handle": "<string>",
"kind": "user",
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subtitle": "<string>",
"url": "<string>",
"description": "<string>",
"links": [
"<string>"
],
"about": "Builds robots in Ann Arbor."
},
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ringing",
"answered_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"from": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
}
},
"to": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
}
}
],
"duration_seconds": 1
}
}
}
],
"next_cursor": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}Authorizations
Bearer token authentication. Include your API token in the Authorization header.
Format: Authorization: Bearer <your-token>
Path Parameters
Unique identifier of the chat
Query Parameters
Pagination cursor from previous next_cursor response
Maximum number of messages to return
1 <= x <= 100Sort order for messages (asc = oldest first, desc = newest first). A cursor is only valid with the order it was returned for.
asc, desc Return one thread only, in time order, with no group-history events. The result is the Message that opened the thread plus every Message whose thread.originator_message_id is that Message, so a reply to a reply is included. Answers 404 when the Message is not in this Chat or the caller cannot see it. A cursor from a thread list is only valid with the same thread.
curl --request GET \
--url https://api.staging.relayapp.im/v1/chats/{chatId}/messages \
--header 'Authorization: Bearer <token>'{
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_from_me": true,
"delivery_status": "sent",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_system_message": true,
"from": "<string>",
"from_handle": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"joined_at": "2023-11-07T05:31:56Z",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"subtitle": "<string>",
"verified": true,
"is_contact": true,
"status": "active",
"left_at": "2023-11-07T05:31:56Z",
"is_me": true,
"owner": {
"kind": "organization",
"name": "<string>",
"verified": true
},
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"activity_version": "<string>",
"activity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"emoji": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
},
"parts": [
{
"type": "text",
"value": "<string>",
"reactions": [
{
"is_me": true,
"handle": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"joined_at": "2023-11-07T05:31:56Z",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"subtitle": "<string>",
"verified": true,
"is_contact": true,
"status": "active",
"left_at": "2023-11-07T05:31:56Z",
"is_me": true,
"owner": {
"kind": "organization",
"name": "<string>",
"verified": true
},
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"activity_version": "<string>",
"activity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"emoji": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
},
"type": "love",
"custom_emoji": "<string>"
}
],
"mentions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"is_me": true,
"range": [
1
]
}
],
"mention": "<string>",
"mention_range": "<array>"
}
],
"reply_to": {
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"part_index": 1
},
"thread": {
"originator_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"originator_part_index": 1
},
"sent_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z",
"silent": true,
"deliveries": [
{
"contact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"joined_at": "2023-11-07T05:31:56Z",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"subtitle": "<string>",
"verified": true,
"is_contact": true,
"status": "active",
"left_at": "2023-11-07T05:31:56Z",
"is_me": true,
"owner": {
"kind": "organization",
"name": "<string>",
"verified": true
},
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"activity_version": "<string>",
"activity": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"emoji": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
},
"delivered_at": "2023-11-07T05:31:56Z",
"read_at": "2023-11-07T05:31:56Z"
}
],
"system_event": {
"type": "chat_created",
"actor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"display_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor."
},
"subject": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor."
},
"value": "<string>",
"icon_attachment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_card": {
"first_name": "<string>",
"last_name": "<string>",
"image_url": "<string>",
"image_color": "<string>",
"is_active": true,
"is_verified": true,
"handle": "<string>",
"kind": "user",
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subtitle": "<string>",
"url": "<string>",
"description": "<string>",
"links": [
"<string>"
],
"about": "Builds robots in Ann Arbor."
},
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ringing",
"answered_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"from": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
}
},
"to": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"handle": "<string>",
"kind": "user",
"timezone": "America/Detroit",
"age_range": "18_plus",
"links": [
"https://github.com/ana",
"https://www.instagram.com/ana"
],
"about": "Builds robots in Ann Arbor.",
"rive": {
"file": "https://cdn.relayapp.im/rive/0199a000-0000-7000-8000-00000000000b/1790000000000/file-0123456789abcdef.riv",
"artboard": "Call",
"state_machine": "Main",
"view_model": "Main"
}
}
],
"duration_seconds": 1
}
}
}
],
"next_cursor": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}
