Skip to main content
GET
/
v1
/
portal
/
chats
/
{chat_id}
/
history
curl https://portal-api.7331.org/v1/portal/chats/42/history \
  -b "psession=YOUR_SESSION"
[
  {
    "chat_id": 42,
    "chat_name": "movie-night",
    "id": "1710000000000-0",
    "sender": { "id": 7, "username": "exampleuser", "avatar_url": "https://cdn.example.com/users/7/avatar.png" },
    "permission_level": 0,
    "content": "BASE64_CIPHERTEXT",
    "type": "user",
    "epoch": "a1b2c3d4e5f60001",
    "timestamp": "2026-03-10T12:00:00Z"
  },
  {
    "chat_id": 42,
    "chat_name": "movie-night",
    "id": "1710000000001-0",
    "sender": null,
    "permission_level": null,
    "content": "exampleuser joined the chat",
    "type": "system",
    "epoch": "0000000000000000",
    "timestamp": "2026-03-10T11:59:00Z"
  }
]

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.

Requires an active session cookie. The caller must have access to the chat (public chats are open; private chats require membership, ownership, or ADMIN+).
chat_id
integer
required
Chat ID.

Response

Returns an array of message objects from the chat’s portal stream.
chat_id
integer
required
Chat the message belongs to.
chat_name
string
required
Chat display name at time of retrieval.
id
string
required
Message ID (Redis stream ID).
sender
object | null
required
Sender identity. null for system messages (type="system").
content
string
required
Message ciphertext (clients decrypt using the epoch key).
type
string
required
Message type: "user" or "system".
permission_level
integer | null
required
Sender permission level frozen at send time. null for system messages.
epoch
string
required
Encryption epoch — 8-byte hex string. Identifies which chat key to use for decryption.
timestamp
string
required
When the message was sent (ISO 8601).
curl https://portal-api.7331.org/v1/portal/chats/42/history \
  -b "psession=YOUR_SESSION"
[
  {
    "chat_id": 42,
    "chat_name": "movie-night",
    "id": "1710000000000-0",
    "sender": { "id": 7, "username": "exampleuser", "avatar_url": "https://cdn.example.com/users/7/avatar.png" },
    "permission_level": 0,
    "content": "BASE64_CIPHERTEXT",
    "type": "user",
    "epoch": "a1b2c3d4e5f60001",
    "timestamp": "2026-03-10T12:00:00Z"
  },
  {
    "chat_id": 42,
    "chat_name": "movie-night",
    "id": "1710000000001-0",
    "sender": null,
    "permission_level": null,
    "content": "exampleuser joined the chat",
    "type": "system",
    "epoch": "0000000000000000",
    "timestamp": "2026-03-10T11:59:00Z"
  }
]