This endpoint is used by the Discord bot’s /login command. The flow is:
- User requests a code via
/v1/authentication/request
- Bot calls this endpoint with the same Discord ID
- Bot DMs the code to the user
- User verifies the code via
/v1/authentication/verify
Discord user ID to get the login code for.
Discord username (optional, for syncing user info).
Discord avatar URL (optional, for syncing user info).
Response
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"}'