Skip to main content
POST
/
v1
/
portal
/
chats
/
{chat_id}
/
invites
curl -X POST https://portal-api.7331.org/v1/portal/chats/42/invites \
  -H "Content-Type: application/json" \
  -b "psession=YOUR_SESSION" \
  -d '{"max_uses": 10, "expires_at": "2026-05-01T00:00:00Z"}'
{
  "code": "abc123def456ghi7",
  "chat_id": 42,
  "created_by_id": 1,
  "created_at": "2026-03-16T12:00:00Z",
  "expires_at": "2026-05-01T00:00:00Z",
  "uses": 0,
  "max_uses": 10
}

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. Access is controlled by can_manage_room() hierarchy:
  • Private chats: owner only.
  • Public / Official chats: chat owner, or any user whose permission level lets them act on the chat owner (e.g. Mods can manage User-owned chats, Admins can manage Mod/User-owned chats, Owners can manage any chat).
Returns 409 Conflict if the per-chat invite quota (20 active invites) is already reached.
chat_id
integer
required
Chat ID.
expires_at
string
ISO 8601 expiry timestamp. null for no expiry.
max_uses
integer
Maximum number of times the invite can be used. null for unlimited. Must be at least 1.

Response

code
string
required
The generated invite code.
chat_id
integer
required
Chat the invite belongs to.
created_by_id
integer
User ID who created the invite. null if that user has since been deleted.
created_at
string
required
ISO 8601 creation timestamp.
expires_at
string
ISO 8601 expiry timestamp, or null if the invite never expires.
uses
integer
required
Current use count (starts at 0).
max_uses
integer
Max uses, or null for unlimited.
curl -X POST https://portal-api.7331.org/v1/portal/chats/42/invites \
  -H "Content-Type: application/json" \
  -b "psession=YOUR_SESSION" \
  -d '{"max_uses": 10, "expires_at": "2026-05-01T00:00:00Z"}'
{
  "code": "abc123def456ghi7",
  "chat_id": 42,
  "created_by_id": 1,
  "created_at": "2026-03-16T12:00:00Z",
  "expires_at": "2026-05-01T00:00:00Z",
  "uses": 0,
  "max_uses": 10
}