API Reference
The Loqa API is Discord-compatible by design. If you've built with the Discord API, you'll feel right at home.
Base URL: https://api.loqa.chat
Authentication
Register accounts, log in, and generate bot tokens. All auth endpoints return a JWT + user object.
Base: /api/auth
/register Create a new user account /login Log in with email and password /bot Generate a long-lived bot token (365 days) Users
Manage user profiles, settings, DMs, presence, encryption keys, and guild membership.
Base: /api/users
/me Get your own profile 🔒 /me Update your profile (display name, avatar, bio, banner) 🔒 /:user_id Get another user's public profile /me/channels List all DM and Group DM channels 🔒 /me/channels Create a Group DM 🔒 /:user_id/dm Create or get a DM channel with a user 🔒 /me/settings Get user settings 🔒 /me/settings Update user settings 🔒 /me/guilds List servers you are a member of 🔒 /me/guilds/:guild_id Leave a server 🔒 /me/presence Update presence status and broadcast 🔒 /me/keys Upload E2EE public key 🔒 Servers
Full server lifecycle — create, edit, delete, manage channels, members, roles, bans, emojis, events, audit logs, and more.
Base: /api/servers
/ Create a new server 🔒 /:server_id Get server details /:server_id Edit server (name, icon, banner, description, etc.) 🔒 /:server_id Delete a server (owner only) 🔒 /:server_id/channels Create a channel in a server 🔒 /:server_id/channels List all channels in a server /:server_id/members List all members /:server_id/members/:user_id Kick a member 🔒 /:server_id/members/:user_id Edit a member (nickname, roles, timeout) 🔒 /:server_id/leave Leave a server 🔒 /:server_id/invites Create an invite link 🔒 /:server_id/invites List all invites 🔒 /join/:invite_code Join a server via invite 🔒 /:server_id/bans List all bans 🔒 /:server_id/bans/:user_id Ban a member 🔒 /:server_id/bans/:user_id Unban a user 🔒 /:server_id/roles List all roles /:server_id/roles Create a role 🔒 /:server_id/roles/:role_id Edit a role 🔒 /:server_id/roles/:role_id Delete a role 🔒 /:server_id/emojis List custom emojis /:server_id/emojis Upload a custom emoji 🔒 /:server_id/emojis/:emoji_id Delete a custom emoji 🔒 /:server_id/emojis/import Bulk import emoji pack 🔒 /:server_id/audit-logs Get audit log entries 🔒 /:server_id/scheduled-events List scheduled events /:server_id/scheduled-events Create a scheduled event 🔒 /:server_id/scheduled-events/:event_id Edit a scheduled event 🔒 /:server_id/scheduled-events/:event_id Delete a scheduled event 🔒 /:server_id/auto-moderation/rules List AutoMod rules 🔒 /:server_id/auto-moderation/rules Create an AutoMod rule 🔒 /:server_id/auto-moderation/rules/:rule_id Edit an AutoMod rule 🔒 /:server_id/auto-moderation/rules/:rule_id Delete an AutoMod rule 🔒 /:server_id/voice-states Get all voice states for a server /:server_id/welcome-screen Get welcome screen config /:server_id/welcome-screen Update welcome screen 🔒 /:server_id/verification-gate Get verification gate config /:server_id/verification-gate Update verification gate 🔒 /:server_id/onboarding Get onboarding config /:server_id/onboarding Update onboarding 🔒 /:server_id/soundboard-sounds List soundboard sounds /:server_id/soundboard-sounds Upload a soundboard sound 🔒 /:server_id/soundboard-sounds/:sound_id Delete a soundboard sound 🔒 /:server_id/templates Get server template /:server_id/templates Create template from server 🔒 Channels
Channel operations — messages, reactions, threads, pins, invites, webhooks, voice, file uploads, polls, forum posts, and search.
Base: /api/channels
/:channel_id Get channel details /:channel_id Edit channel (name, topic, NSFW, slowmode, etc.) 🔒 /:channel_id Delete a channel 🔒 /:channel_id/messages Get messages (supports before, after, limit) /:channel_id/messages Send a message 🔒 /:channel_id/messages/:message_id Edit a message 🔒 /:channel_id/messages/:message_id Delete a message 🔒 /:channel_id/messages/bulk-delete Bulk delete messages (up to 100) 🔒 /:channel_id/messages/:message_id/reactions/:emoji Add a reaction 🔒 /:channel_id/messages/:message_id/reactions/:emoji Remove a reaction 🔒 /:channel_id/threads Create a thread 🔒 /:channel_id/thread-members/:user_id Add a thread member 🔒 /:channel_id/thread-members/:user_id Remove a thread member 🔒 /:channel_id/thread-members List thread members 🔒 /:channel_id/pins Get pinned messages /:channel_id/pins/:message_id Pin a message 🔒 /:channel_id/pins/:message_id Unpin a message 🔒 /:channel_id/invites Create a channel invite 🔒 /:channel_id/invites/:invite_code Delete an invite 🔒 /:channel_id/webhooks List channel webhooks 🔒 /:channel_id/webhooks Create a webhook 🔒 /:channel_id/upload Upload a file (multipart) 🔒 /:channel_id/voice/connect Get a LiveKit token for voice 🔒 /:channel_id/voice/state Update voice state (mute, deafen) 🔒 /:channel_id/voice/disconnect Disconnect from voice channel 🔒 /:channel_id/messages/search Search messages (full-text) 🔒 /:channel_id/messages/:message_id/ack Acknowledge (mark as read) 🔒 /:channel_id/typing Trigger typing indicator 🔒 /:channel_id/messages/:message_id/polls/vote Vote on a poll 🔒 /:channel_id/messages/:message_id/polls/vote Remove poll vote 🔒 /:channel_id/messages/:message_id/interactions Submit a component interaction 🔒 /:channel_id/forum/posts List forum posts /:channel_id/forum/posts Create a forum post 🔒 /:channel_id/messages/:message_id/crosspost Crosspost an announcement message 🔒 /:channel_id/followers Follow an announcement channel 🔒 /:channel_id/permissions/:overwrite_id Edit channel permission overwrite 🔒 /:channel_id/permissions/:overwrite_id Delete channel permission overwrite 🔒 Webhooks
Execute, manage, and configure incoming webhooks.
Base: /api/webhooks
/:webhook_id/:token Execute a webhook (no auth required) /:webhook_id Get webhook details 🔒 /:webhook_id Edit a webhook (name, avatar, channel) 🔒 /:webhook_id Delete a webhook 🔒 Friends
Friend requests, acceptance, removal, and blocking.
Base: /api/friends
/ List all friendships 🔒 /:user_id Send a friend request 🔒 /:user_id/accept Accept a pending friend request 🔒 /:user_id Remove or reject a friendship 🔒 /:user_id/block Block a user 🔒 OAuth2
Full OAuth2 authorization code flow for third-party app integrations.
Base: /api/oauth2
/applications Register a new OAuth2 application 🔒 /applications List your applications 🔒 /applications/:app_id Get application details 🔒 /applications/:app_id Edit an application 🔒 /applications/:app_id Delete an application 🔒 /authorize Generate an authorization code 🔒 /token Exchange auth code for access token /token/revoke Revoke a token /@me Get current application info from Bearer token 🔒 Application Commands
Register and manage slash commands for bot applications.
Base: /api/applications
/:app_id/commands List all commands for an application 🔒 /:app_id/commands Create a new command 🔒 /:app_id/commands Bulk overwrite all commands 🔒 /:app_id/commands/:command_id Delete a command 🔒 Stage Instances
Manage Stage channel instances for live audio events.
Base: /api/stage-instances
/:channel_id Get stage instance for a channel /:channel_id Create a stage instance 🔒 /:channel_id Edit a stage instance 🔒 /:channel_id Delete a stage instance 🔒 Discovery
Browse, search, list, and unlist servers in the public directory.
Base: /api/discovery
/servers Search/browse listed servers (search, category, sort, limit, offset) /servers List your server for discovery (owner only) 🔒 /servers/:server_id Unlist your server 🔒 /categories List available discovery categories Gateway (WebSocket)
WebSocket connection for real-time events. Supports IDENTIFY, RESUME, heartbeat, intents, and all Discord-compatible opcodes.
Base: /api/gateway
/ WebSocket upgrade — connect to the real-time event stream 🔒 Authentication
Include a JWT token in the Authorization header for all authenticated requests:
Authorization: Bearer <your-jwt-token> Obtain a token via POST /api/auth/register or POST /api/auth/login. Bot tokens last 365 days; user tokens last 7 days.
Rate Limiting
The API enforces rate limits per endpoint. When rate-limited, you'll receive a 429 Too Many Requests response with a Retry-After header indicating how long to wait (in seconds).
Gateway Opcodes
The WebSocket gateway uses Discord-compatible opcodes:
Error Responses
All errors return a JSON body with a descriptive message:
{
"error": "Descriptive error message"
}