Returning.AIDevelopers
v1

API reference / Messaging

.md

Get messages

Get the newest messages in your community, optionally from one channel or one trader, as plain text with the sender and channel.

Last updated 26 Sep 2026API v1

Method
GET
Path
https://api.returning.ai/v1/messages
Permission
getMessages
Retries
Read-only; exact retries are safe

When to use this

  • You watch a channel from your own system and want the latest messages.
  • You want to see what one trader has posted recently.
  • You need a message ID so you can reply to it or react to it.

Authentication#

Header
Authorization: Bearer <API_KEY>
Permission
getMessagesShown in the dashboard as “Get Messages”

Use a Community API key with getMessages, and keep it on your server. The key decides the community, so you only read that community's messages and never send a community ID.

Behaviour#

Messages come newest first. Without channel_id you get the newest messages from every channel in your community. Direct messages aren't included.

data.messages.message is plain text: formatting is removed and mentions read @Display Name. A message with a file reads Attached File, and a GIF reads GIF Message. There is no cursor or page parameter, so to catch up after a gap, read with a higher count and skip IDs you have already seen.

Request#

Query parameters#

channel_id#stringOPTIONAL
Only messages from this channel, from List integration channels. Omit it for messages from every channel.

RuleChannel ID in your community

Eg"66f000000000000000000a11"

count#integerOPTIONAL
How many of the newest messages to return.

Rule1-100, default 50

Eg20

user_id#stringOPTIONAL
Only messages posted by this trader, by platform user ID. Send this or email, not both.

Eg"3247779"

email#stringOPTIONAL
Only messages posted by the trader with this email. Send this or user_id, not both.

Eg"trader@example.com"

Headers#

Authorization#stringREQUIRED
Community API key with getMessages.

RuleBearer <API_KEY>

curl --request GET \
  --url 'https://api.returning.ai/v1/messages?channel_id=66f000000000000000000a11&count=20' \
  --header 'Authorization: Bearer <API_KEY>'

Response#

A 200 returns up to count messages in data.messages. data.total counts the messages in this response only. A channel with no messages returns an empty list.

status#stringALWAYS
Result of the request.

Rulesuccess

message#stringALWAYS
Human-readable summary. Do not branch on it.

Eg"messages fetched successfully"

data#objectALWAYS
The messages.

Eg{ ... }

total#integerALWAYS
Number of messages in this response, not the total in the channel.

Eg1

messages#object[]ALWAYS
Up to count messages, newest first.

Eg[ ... ]

id#stringALWAYS
The message ID. Use it as messageId to reply or react.

Eg"66f000000000000000000a21"

message#stringALWAYS
The message as plain text. Attachments read Attached File and GIFs read GIF Message.

Eg"Is the gold webinar still on for Friday?"

user#objectALWAYS
Who posted the message.

Eg{"user_id": "3247779", "email": "trader@example.com"}

user_id#stringALWAYS
The sender's platform user ID, as a string.

Eg"3247779"

email#stringALWAYS
The sender's email.

Eg"trader@example.com"

channel#objectALWAYS
Where the message was posted.

Eg{"channel_id": "66f000000000000000000a11", "name": "general"}

channel_id#stringALWAYS
The channel ID.

Eg"66f000000000000000000a11"

name#stringALWAYS
The channel's name.

Eg"general"

timestamp#stringALWAYS
When the message was posted.

Eg"2026-09-26T08:30:00.000Z"

{
  "status": "success",
  "message": "messages fetched successfully",
  "data": {
    "total": 1,
    "messages": [
      {
        "id": "66f000000000000000000a21",
        "message": "Is the gold webinar still on for Friday?",
        "user": {
          "user_id": "3247779",
          "email": "trader@example.com"
        },
        "channel": {
          "channel_id": "66f000000000000000000a11",
          "name": "general"
        },
        "timestamp": "2026-09-26T08:30:00.000Z"
      }
    ]
  }
}

Errors#

Validation errors put the reason in detail, and detail.fields names the bad parameter. Other errors carry only message, or message and detail. None has a machine-readable code, so branch on the HTTP status.

Fix the request03

400Fix the request
A query value is invalid: count outside 1-100 or not a whole number, a malformed channel_id, both user_id and email, or a parameter this endpoint doesn't accept. detail.fields names it. A detail of Channel not found means channel_id isn't a channel in your community. Any other detail text is an unexpected failure; retry it once with backoff.
401Fix the request
The key is missing (Invalid token), unknown (Invalid API key) or expired, or it lacks getMessages (Your api key does not have permission to access this action). Personal user API keys can't read messages. Add the permission in Settings > Integration > API Keys.
403Fix the request
The trader in user_id or email can't see the channel in channel_id. Drop one of the two filters, or pick a channel the trader can see.

Fix the data01

404Fix the data
user_id or email doesn't match a member of your community. Check the value with Get User Data.

Retry with backoff01

500Retry with backoff
The key could not be checked (Authentication failed). Retry with backoff.
{
  "meta": {
    "status": "error",
    "statusCode": 400
  },
  "message": "Get Messages Query Validation validation error.",
  "detail": {
    "message": "Invalid request query",
    "fields": ["count"]
  },
  "solution": "Check your query in request and try again"
}

Next step#

Reply messagePOST/v1/messages/replyAnswer a message you just read, using its id as messageId.