Skip to main content
POST
/
v1
/
authentication
/
bot
/
login-code
curl -X POST https://portal-api.7331.org/v1/authentication/bot/login-code \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-bot-api-key" \
  -d '{
    "platform": "discord",
    "platform_user_id": "123456789012345678",
    "platform_username": "niels",
    "platform_avatar_url": "https://cdn.discordapp.com/avatars/123456789012345678/abc.png"
  }'
{
  "code": "ABCD1234"
}

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.

Fetches a pending login code that was initiated on the website. The bot picks up the code and DMs it to the user. This is the second step in the web-initiated login flow:
  1. User enters their platform ID on the website → POST /v1/authentication/request
  2. Bot calls this endpoint to fetch the pending code
  3. Bot DMs the code to the user
  4. User enters the code → POST /v1/authentication/verify
The bot’s /otp command automatically falls back to this endpoint when quick login returns 404 (user doesn’t exist yet).
X-API-Key
string
required
Bot API key.
platform
string
required
Platform identifier (e.g. discord, telegram).
platform_user_id
string
required
Platform-specific user ID to get the login code for.
platform_username
string
required
User’s current username on the platform.
platform_avatar_url
string
required
User’s current avatar URL on the platform.

Response

code
string
User’s login code if one exists. null if no pending code.
expires_at
string
ISO 8601 UTC timestamp for when the code expires. null if no pending code.
curl -X POST https://portal-api.7331.org/v1/authentication/bot/login-code \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-bot-api-key" \
  -d '{
    "platform": "discord",
    "platform_user_id": "123456789012345678",
    "platform_username": "niels",
    "platform_avatar_url": "https://cdn.discordapp.com/avatars/123456789012345678/abc.png"
  }'
{
  "code": "ABCD1234"
}