Skip to main content
POST
/
v1
/
portal
/
chats
/
{chat_id}
/
messages
curl -X POST https://portal-api.7331.org/v1/portal/chats/42/messages \
  -H "Content-Type: application/json" \
  -b "psession=YOUR_SESSION" \
  -d '{"content": "{\"v\":2,\"epoch\":3,\"ct\":\"base64encodedciphertext...\"}"}'
{
  "id": "1709123456789-0"
}

Documentation Index

Fetch the complete documentation index at: https://docs.7331.org/llms.txt

Use this file to discover all available pages before exploring further.

Send a CiphertextV2-encrypted message to a chat’s chat stream. The server validates the outer structure but never sees plaintext — content is end-to-end encrypted between clients. The sender must have joined the chat (via room:join Socket.IO event), must not be muted, and must not be banned from the chat. Private chats require ownership or membership.
chat_id
integer
required
Chat ID.
content
string
required
CiphertextV2 JSON string. Must be a valid {"v": 2, "epoch": N, "ct": "base64..."} bundle. Max 4096 characters.

Response

id
string
required
Redis stream message ID (e.g. "1234567890123-0"). Use this for deletion.

Errors

StatusCondition
403You are banned from this chat.
403You are muted in this chat. Response includes ttl (seconds remaining, 0 = indefinite).
403epoch in the ciphertext does not match the current chat epoch. The chat key has rotated — wait for a member to distribute the new key to you.
403You have not received the chat key for the current epoch. Another chat member must distribute it before you can send messages.
422content is not a valid CiphertextV2 bundle.
429Per-chat or global message rate limit exceeded.
curl -X POST https://portal-api.7331.org/v1/portal/chats/42/messages \
  -H "Content-Type: application/json" \
  -b "psession=YOUR_SESSION" \
  -d '{"content": "{\"v\":2,\"epoch\":3,\"ct\":\"base64encodedciphertext...\"}"}'
{
  "id": "1709123456789-0"
}
Clients receive new messages via the message:new Socket.IO event, not in the HTTP response. The id in the response matches the id field in the broadcast payload.