Skip to main content
POST
/
v1
/
authentication
/
bot
/
login-code
curl -X POST https://hapi.7331.org/v1/authentication/bot/login-code \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-bot-api-key" \
  -d '{"discord_id": 123456789012345678, "username": "exampleuser"}'
{
  "code": "ABCD1234"
}
This endpoint is used by the Discord bot’s /login command. The flow is:
  1. User requests a code via /v1/authentication/request
  2. Bot calls this endpoint with the same Discord ID
  3. Bot DMs the code to the user
  4. User verifies the code via /v1/authentication/verify
X-API-Key
string
required
Bot API key.
discord_id
integer
required
Discord user ID to get the login code for.
username
string
Discord username (optional, for syncing user info).
avatar_url
string
Discord avatar URL (optional, for syncing user info).

Response

code
string
User’s login code if one exists. null if no pending code.
curl -X POST https://hapi.7331.org/v1/authentication/bot/login-code \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-bot-api-key" \
  -d '{"discord_id": 123456789012345678, "username": "exampleuser"}'
{
  "code": "ABCD1234"
}