These routes serve the chat views. Every route here is on the people socket and acts as the calling person. On gomoe.dev that is the account of the signed-in session. On a server in Tailscale mode it is the person the Tailscale login names. HTTP API conventions says how each mode knows a person.
| Method |
Path |
What it does |
POST |
/v1/conversations |
Creates a DM or a room. The body names kind as dm, room or chat. A DM names its agent. A room names its name, and may list people, agents and a projectId. A chat lists who it is with, 1 to 20 strings, each a person’s login or an agent’s name, and needs its first text. One agent alone opens the DM with it, and anything else makes a room named for its members. A login that is not on the team answers 404. A chat sent again with the same clientId answers the room the first one made. Each may carry a first post with text, attachmentIds and clientId. Answers conversationId. |
POST |
/v1/conversations/<id>/messages |
Posts a message as the person. The body holds text, attachmentIds, clientId and replyToMessageId, and needs text, attachments or both. |
POST |
/v1/conversations/<id>/members |
Adds a teammate to a room by login, or one of the team’s agents by agentId. An admin or someone in the room may add. Answers personId or agentId. |
PATCH |
/v1/messages/<id> |
Edits the text of a message. |
DELETE |
/v1/messages/<id> |
Deletes a message and removes the files it carried. |
PUT |
/v1/conversations/<id>/pins/<message id> |
Pins a message in a conversation. |
DELETE |
/v1/conversations/<id>/pins/<message id> |
Unpins a message. |
| Method |
Path |
What it does |
PUT |
/v1/messages/<id>/reactions/<emoji> |
Adds the person’s reaction to a message. The emoji in the path is URL-encoded and is one emoji of at most 32 bytes. |
DELETE |
/v1/messages/<id>/reactions/<emoji> |
Removes the person’s reaction from a message. |
PUT |
/v1/events/<number>/reactions/<emoji> |
Adds the person’s reaction to an event in a session’s record. |
DELETE |
/v1/events/<number>/reactions/<emoji> |
Removes the person’s reaction from an event. |
| Method |
Path |
What it does |
POST |
/v1/attachments |
Uploads a file before it has a place. A new task, run or group chat claims it when it is made. Answers 201 with attachmentId, name, mediaType, size, kind and, for a picture, width and height. |
POST |
/v1/conversations/<id>/attachments |
Uploads a file for a conversation the person may post in. Answers 201 with attachmentId, name, mediaType, size, kind and, for a picture, width and height. |
POST |
/v1/sessions/<id>/attachments |
Uploads a file for the session of a task the person may see. Answers 201 with attachmentId, name, mediaType, size, kind and, for a picture, width and height. |
GET |
/v1/attachments/<id> |
Serves a file. An image shows inline and every other file downloads. ?download=1 forces a download. The route honors If-None-Match. |
| Method |
Path |
What it does |
POST |
/v1/transcribe |
Turns a recording into text. The body is the audio, under an audio content type. Answers {"text": "..."}. |
An upload sends the file’s bytes as the body, the URL-encoded name in the X-File-Name header, and the file’s type in Content-Type. A file is at most 25 MiB, and a larger one answers 413. Uploading does not send the file. A post carries it.
POST /v1/transcribe takes WAV, sent as audio/wav, audio/x-wav or audio/wave, and audio/webm, and answers 415 for any other type. It answers 413 for a recording over 10 MiB or longer than 60 seconds. It answers 503 when AGENTS_ASSEMBLYAI_KEY is not set. The recording is held in memory for the request, and Agents keeps only the text.
Calls run on LiveKit. When the server has no LiveKit, start, join, leave and end answer 503 with words a person reads, once the person is one who may do them, so anyone else gets the same 404 as ever. Listing and reading read the record, and LiveKit’s webhook answers 401, since no event is signed for such a server. A person may start, list, read and join only the calls of chats they may post in, so a DM between two people’s call is the two’s, admins included.
| Method |
Path |
What it does |
GET |
/v1/conversations/<id>/calls |
The chat’s call for its page: canCall, whether the person may call there, and call, the one live in it or null. A person who may read the chat but not post in it gets canCall: false and no call. |
POST |
/v1/conversations/<id>/calls |
Starts the chat’s call, answering 201 with call and started: true, or 200 with the call going on there and started: false. |
GET |
/v1/calls |
Lists the calls the person may see, newest first, at most 50. ?conversation=<id> keeps one chat’s, and ?live=true the ones going on now. |
GET |
/v1/calls/ringing |
The calls ringing the person: started in the last 45 seconds, by someone else, in a chat they are a member of and may post in, that they have not joined. A call that starts also rings each such person’s phone once, when their phone notices are on. |
GET |
/v1/calls/<id> |
Reads one call: its chat, who started it, when it started and ended, and each person’s stretches in it. |
GET |
/v1/calls/<id>/transcript |
Reads the call and its transcript, lines, each a message said in it with its speaker, a person or an agent, at, when the chat stored it, and its text, in the chat’s order. Only the call’s own chat’s messages are lines. |
POST |
/v1/calls/<id>/join |
Answers with member, the person’s stretch in the call, and url, token, identity and expiresAt. The token is for this call’s room alone, as person:<id>, for 10 minutes, and may send the microphone, camera and screen with its sound, and no data. Each join opens a new stretch and closes the person’s open one. An ended call answers 410. |
POST |
/v1/calls/<id>/leave |
Takes {"member": "<stretch>"}, the member join answered with, closes that stretch and takes the person out of the call, unless they have joined again since. The call ends when no one is left in it. A stretch that is not the person’s answers 404. |
POST |
/v1/calls/<id>/give-back |
Takes {"member": "<stretch>"}, the member join answered with. Closes that stretch when the page never reached the call, unless LiveKit has the person in the room, as another window of theirs. A newer join’s stretch is never given back. |
POST |
/v1/calls/<id>/end |
Ends the call for everyone. Only its starter or a team admin may, and anyone else gets 403. |
POST |
/v1/calls/events |
LiveKit’s webhook. It answers before sign-in, takes at most 64 KB, and answers 401 unless LiveKit’s signed token in Authorization covers the body. |