NexusGuild API Documentation
Welcome to the NexusGuild developer documentation. Here you'll find everything needed to build bots that interact with NexusGuild servers, or to build a custom NexusGuild client.
Overview
Base URL
All REST API endpoints are relative to the NexusGuild server base URL:
https://nexusguild.gg
Two API Surfaces
NexusGuild exposes two separate API surfaces depending on your use case:
| Surface | Auth Method | Base Path | Use For |
|---|---|---|---|
| Bot REST API | Authorization: Bot TOKEN |
/api/v1 |
Bot integrations, automation, slash commands |
| Client REST API | Session cookie (express-session) |
/api |
Building a NexusGuild client application |
Bot Gateway
Real-time events for bots are delivered over a Socket.io namespace at /bot-gateway.
Authenticate with your bot token on connection. See the Gateway docs.
IDs & Snowflakes
All entity IDs in NexusGuild â users, servers, channels, messages, roles â are
Snowflake IDs: 64-bit integers encoded as strings (VARCHAR(20)).
Always treat IDs as strings, never as JavaScript numbers (which lose precision above 53 bits).
before and after query params on
paginated endpoints to cursor through results.Snowflake Anatomy
| Bits | Field | Description |
|---|---|---|
| 63â22 | Timestamp | Milliseconds since NexusGuild epoch (2009-02-09T00:00:00Z) |
| 21â17 | Worker ID | Internal worker node |
| 16â12 | Process ID | Internal process |
| 11â0 | Increment | Sequence counter per millisecond |
Standard Error Codes
All error responses follow the format: {"code": NUMBER, "message": "string"}
| HTTP | Code | Message |
|---|---|---|
| 400 | 50006 | Cannot send an empty message |
| 400 | 50016 | Provide 1â100 message IDs (bulk delete) |
| 400 | 50035 | Invalid form body (missing required field) |
| 401 | 40001 | 401: Unauthorized (missing/invalid token) |
| 403 | 50001 | Missing Access (bot not in server or channel) |
| 403 | 50003 | Cannot delete a message authored by another user |
| 403 | 50005 | Cannot edit a message authored by another user |
| 403 | 50013 | Missing Permissions |
| 404 | 10003 | Unknown Channel |
| 404 | 10004 | Unknown Guild |
| 404 | 10007 | Unknown Member |
| 404 | 10008 | Unknown Message |
| 404 | 10011 | Unknown Role |
| 500 | 0 | Internal server error |