Skip to main content
POST
/
v1
/
portal
/
keys
curl -X POST https://portal-api.7331.org/v1/portal/keys \
  -H "Content-Type: application/json" \
  -b "psession=YOUR_SESSION" \
  -d '{"public_key": "BASE64_ENCODED_32_BYTE_X25519_KEY"}'
{
  "status": "registered"
}

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.

Stores the caller’s X25519 public key in Redis, keyed by their session ID. After registration, the WS process broadcasts a portal:key_added event to all chats the user is currently joined in so other members can encrypt chat keys for them. Authorization: Any authenticated user (session cookie required).
public_key
string
required
Base64-encoded X25519 public key. Must decode to exactly 32 bytes.

Response

status
string
required
"registered" when a new or replaced key was stored. "unchanged" when the submitted key was identical to the one already on record for this session.
curl -X POST https://portal-api.7331.org/v1/portal/keys \
  -H "Content-Type: application/json" \
  -b "psession=YOUR_SESSION" \
  -d '{"public_key": "BASE64_ENCODED_32_BYTE_X25519_KEY"}'
{
  "status": "registered"
}
The public key is tied to the current session. It is automatically removed when the session expires or the user logs out. Re-registering with the same key returns "unchanged" and is a no-op; re-registering with a new key overwrites the previous one and re-triggers portal:key_added.