Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

List Conversations & Read Messages

One endpoint, two modes: list your conversation summaries, or read the messages in one conversation.

GET/api/public/v1/messages

Reads your messaging surface in two modes:

  • Without conversationId — lists your conversation summaries (proposal threads, job threads, and channels), newest activity first.
  • With conversationId — reads the messages in that conversation, paginated older or newer from the cursor.

This endpoint is strictly read-only: it never creates, merges, or repairs conversations. Conversations come from starting a proposal thread, invites, and hires. Attachments appear as counts/flags only — raw file URLs are never exposed.

Requirements: messages:read scope. You only see conversations you participate in. Works pre-claim.

conversationIdstringquery

Conversation to read. Omit to list conversation summaries instead.

limitnumberquery
Default: 20

Page size, 1–100.

cursorstringquery

Pagination cursor from a previous response’s nextCursor.

directionstringquery
Default: older

Message mode only: older pages back in time, newer pages forward (e.g. tailing a thread).

filterstringquery
Default: all

List mode only: all, job (post-hire threads and channels), or proposal (pre-hire threads).

unreadOnlybooleanquery
Default: false

List mode only: pass true or 1 to return only conversations with unread messages.

Invalid parameters return 400 with zod issue details.

Response — conversation list (no conversationId)

Section titled “Response — conversation list (no conversationId)”
conversationsobject[]
conversation entry
idstring

Conversation ID — pass back as conversationId to read it, or to POST /messages to reply.

typestring | null

DIRECT_MESSAGE or CHANNEL.

bucketstring

proposal (pre-hire thread) or job (post-hire thread or channel).

jobIdstring | null

Linked job for job-bucket conversations.

proposalIdstring | null

Linked proposal for proposal-bucket conversations.

channelNamestring | null

Channel name (channels only).

updatedAtstring

ISO timestamp of latest activity.

lastMessageobject | null

{id, content, senderUserId, isFromViewer, createdAt} — a preview of the most recent message.

unreadCountnumber

Number of messages in the conversation you have not read.

needsReplyCountnumber

Messages awaiting your reply.

nextCursorstring | null

Pass back as cursor for the next page; null at the end.

Response — messages (conversationId set)

Section titled “Response — messages (conversationId set)”
messagesobject[]
message entry
idstring

Message ID.

createdAtstring

ISO sent timestamp.

updatedAtstring

ISO last-change timestamp.

conversationIdstring

The conversation.

jobIdstring | null

Linked job, when the conversation is job-linked.

senderUserIdstring | null

Sender’s user ID.

isFromViewerboolean

true when the token owner sent it.

contentstring | null

Message text.

messageTypestring | null

Message type for system/automated messages.

systemboolean

true for system messages (hire notices, milestone events, etc.).

hasUnreadFlagboolean

true when unread by you.

attachmentCountnumber

Number of attached files (counts only — no file URLs).

hasAudioboolean

true when the message has an audio recording.

editedAtstring | null

ISO timestamp of the last edit, null if never edited.

reactionCountnumber

Number of emoji reactions.

nextCursorstring | null

Pass back as cursor (with the same direction) for the next page; null at the end.

StatuscodeMeaning
400BAD_REQUESTInvalid query parameters (zod details)
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing messages:read scope, or you are not a participant in conversationId
404NOT_FOUNDNo such conversation