Skip to main content
Every endpoint requires a NodeLoc session. Use Content-Type: application/json when sending a JSON body.

Find a conversation

Call GET /api/v1/chat for the overview. It returns directs (direct messages), channels, groups (group chats you belong to), directs_next, and unread_count. Each list item’s numeric id is a conversation ID. In a direct entry, with is the other person’s username. In a channel entry, joined shows whether you are a member.

Page through direct conversations

Call GET /api/v1/messages?limit=30 for the direct conversation list. The response has conversations, next, and a direct-message unread_count. The list is ordered by most recent message. The default limit is 30 and the range is 1–100. To fetch the next page, pass both values from next, before (an RFC 3339 time) and before_id (a conversation ID). URL-encode the time in the query string. For example, {"before":"2026-11-29T08:30:00Z","before_id":17} becomes ?before=2026-11-29T08%3A30%3A00Z&before_id=17. You can also begin paging from the overview’s directs_next. The overview can include older unread conversations, so merge pages by id. Stop when next is null. A full page can be followed by an empty page.

Read and paginate messages

This example uses GET /api/v1/messages/alex?limit=1&read=0 to read the latest direct message. Channels and group chats use the same parameters and response shape, for example GET /api/v1/chat/channels/28/messages?read=0.
Opening a direct chat with someone for the first time returns {"messages":[]}. Sending the first message creates the conversation. Message pages include conversation_id once the conversation exists. On the latest page, participants and joined members also get last_read_id and unread_count as they stood before the request. A deleted message remains in the list with deleted: true and empty html. A system message has an event. A quoted message is summarized in reply.

Send or quote a message

Use POST /api/v1/messages/{username} for a direct message, or POST /api/v1/chat/channels/{id}/messages for a channel or group chat. Send the Markdown source as raw. To quote a message, set reply_to to the ID of a visible, undeleted ordinary message in the same conversation.
Success returns HTTP 201 with a message object in the same shape as a message in the read response.
The body must have content. Direct messages allow up to 10,000 characters. Channel and group messages allow up to 4,000. Direct messaging depends on account permissions and the recipient’s message settings. Any signed-in user can read a public channel. Sending requires membership and permission to post. Group chat reads and writes are limited to members.

Read positions, muting, and membership

By default, fetching the latest page or polling with after advances the current user’s read position. To fetch without advancing it, send read=0. After the user sees the message, use PUT /api/v1/chat/conversations/{id}/read with {"message_id":102}. Success returns 204. Loading older messages with before leaves the position unchanged.

Common errors