Noctra Public API

v2

Complete API reference for the Noctra Discord Bot and Dashboard. Use the endpoints below to integrate moderation logging, transcripts, cards, and more into any Discord bot.

Dashboard

The Noctra Dashboard is a web-based moderation and server management platform for Discord servers, accessible at noctra.xyz. It gives server staff a centralized view of all moderation activity, transcripts, and user histories — powered by this API.

Moderation Logging

The dashboard automatically displays all moderation actions recorded through the POST /api/modlogs/add endpoint. Every warn, timeout, ban, kick, and unban is stored as a permanent, shareable HTML page containing:

  • The moderator who performed the action (name, avatar, ID)
  • The target user (name, avatar, ID)
  • Action type, reason, and duration (for timeouts)
  • Timestamp and server information
  • A searchable, filterable history per user per server

Each moderation log generates a unique viewUrl that can be shared in Discord channels, posted in log channels, or accessed from the dashboard's moderation stats page.

Transcript Viewer

The dashboard includes a built-in transcript viewer that displays all channel transcripts generated via the POST /api/Transcript/html endpoint. Staff can browse, search, and review transcripts directly from the web interface — sorted by date, filterable by channel name, with file size and creator information.

Works with Any Bot

While the dashboard is designed to work seamlessly with the Noctra Discord bot, the API is fully independent. Any Discord bot can send moderation logs and generate transcripts using a standard bot token. The dashboard will display all data regardless of which bot submitted it — making it a universal moderation logging platform.

Getting Started

To start logging moderation actions to the dashboard, use the POST /api/modlogs/add endpoint with your bot token. The dashboard at noctra.xyz/dashboard will automatically show all logged actions after authenticating with Discord OAuth2.

For support or questions, contact support@noctra.xyz.

Moderation

9 endpoints

Endpoints for Discord server moderation actions including bans, kicks, timeouts, moderation logs, and modmail.

POST /api/modlogs/add

Record a new moderation action (warn, timeout, ban, kick, unban) for a Discord user.

Records a moderation action and generates a viewable HTML moderation log page stored in S3. The bot token is validated live against the Discord API (GET /users/@me) to ensure the bot is a member of the target guild. User and guild metadata (avatars, names, icons) are resolved via parallel Discord API calls. The response includes a permanent viewUrl that renders a styled HTML page with dark/light mode, search, and filtering. S3 path: {bucket}/{botId}/{guildId}/{userId}.json.

Prerequisites

  • Valid Discord Bot Token (validated live against Discord API)
  • Bot must be a member of the target guild
  • S3-compatible object storage configured on the server

Required Headers

Name Description Required Example
X-Bot-Token Discord Bot token for authentication. Yes MTEx...token
X-Guild-Id Discord snowflake ID of the server. Yes 123456789012345678
X-User-Id Discord snowflake ID of the target user. Yes 987654321098765432
X-Action Action type: Warn, Timeout, Ban, Kick, Unban. Yes Warn
X-Moderator-Id Discord snowflake ID of the moderator. Yes 111222333444555666
X-Moderator-Name Display name of the moderator. Yes AdminUser
X-Reason Free-text reason. No Spamming
X-Duration Duration for Timeout (e.g. 30m, 2h). No 2h

Responses

200 Entry persisted successfully.
{"success":true,"message":"Warn logged.","viewUrl":"https://api.noctra.xyz/api/modlogs/view/..."}
400 Missing required headers.
{"error":"Headers required."}
401 Invalid bot token.
{"error":"Bot token invalid."}
403 Bot not in guild.
{"error":"Bot not member."}
500 Internal error.
{"error":"Internal error."}

Use Cases

  • Recording a warn/ban/kick/timeout from an external moderation dashboard and posting the viewUrl in a Discord channel for staff reference
  • Building a persistent moderation history per user per server, accessible via a shareable HTML page with search and filtering
  • Automating moderation logging from a custom Discord bot that performs actions and needs an audit trail

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/modactions/ban

Permanently bans a user from a Discord server.

Executes a permanent ban via the Discord API (PUT /guilds/{serverId}/bans/{userId}). The ban is immediate and the user cannot rejoin until unbanned. The reason 'Banned via API' is recorded in the Discord audit log. Returns the banned user ID and server ID on success. Requires the bot to have BAN_MEMBERS permission and a role higher than the target user in the hierarchy.

Prerequisites

  • BAN_MEMBERS permission for the bot
  • Bot's highest role must be above the target user's highest role

Required Headers

Name Description Required Example
server-id Discord Guild ID. Yes 123456789012345678
bot-token Discord Bot Token. Yes TOKEN
user-id User ID to ban. Yes 987654321098765432

Responses

200 User banned.
{"message":"User successfully banned"}
400 Missing headers.
{"error":"Missing headers"}

Use Cases

  • Permanently remove a user who violated server rules via an external moderation dashboard
  • Automated ban enforcement triggered by anti-raid or automod systems
  • Bulk banning users identified by a spam detection pipeline

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/modactions/ban-with-reason

Bans a user with a custom reason and optional message deletion period.

Executes a ban with extended options via a JSON body. The reason is recorded in the Discord audit log (X-Audit-Log-Reason header). The deleteMessageDays parameter (0-7) controls how many days of the user's messages are purged from the server. Internally converts deleteMessageDays to delete_message_seconds for the Discord API v10 endpoint.

Prerequisites

  • BAN_MEMBERS permission for the bot
  • Bot's highest role must be above the target user's highest role

Required Headers

Name Description Required Example
server-id Guild ID. Yes 123456789012345678
bot-token Bot Token. Yes TOKEN
user-id User ID. Yes 987654321098765432

Parameters

Name Type Location Required Description
reason string body No Ban reason.
deleteMessageDays integer body No Days of messages to delete (0-7).

Request Examples

Ban with reason application/json
{"reason":"Spam","deleteMessageDays":1}

Responses

200 Banned.
{"message":"User successfully banned"}

Use Cases

  • Banning a user with a documented reason that appears in the Discord audit log for accountability
  • Removing a spammer and purging their last 7 days of messages in one operation

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
DELETE /api/modactions/unban

Removes a ban from a user on a Discord server.

Revokes an active ban via the Discord API (DELETE /guilds/{serverId}/bans/{userId}). After unbanning, the user can rejoin the server if they have a valid invite link. The action is recorded in the Discord audit log.

Prerequisites

  • BAN_MEMBERS permission for the bot

Required Headers

Name Description Required Example
server-id Guild ID. Yes 123456789012345678
bot-token Bot Token. Yes TOKEN
user-id User ID. Yes 987654321098765432

Responses

200 Unbanned.
{"message":"User successfully unbanned"}

Use Cases

  • Reversing a ban after a successful appeal process
  • Automated unban after a temporary ban period managed by an external system

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
DELETE /api/modactions/kick

Kicks a user from a Discord server.

Removes the user from the server via the Discord API (DELETE /guilds/{serverId}/members/{userId}). Unlike a ban, the user can rejoin immediately if they have a valid invite link. An optional reason is recorded in the Discord audit log via the X-Audit-Log-Reason header. Returns 204 No Content from Discord on success.

Prerequisites

  • KICK_MEMBERS permission for the bot
  • Bot's highest role must be above the target user's highest role

Required Headers

Name Description Required Example
server-id Guild ID. Yes 123456789012345678
bot-token Bot Token. Yes TOKEN
user-id User ID. Yes 987654321098765432
reason Kick reason. No Rule violations

Responses

200 Kicked.
{"message":"User successfully kicked"}

Use Cases

  • Removing a disruptive user as a warning before escalating to a ban
  • Automated kick for users who fail verification or age-gate checks

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/modactions/timeout

Applies a communication timeout to a user on a Discord server.

Temporarily prevents a user from sending messages, reacting, or joining voice channels. Duration is specified via the 'duration' header using a numeric value followed by a unit suffix: m (minutes), h (hours), d (days), w (weeks). Maximum allowed duration is 28 days. The timeout expiration timestamp (ISO 8601) is returned in the response. Requires MODERATE_MEMBERS permission.

Prerequisites

  • MODERATE_MEMBERS permission for the bot
  • Target user must not be an administrator or server owner

Required Headers

Name Description Required Example
server-id Guild ID. Yes 123456789012345678
bot-token Bot Token. Yes TOKEN
user-id User ID. Yes 987654321098765432
duration Duration (e.g. 6h, 30m, 1d). Yes 6h
reason Timeout reason. No Spamming

Responses

200 Timeout applied.
{"message":"Timeout successfully applied","expiresAt":"2024-01-15T18:00:00Z"}

Use Cases

  • Temporarily muting a user who is spamming in chat without removing them from the server
  • Applying a cooldown period after a rule violation as a lighter alternative to a ban
  • Automated timeout triggered by message frequency or content detection systems

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
DELETE /api/modactions/timeout

Removes an active timeout from a user before it expires.

Removes an active communication timeout by setting communication_disabled_until to null via the Discord API (PATCH /guilds/{serverId}/members/{userId}). The user immediately regains the ability to send messages, react, and join voice. Requires MODERATE_MEMBERS permission. An optional reason is recorded in the audit log.

Prerequisites

  • MODERATE_MEMBERS permission for the bot

Required Headers

Name Description Required Example
server-id Guild ID. Yes 123456789012345678
bot-token Bot Token. Yes TOKEN
user-id User ID. Yes 987654321098765432

Responses

200 Timeout removed.
{"message":"Timeout successfully removed"}

Use Cases

  • Lifting a timeout early after a user submits a successful appeal
  • Automated timeout removal when a moderation review determines the action was unwarranted

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/modmail/inbound

Forwards a user's Direct Message to the designated staff modmail channel.

Acts as a stateless bridge between a Discord bot and a staff channel. When a user sends a DM to the bot, this endpoint creates a rich embed in the staff channel containing the message content, sender info, and any attachments. The message body must be sent as raw plain text (Content-Type: text/plain). Multiple attachments are supported via the X-Attachment-Url header (semicolon-separated URLs, up to 10 images rendered as a gallery).

Prerequisites

  • Valid Discord Bot Token
  • Bot must have SEND_MESSAGES and EMBED_LINKS permissions in the target staff channel

Required Headers

Name Description Required Example
X-Bot-Token Bot Token. Yes TOKEN
X-Target-Channel-ID Staff channel ID. Yes 123456789012345678
X-User-ID Sender user ID. Yes 987654321098765432
X-User-Name Sender username. Yes JohnDoe
X-User-Avatar Sender avatar URL. Yes https://cdn.discordapp.com/avatars/...

Request Examples

Forward DM text/plain
Hello, I need help.

Responses

200 Forwarded.
{"status":"Forwarded to staff"}

Use Cases

  • Building a modmail system where user DMs are forwarded to a private staff channel for review and response
  • Creating a support ticket flow where users contact staff without needing to be in the server's channels
  • Forwarding reports or appeals from users to a dedicated moderation team channel

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/modmail/outbound

Sends a staff reply to a user via Direct Message.

Sends a formatted embed DM to the specified user as a reply from staff. The reply content must be sent as raw plain text (Content-Type: text/plain). The bot appears as the sender of the DM. Multiple attachments are supported via the X-Attachment-Url header (semicolon-separated). Will fail if the user has DMs disabled or does not share a server with the bot.

Prerequisites

  • Valid Discord Bot Token
  • Bot and target user must share at least one server
  • User must have DMs enabled for the shared server

Required Headers

Name Description Required Example
X-Bot-Token Bot Token. Yes TOKEN
X-Target-User-ID Target user ID. Yes 987654321098765432
X-Mod-Name Staff member name. No Support Team

Request Examples

Reply text/plain
Issue resolved.

Responses

200 Sent.
{"status":"Reply sent to user"}

Use Cases

  • Replying to a user's modmail ticket from a staff command or dashboard interface
  • Sending automated follow-up messages to users after their support request is resolved

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Channels

2 endpoints

Endpoints for retrieving Discord channel information and managing channel positions.

GET /api/Channel/GetChannelInfo

Retrieves detailed metadata about a specific Discord channel.

Fetches comprehensive channel information from the Discord REST API (v10) including channel name, type (text, voice, forum, etc.), topic, position within the channel list, permission overwrites for roles and members, rate limit (slow mode) settings, NSFW flag status, and parent category. The bot token prefix is added internally. Subject to Discord API rate limits.

Prerequisites

  • VIEW_CHANNEL permission for the bot in the target channel
  • Valid Discord Bot Token

Required Headers

Name Description Required Example
Discord-Token Discord bot token. Yes TOKEN

Parameters

Name Type Location Required Description
guildId string query Yes Discord guild ID.
channelId string query Yes Discord channel ID.

Responses

200 Channel info retrieved.
{"id":"987654321098765432","name":"general","type":0}
400 Missing parameters.
"Missing token, guildId, or channelId."

Use Cases

  • Displaying channel settings and permissions in a management dashboard
  • Auditing channel configurations such as slow mode, NSFW status, and permission overwrites
  • Retrieving channel topic and type information for bot command routing

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/channel/move

Moves a Discord channel to a different category and/or changes its position.

Performs a channel move with intelligent reordering. When a target category is specified, the channel is moved into that category and inserted at the given position index (0-based) among channels of the same type. All sibling channels are automatically reordered to maintain consistent sequential positions. When no target category is specified, only the channel's position value is updated. The position is clamped to valid bounds (0 to channel count).

Prerequisites

  • MANAGE_CHANNELS permission for the bot
  • Channel must be a guild channel (not a DM channel)

Required Headers

Name Description Required Example
Discord-Token Bot token with MANAGE_CHANNELS. Yes TOKEN
ChannelId Channel ID to move. Yes 123456789012345678
TargetCategoryId Target category ID. No 987654321098765432
Position Desired position (0-based). No 2

Responses

200 Moved.
{"success":true,"position":2,"category":"Text Channels"}

Use Cases

  • Reorganizing server channel layout from a dashboard without manual drag-and-drop in Discord
  • Moving a channel to a different category as part of an automated server setup or template system
  • Reordering channels within a category based on activity or priority rules

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Server

5 endpoints

Endpoints for Discord server information, boost features, categories, voice channels, and automod rules.

GET /api/DiscordBooster/guild/{guildId}/additional-perks

Retrieves available additional perks for a Discord guild based on boost status.

Analyzes a Discord server's boost status using official Discord API Guild Features to detect currently active additional perks. Returns detection status for Server Tags (GUILD_TAGS feature flag) and Enhanced Role Styles (ENHANCED_ROLE_COLORS feature flag). Some newer features like Server Tag Badge Packs do not yet have dedicated API feature flags and cannot be detected. Even with sufficient boosts, some features may not be available due to Discord's gradual rollout process.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be a member of the target guild

Required Headers

Name Description Required Example
Bot-Token Discord bot token. Yes TOKEN

Parameters

Name Type Location Required Description
guildId string path Yes Discord guild ID (17-19 digits).

Responses

200 Perks retrieved.
{"serverTag":{"isActive":false},"enhancedRoleStyles":{"isActive":true}}

Use Cases

  • Displaying which boost perks are active on a server in a dashboard UI
  • Determining if Enhanced Role Styles (gradient colors) are available before attempting to create gradient roles
  • Monitoring boost perk activation status across multiple managed servers

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/DiscordBooster/privileges/{guildId}

Retrieves available booster role customization privileges for a guild.

Determines which booster role customization options are available based on the guild's premium tier and feature flags. Returns privilege levels: Standard (always available), Color (Tier 1+, 2 boosts), Gradient (Tier 2+, 7 boosts, requires ENHANCED_ROLE_COLORS), and Icon (Tier 2+, 7 boosts, requires ROLE_ICONS). Each privilege includes required tier, required boosts, and whether it is currently available.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be a member of the target guild

Required Headers

Name Description Required Example
Bot-Token Discord bot token. Yes TOKEN

Parameters

Name Type Location Required Description
guildId string path Yes Discord guild ID.

Responses

200 Privileges retrieved.
{"hasStandard":true,"hasColor":true,"hasGradient":false,"hasIcon":false}

Use Cases

  • Determining which customization options to show boosters in a role-creation UI (color picker, gradient picker, icon upload)
  • Gating booster role features in a dashboard based on the server's actual boost tier

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/AutoModRules/{guildId}

Retrieves keyword filters from enabled auto moderation rules for a Discord guild.

Fetches all auto moderation rules from the Discord API, filters to only enabled rules, and extracts keyword_filter entries from their trigger_metadata. Returns the total count of keywords and a comma-separated string of all keyword filter entries. Rate limited to 1 request per minute per bot token to prevent excessive Discord API calls. Requires MANAGE_GUILD permission.

Prerequisites

  • MANAGE_GUILD permission for the bot
  • Valid Discord Bot Token

Required Headers

Name Description Required Example
Discord-Token Discord bot token. Yes TOKEN

Parameters

Name Type Location Required Description
guildId string path Yes Discord guild ID.

Responses

200 Rules retrieved.
{"total_keywords":15,"keywords":"spam,scam,phishing"}
429 Rate limit exceeded.
"Rate limit exceeded. Please wait 1 minute."

Use Cases

  • Syncing automod keyword lists to an external dashboard for display and editing
  • Auditing which words are blocked across multiple servers managed by the same bot
  • Exporting automod configuration for backup or migration purposes

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/DiscordCategory/info

Retrieves detailed information about a Discord category and all channels within it.

Fetches a Discord category channel by ID and returns comprehensive information including all child channels with their settings, permissions, and metadata. The response includes total channel count, category position, guild info, and per-channel details (type, topic, NSFW flag, slow mode, bitrate, user limit, permission overwrites). Channel creation timestamps are derived from Discord snowflake IDs.

Prerequisites

  • Valid Discord Bot Token
  • Bot must have access to the guild containing the category

Required Headers

Name Description Required Example
X-Bot-Token Discord bot token. Yes TOKEN
X-Category-Id Discord category channel ID. Yes 123456789012345678

Responses

200 Category info retrieved.
{"categoryId":"123","categoryName":"Text Channels","totalChannels":5}
400 Not a category.
{"error":"The provided ID is not a category channel"}

Use Cases

  • Displaying a category's full channel structure in a server management dashboard
  • Auditing permission overwrites across all channels in a category
  • Building a visual channel tree for server configuration interfaces

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/VoiceChannel/info

Retrieves comprehensive real-time voice channel information including connected users.

Establishes a temporary Discord Gateway WebSocket connection to fetch live voice channel data. Returns channel details (name, bitrate, user limit, region, category, position) and a list of all currently connected users with their voice states (muted, deafened, streaming, camera). Uses GUILDS and GUILD_VOICE_STATES intents. Note: The Gateway connection takes approximately 3 seconds to initialize and receive voice state data.

Prerequisites

  • Valid Discord Bot Token
  • GUILDS and GUILD_VOICE_STATES Gateway intents enabled for the bot

Required Headers

Name Description Required Example
bot-token Discord bot token. Yes TOKEN
channel-id Voice channel ID. Yes 123456789012345678

Responses

200 Voice channel info.
{"channelName":"General","connectedUsersCount":5,"bitrate":64000}
404 Channel not found.
{"error":"Voice channel not found"}

Use Cases

  • Monitoring voice channel occupancy for a live dashboard showing who is in which voice channel
  • Checking if a voice channel has available slots before directing users to join
  • Displaying user voice states (streaming, camera, muted) in a server activity panel

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Roles

8 endpoints

Endpoints for Discord role management including creation, updates, member queries, and purging.

POST /api/Role/create

Creates a new role in a Discord guild with full customization options.

Creates a role via the Discord API with support for name, solid color, gradient colors (2-3 hex values for gradient/holographic effects), permissions, hoist, mentionable, icon (downloaded from URL and converted to Base64), and position. Supports Discord's ENHANCED_ROLE_COLORS feature with automatic fallback — if the guild doesn't have the feature, the 'colors' object is removed and only the legacy color field is used. The guild is validated via the Discord API before creation.

Prerequisites

  • MANAGE_ROLES permission for the bot
  • Bot's highest role must be above the position where the new role is placed
  • ENHANCED_ROLE_COLORS guild feature required for gradient colors (auto-fallback to solid color)

Required Headers

Name Description Required Example
Discord-Token Discord bot token. Yes TOKEN
Guild-ID Guild ID. Yes 123456789012345678
Role-Name Role name. No VIP
Color Hex color. No #ff0000
Gradient-Color Comma-separated gradient hex colors. No #ff0000,#00ff00
Permissions Permission integer. No 0
Hoist Display separately (true/false). No true
Mentionable Mentionable (true/false). No false
Icon-URL Role icon URL. No
Position Role position. No 5

Responses

200 Role created.
{"Message":"Role created successfully.","RoleId":"123456","GradientApplied":true}
404 Guild not found.
"Guild not found."

Use Cases

  • Creating roles programmatically as part of an automated server setup or template system
  • Adding gradient/holographic roles for boosted servers from a dashboard interface
  • Batch-creating roles with specific permissions for a moderation hierarchy

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/Role/booster/{guildIdStr}/{userIdStr}

Creates a personalized custom booster role for a server booster.

Creates a custom role exclusively for a verified server booster. Validates that the user is a member of the guild, has the booster role, and doesn't already have a custom booster role (limit 1 per user). The role is automatically positioned above the server's booster role in the hierarchy and assigned to the user. Supports custom name, color, gradient colors, and icon.

Prerequisites

  • User must be a server booster

Required Headers

Name Description Required Example
Discord-Token Bot token. Yes TOKEN
Role-Name Custom role name. No Custom Booster
Color Hex color. No #5865f2
Gradient-Color Gradient colors. No #ff0000,#0000ff
Icon-URL Icon URL. No

Parameters

Name Type Location Required Description
guildIdStr string path Yes Guild ID.
userIdStr string path Yes User ID.

Responses

200 Booster role created.
{"message":"Booster role created successfully","roleId":"123"}
403 User is not a booster.
{"error":"User is not a server booster"}

Use Cases

  • Custom booster roles

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
PUT /api/Role/booster/{guildIdStr}/{userIdStr}

Updates an existing custom booster role.

Updates name, color, gradient, or icon of a user's custom booster role.

Prerequisites

  • User must own the role being updated (validated via role assignment check)
  • Valid Discord Bot Token with MANAGE_ROLES permission

Required Headers

Name Description Required Example
Discord-Token Bot token. Yes TOKEN
Role-ID Role ID to update. Yes 123456789012345678

Parameters

Name Type Location Required Description
guildIdStr string path Yes Guild ID.
userIdStr string path Yes User ID.

Responses

200 Updated.
{"message":"Role updated"}
403 Not owner.
{"error":"You do not own this role"}

Use Cases

  • Allowing a booster to change their custom role's name, color, or icon from a dashboard
  • Updating gradient colors on a booster role when the server unlocks ENHANCED_ROLE_COLORS

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
DELETE /api/Role/booster/{guildIdStr}/{userIdStr}

Permanently deletes a user's custom booster role from the guild.

Validates that the requesting user owns the specified role before deleting it via the Discord API (DELETE /guilds/{guildId}/roles/{roleId}). The role is permanently removed from the guild and all members who had it assigned.

Prerequisites

  • User must own the role being deleted (validated via role assignment check)
  • Valid Discord Bot Token with MANAGE_ROLES permission

Required Headers

Name Description Required Example
Discord-Token Bot token. Yes TOKEN
Role-ID Role ID to delete. Yes 123456789012345678

Parameters

Name Type Location Required Description
guildIdStr string path Yes Guild ID.
userIdStr string path Yes User ID.

Responses

200 Deleted.
{"message":"Booster role deleted successfully"}

Use Cases

  • Allowing a booster to remove their custom role when they no longer want it
  • Cleaning up custom booster roles when a user stops boosting the server

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/RoleMemberPurge/purge

Removes all members from a specified Discord role (max 50 per request).

Fetches all guild members via paginated API calls, identifies those with the specified role, and removes the role from up to 50 members per request. Includes retry logic (up to 3 attempts per member) with exponential backoff for rate limiting. Uses progressive delays between removals (200ms increasing to 1s) to avoid Discord API rate limits. Automatically discovers the guild ID by searching through the bot's guilds for the target role.

Prerequisites

  • MANAGE_ROLES permission for the bot
  • Bot's highest role must be above the target role in the hierarchy

Required Headers

Name Description Required Example
Bot-Token Bot token with manage roles permission. Yes TOKEN
Role-Id Role ID to purge. Yes 123456789012345678

Responses

200 Purge result.
{"success":true,"totalMembersFound":25,"membersRemoved":25}
429 Rate limited.
"Rate limit exceeded"

Use Cases

  • Cleaning up a temporary event role after an event ends by removing it from all participants
  • Mass-removing a role that was accidentally assigned to too many members
  • Resetting role assignments as part of a periodic role rotation system

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/HighestRole

Retrieves the highest-positioned role assigned to a specific user in a Discord guild.

Proxies the request to the Noctra v2 API to determine a user's highest role by position value. The highest role determines the user's effective permission level in the role hierarchy — a higher position number means more authority. The Discord bot token is forwarded as an Authorization header. Returns the role name or position data.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be in the target server

Required Headers

Name Description Required Example
Discord-Token Bot token. Yes TOKEN

Parameters

Name Type Location Required Description
serverid string query Yes Server ID.
userid string query Yes User ID.

Responses

200 Highest role returned.
"Admin"

Use Cases

  • Determining a user's effective permission level for display in a moderation dashboard
  • Checking if a moderator outranks a target user before allowing moderation actions
  • Displaying a user's primary role badge in a profile or leaderboard UI

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/GetRoleCount

Retrieves the number of members assigned to a specific role in a Discord guild.

Proxies the request to the Noctra v2 API to count how many users have a specific role assigned. The Discord bot token is forwarded as an Authorization header to the external API. Returns the count as a plain number. Useful for displaying role statistics in dashboards or monitoring role assignment growth over time.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be in the target server

Required Headers

Name Description Required Example
Discord-Token Bot token. Yes TOKEN

Parameters

Name Type Location Required Description
serverid string query Yes Server ID.
roleid string query Yes Role ID.

Responses

200 Count returned.
"42"

Use Cases

  • Displaying role member counts in a server management dashboard
  • Monitoring role assignment growth over time for analytics
  • Validating role-based access control configurations by checking member counts

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/RoleMembers/role/{roleIds}

Retrieves Discord guild members filtered by one or more role IDs via Gateway WebSocket.

Establishes a WebSocket connection to the Discord Gateway to fetch all guild members, then filters by the specified role IDs. Supports two modes: 'all' (members must have ALL specified roles) and 'any' (members with at least one role). The 'duplications' header controls whether a user with multiple matching roles appears once (assigned to their highest role) or multiple times. Uses GUILD_MEMBERS intent. Should be used sparingly as repeated calls count as WebSocket spam. Overall timeout: 180 seconds.

Prerequisites

  • GUILD_MEMBERS privileged Gateway intent enabled for the bot
  • Valid Discord Bot Token

Required Headers

Name Description Required Example
discord-token Bot token. Yes TOKEN
guild-id Guild ID. Yes 123456789012345678
duplications Allow duplicates (true/false). No false

Parameters

Name Type Location Required Description
roleIds string path Yes Comma-separated role IDs.
mode string query No Filter mode: all or any.

Responses

200 Members grouped by role.
{"RoleGroups":[],"AllMembers":{"TotalMembers":10}}

Use Cases

  • Listing all members with a specific role for a role-based leaderboard or member directory
  • Finding users who have multiple specific roles (e.g., both 'Verified' and 'Booster') using 'all' mode
  • Building a role assignment report showing which members belong to which role groups

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Messages

4 endpoints

Endpoints for sending and editing Discord messages.

POST /api/Message/sendEmbed/{channelId}

Sends a formatted embed message to a Discord channel with rate limiting.

Posts an embedded message to a Discord channel with customizable title, description, color (integer), optional footer with icon, optional large image, and optional plain text content outside the embed. Includes per-channel rate limiting (10-second cooldown) to prevent spam. The bot must have SEND_MESSAGES and EMBED_LINKS permissions in the target channel. Returns HTTP 429 with remaining cooldown time if rate limit is exceeded.

Prerequisites

  • SEND_MESSAGES and EMBED_LINKS permissions for the bot in the target channel
  • Valid Discord Bot Token

Required Headers

Name Description Required Example
discord-token Bot token. Yes TOKEN
title Embed title. Yes Announcement
description Embed body text. Yes Hello everyone!
color Embed color (integer). Yes 5814783
footer Footer text. No Posted by Bot
user-icon Footer icon URL. No
image-url Embed image URL. No
plain-text Plain text outside embed. No

Parameters

Name Type Location Required Description
channelId string path Yes Target channel ID.

Responses

200 Message sent.
"Message sent successfully."
429 Rate limited.
"Rate limit exceeded. Try again in 8.5 seconds."

Use Cases

  • Sending formatted announcements or notifications to a Discord channel from an external dashboard
  • Posting automated alerts (e.g., server status, new content) as rich embeds with custom branding colors

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
PATCH /api/edit/smart-edit

Updates a single component within a Discord message using content-based search.

Uses a 'Search and Replace' approach to find a component by a unique substring of its text content (whitespace- and case-insensitive comparison). Retrieves the current message state via GET, locates the matching component, replaces its entire 'content' field with the new value, and PATCHes the message back. Returns 404 if no match is found, or 409 if the search text matches multiple components (ambiguity). Only writable fields (content, embeds, components, allowed_mentions) are sent in the PATCH payload.

Prerequisites

  • Bot must be the author of the message being edited
  • Valid Discord Bot Token

Required Headers

Name Description Required Example
Bot-Token Discord bot token. Yes TOKEN
X-Channel-Id Channel ID. Yes 123456789012345678
X-Message-Id Message ID. Yes 987654321098765432

Parameters

Name Type Location Required Description
targetContentSubstring string body Yes Unique substring to find.
newContent string body Yes New content to replace with.

Request Examples

Update component application/json
{"targetContentSubstring":"old text","newContent":"new text"}

Responses

200 Updated.
{"success":true,"message":"Component updated successfully."}
404 No match found.
{"error":"No component found matching..."}
409 Ambiguous match.
{"error":"Ambiguity: 2 components matching..."}

Use Cases

  • Dynamically updating a specific section of a multi-component bot message (e.g., updating a stats counter) without rebuilding the entire message
  • Editing bot messages from an external dashboard by targeting specific text content rather than tracking component indices

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
PATCH /api/edit/smart-edit/ephemeral

Updates a component in an ephemeral (hidden) Discord message using smart search.

Identical smart edit logic as the main endpoint, but specifically for ephemeral messages tied to a Discord interaction. Uses the bot's Application ID and the Interaction Token (valid for 15 minutes after the interaction) instead of Channel/Message IDs. The search for targetContentSubstring is whitespace- and case-insensitive. Channel and Message IDs are not needed since ephemeral messages are addressed via the webhook URL pattern.

Prerequisites

  • Valid interaction token (expires 15 minutes after the interaction)
  • Bot Application ID

Required Headers

Name Description Required Example
X-Application-Id Bot application ID. Yes 123456789012345678
Interaction-Token Interaction token (valid 15 min). Yes aW50ZXJhY3Rpb25fdG9rZW4...

Parameters

Name Type Location Required Description
targetContentSubstring string body Yes Unique substring to find.
newContent string body Yes New content.

Responses

200 Updated.
{"success":true}

Use Cases

  • Updating the content of an ephemeral slash command response after additional processing completes
  • Dynamically modifying a hidden interaction response (e.g., updating a progress indicator or status message)

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/filecheck/check

Checks if a Discord message contains a file attachment and identifies the file type.

Inspects a specific Discord message via the Discord API to detect file attachments (direct uploads) and embedded media (link previews from imgur, giphy, etc.). Detection uses a priority chain: first checks the attachments array for content_type, then filename extension, then URL; then checks embeds for image/video/gifv types. Supports images (png, jpg, gif, webp), videos (mp4, webm, mov), documents (pdf, docx), and archives (zip, rar). Returns isFile (boolean) and fileType (string or null).

Prerequisites

  • READ_MESSAGE_HISTORY permission for the bot in the target channel
  • Valid Discord Bot Token

Required Headers

Name Description Required Example
Bot-Token Bot token. Yes TOKEN
Channel-Id Channel ID. Yes 123456789012345678
Message-Id Message ID. Yes 987654321098765432

Responses

200 Check result.
{"isFile":true,"fileType":"image/png"}
404 Message not found.
{"error":"Message or channel not found."}

Use Cases

  • Enforcing image-only channels by checking if messages contain valid image attachments
  • Building a media gallery bot that indexes file types from channel messages
  • Detecting and logging file sharing activity for moderation purposes

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Users

4 endpoints

Endpoints for Discord user information, account age, and permission comparison.

GET /api/Account/age

Returns the account age of a Discord user.

Calculates account age from the Discord snowflake ID. Returns age in days, weeks, months, and years. Useful for age-gating, anti-raid detection, and trust scoring.

Prerequisites

  • Valid Discord Bot Token

Required Headers

Name Description Required Example
Discord-Token Discord bot token for authentication. Yes TOKEN
Discord-UserId The Discord user ID to check. Yes 987654321098765432

Responses

200 Account age returned.
{"days":1245,"weeks":177,"months":40,"years":3}
400 Missing headers or invalid snowflake.
{"error":"Missing 'Discord-UserId' header."}

Use Cases

  • Age-gating for server access
  • Anti-raid detection of new accounts
  • Trust scoring systems

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/DiscordPermission/compare

Compares permission levels and role hierarchies of two Discord users within a guild.

Performs a comprehensive permission comparison using the Discord REST API. Evaluates each user's effective permissions by aggregating all assigned roles, considering role hierarchy (position value), and checking for special permissions like Administrator and server ownership. Returns highest role position, owner status, and which user has higher authority. Server owners always have maximum authority regardless of roles.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be a member of the target guild with permission to view member information

Required Headers

Name Description Required Example
bot-token Bot token. Yes TOKEN
user-id-1 First user ID. Yes 123456789012345678
user-id-2 Second user ID. Yes 987654321098765432
guild-id Guild ID. Yes 111222333444555666

Responses

200 Comparison result.
{"user_1":{"name":"Admin","role_position":1000},"user_2":{"name":"Mod","role_position":750},"comparison":{"user_1_higher":true}}
404 User not found.
{"error":"User 1 not found on this guild"}

Use Cases

  • Determining if a moderator can act on a target user by checking role hierarchy before executing a ban or kick
  • Displaying permission comparison in a moderation dashboard to show who outranks whom
  • Validating role-based access control before executing moderation actions from an external system

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/DiscordPermission/compare-user-roles

Compares a user's highest role position against multiple specified roles.

Checks if a user's highest role is above each of the provided roles (comma-separated IDs). Roles are numbered from left to right (1-indexed) in the order provided. Uses Discord role position values for comparison — higher position number means higher authority. Server owners are automatically considered higher than all roles. Returns per-role comparison results and an overall summary.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be a member of the target guild

Required Headers

Name Description Required Example
bot-token Bot token. Yes TOKEN
user-id User ID. Yes 123456789012345678
guild-id Guild ID. Yes 111222333444555666
role-ids Comma-separated role IDs. Yes 123,456,789

Responses

200 Comparison results.
{"result":{"overall":"user-higher-than-all-roles"}}

Use Cases

  • Validating if a user has authority over specific moderation roles before allowing them to perform actions
  • Checking permission tiers in a multi-level moderation system (e.g., can this mod manage Trial Mods but not Admins)

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/DiscordPermission/guild-info

Retrieves basic guild information including name, owner, and member count.

Returns fundamental guild metadata via the Discord REST API including guild ID, name, owner ID, approximate member count, and creation date. Uses the bot's cached guild data. Useful for quick server overview without fetching detailed channel or role information.

Prerequisites

  • Valid Discord Bot Token
  • Bot must be a member of the target guild

Required Headers

Name Description Required Example
bot-token Bot token. Yes TOKEN
guild-id Guild ID. Yes 123456789012345678

Responses

200 Guild info.
{"id":"123","name":"My Server","owner_id":"456"}

Use Cases

  • Displaying server overview information in a dashboard header
  • Verifying bot access to a guild before performing other operations

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Invites

1 endpoints

Endpoints for resolving Discord invite links.

POST /api/Invitation/query

Resolves a Discord invite link or code into structured server and inviter data.

Queries the Discord API (GET /invites/{code}?with_counts=true&with_expiration=true) to retrieve detailed invite metadata. Accepts full URLs (discord.gg/..., discord.com/invite/...) or bare invite codes. Returns guild information (name, ID, icon, vanity URL, description), target channel (name, ID, type), inviter profile (username, ID, avatar, bot status), and approximate member/presence counts.

Prerequisites

  • Valid Discord Bot Token

Required Headers

Name Description Required Example
Discord-Token Bot token. Yes TOKEN

Parameters

Name Type Location Required Description
inviteLink string body Yes Discord invite URL or code.

Request Examples

Resolve invite application/json
{"inviteLink":"https://discord.gg/E2pce4JTSK"}

Responses

200 Invite resolved.
{"inviteCode":"E2pce4JTSK","guild":{"name":"My Server"},"approximateMemberCount":1500}
400 Invalid invite.
"Invalid invite link."

Use Cases

  • Previewing a Discord server before joining by resolving an invite link to show server name, member count, and description
  • Analyzing invite links shared in chat to detect potential raid or scam servers
  • Building an invite tracker that logs who created invites and how many members they brought

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Transcripts

2 endpoints

Endpoints for generating, storing, and managing Discord channel transcripts.

POST /api/Transcript/html

Generates a self-contained HTML transcript of a Discord channel and uploads it to S3.

Fetches up to 10,000 messages from a Discord channel via the REST API, embeds all media (images, videos up to 600 MB, audio) as Base64 data-URIs into a single self-contained HTML file, uploads it to S3-compatible storage, writes a JSON index entry for metadata, and optionally posts the transcript file to a target Discord channel. Returns a direct view-link and the view ID. The HTML file is fully self-contained with no external dependencies.

Prerequisites

  • Valid Discord Bot Token
  • Bot must have READ_MESSAGE_HISTORY permission in the source channel
  • S3-compatible object storage configured on the server

Required Headers

Name Description Required Example
X-Bot-Token Discord Bot token. Yes TOKEN
X-Channel-Id Channel ID to export. Yes 123456789012345678
X-Target-Channel-Id Channel to post the file to (optional). No 987654321098765432
X-Limit Max messages (1-10000, default 10000). No 500
X-Filename Output filename. No transcript.html
X-Creator-Id Creator user ID for metadata. No 111222333444555666

Responses

200 Transcript generated.
{"message":"Transcript generated","messageCount":250,"directLink":"https://api.noctra.xyz/api/Transcript/view/...","viewId":"abc-123"}
401 Missing bot token.
{"error":"X-Bot-Token header is required"}
404 No messages found.
{"error":"No messages found in channel"}

Use Cases

  • Generating a permanent transcript of a support ticket channel before closing it, with the link posted to a log channel
  • Archiving important discussion channels as self-contained HTML files that can be viewed offline
  • Creating moderation evidence transcripts that capture full message history including attachments and embeds

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/Transcript/list/{guildId}

Retrieves a paginated list of all transcripts for a specific guild from S3 storage.

Lists all transcript index files from S3, filters by the requested guild ID, reads metadata (channel name, creator info, timestamps), determines file sizes via HEAD requests, and returns results sorted by creation date (newest first). Supports role-based access control — admin-only transcripts (channels with 'admin' in the name) are hidden from moderator-level users. Session-based authentication is used when available.

Prerequisites

  • S3-compatible object storage configured on the server

Parameters

Name Type Location Required Description
guildId string path Yes Discord guild ID.

Responses

200 Transcript list.
[{"viewId":"abc","channelName":"tickets","createdAt":"2024-01-15T10:00:00Z"}]
400 Invalid guild ID.
{"error":"Invalid guildId format"}

Use Cases

  • Displaying a searchable transcript history in a server management dashboard
  • Building a transcript browser with file sizes, creation dates, and creator information
  • Implementing role-based access where moderators see only non-admin transcripts

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Utilities

5 endpoints

General utility endpoints for text processing, regex matching, timestamps, and value comparison.

POST /api/Text/stringify

Accepts plain text and returns it as a JSON-safe escaped string.

Requires Content-Type: text/plain. Manually escapes all special characters (backslashes first to avoid double-escaping, then quotes, newlines, carriage returns, and tabs) so the result can be safely embedded in a JSON template string without breaking structure. Returns the original text, character count, and the escaped version.

Request Examples

Stringify text text/plain
Hello "world"
New line

Responses

200 Escaped text.
{"text":"Hello \"world\"\nNew line","characterCount":22,"stringified":"Hello \\\"world\\\"\\nNew line"}
400 Empty body.
"Request body must not be empty."

Use Cases

  • Preparing user-generated text for safe embedding in JSON payloads sent to Discord webhooks
  • Escaping multi-line text content before inserting it into a JSON template for embed descriptions

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/TextChunker/split

Splits large text into Discord-safe message chunks at word boundaries.

Splits text at word boundaries (spaces) to avoid breaking words mid-character. Default chunk size is 1800 characters (leaves buffer for Discord formatting/embeds). If a single word exceeds the chunk size, it is placed in its own chunk. Returns indexed chunks with content, length, total chunks, total characters, and the chunk size used.

Parameters

Name Type Location Required Description
text string body Yes Text to split.
chunkSize integer body No Max chars per chunk.

Request Examples

Split text application/json
{"text":"Very long text...","chunkSize":1800}

Responses

200 Chunks returned.
{"chunks":[{"index":1,"content":"...","length":1750}],"totalChunks":2,"chunkSizeUsed":1800}
400 Missing text.
{"error":"The text field is required."}

Use Cases

  • Splitting long bot responses that exceed Discord's 2000-character message limit into multiple sequential messages
  • Paginating log output or command results for display across multiple Discord messages

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/Regex/match

Tests a regular expression pattern against an input string with timeout protection.

Evaluates a .NET regex pattern against a provided string with a 1-second timeout to prevent ReDoS (Regular Expression Denial of Service) attacks. Case sensitivity is controlled via the X-Regex-Case-Sensitive header (defaults to case-sensitive). Returns whether the input matched, the matched substring (if any), and error details on failure. Supports standard .NET Regex syntax.

Required Headers

Name Description Required Example
X-Regex-Case-Sensitive true/false for case sensitivity. No true

Parameters

Name Type Location Required Description
pattern string body Yes Regex pattern.
input string body Yes Text to test.

Request Examples

Match email application/json
{"pattern":"^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$","input":"user@example.com"}

Responses

200 Match result.
{"isMatch":true,"matchedValue":"user@example.com","error":null}
408 Timeout.
{"isMatch":false,"error":"Timeout: Operation took longer than 1s."}

Use Cases

  • Testing and validating regex patterns for automod keyword rules before deploying them
  • Checking if user input matches expected formats (emails, URLs, IDs) from a bot command

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/Timestamp

Generates a Discord-compatible Unix timestamp based on a time offset from now.

Calculates a future (or present) Unix timestamp by adding a specified duration to the current UTC time. Supports units: seconds, minutes, hours, days, and 'now' (returns current timestamp). The returned value can be used in Discord messages with the format <t:TIMESTAMP:R> for relative time or <t:TIMESTAMP:F> for full date/time display.

Parameters

Name Type Location Required Description
value integer query No Numeric offset amount.
unit string query Yes Unit: seconds, minutes, hours, days, now.

Responses

200 Timestamp generated.
{"unixTimestamp":1678886402}
400 Invalid unit.
"Unknown unit: weeks. Valid: seconds, minutes, hours, days, now."

Use Cases

  • Generating Discord timestamp strings for bot commands (e.g., 'this event starts <t:1678886402:R>')
  • Creating countdown timers by calculating a future timestamp and formatting it with Discord's relative time display

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/CommonValue

Compares two string lists and returns their intersection (common values).

Performs a set intersection operation on two provided string arrays and returns the common values. Useful for Discord bot operations such as finding shared roles between two users, identifying common permissions across role sets, or comparing channel access lists. Rate limiting is configured per client IP address (currently set to 0-second cooldown, effectively disabled).

Parameters

Name Type Location Required Description
Value1 array body Yes First list of strings.
Value2 array body Yes Second list of strings.

Request Examples

Compare lists application/json
{"Value1":["admin","mod","user"],"Value2":["mod","vip","user"]}

Responses

200 Common values.
{"commonValues":["mod","user"],"isCommonFound":true}

Use Cases

  • Finding common roles between two Discord users to determine shared access levels
  • Comparing a user's role list against a set of required roles to check eligibility for an action

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Cards

4 endpoints

Endpoints for generating customizable Discord-style image cards (level cards, welcome cards).

GET /api/LevelCard/generate

Generates a fully customizable Discord-style level/rank card image and uploads it to S3.

All configuration is passed via HTTP Headers. Renders a rank card using SkiaSharp with support for username, avatar, level, XP (with automatic percentage calculation), rank position, voice time, message count, activity count, custom background (image or solid color with opacity/blur), gradient progress bar, custom colors for all elements, font selection, and precise X/Y offset positioning for every component. Uploads the generated PNG to S3 and returns both a direct view URL and Base64 image data. Avatar URLs must be from allowed domains.

Prerequisites

  • Avatar URL must be from an allowed domain (cdn.discordapp.com, imgur, imgbb, etc.)
  • Background URL (if used) must also be from an allowed domain

Required Headers

Name Description Required Example
Username Display name of the user. Yes JohnDoe
Avatar-Url HTTPS link to user avatar. Yes https://cdn.discordapp.com/avatars/...
Level Current level number. No 15
Xp-Current Current XP. No 2500
Xp-Total XP for next level. No 5000
Rank Rank position. No #3
Voice-Time Voice time in minutes. No 120
Message-Count Messages sent. No 1500
Background-Url Custom background image URL. No
Background-Color Hex fallback color. No #2f3136
Username-Color Username text color. No #FFFFFF
Level-Color Level label color. No #7289da
Progress-Bar-Start-Color Gradient start. No #5865f2
Progress-Bar-End-Color Gradient end. No #7289da
Card-Width Width in pixels. No 800
Card-Height Height in pixels. No 200
Typography-Family Font family. No Arial

Responses

200 Card generated.
{"success":true,"directImageUrl":"https://api.noctra.xyz/api/LevelCard/view/abc-123","imageSize":45000,"username":"JohnDoe","levelPercent":50.0}
400 Missing required headers.
{"success":false,"message":"Required headers missing","required":["Username","Avatar-Url"]}

Use Cases

  • Generating a custom rank card for a Discord bot's /rank command that displays user level, XP, and stats
  • Creating personalized level-up announcement images with custom colors and backgrounds
  • Building a leaderboard system that generates visual rank cards for top users

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/WelcomeCard/generate

Generates a fully customizable Discord-style welcome card and uploads it to S3.

All configuration is passed via HTTP Headers. Renders a welcome card image using SkiaSharp with support for custom background images, user avatars (circle or rounded rect), greeting text, guild name, member count, full color customization, font selection, and precise X/Y positioning of all elements. Emojis are automatically stripped from text fields. Supports Base64 or double URL-encoding for special characters in headers. Uploads the generated PNG to S3 and returns a direct view URL.

Prerequisites

  • Background and avatar image URLs must be from allowed domains (cdn.discordapp.com, imgur, imgbb, etc.)
  • S3-compatible object storage configured on the server

Required Headers

Name Description Required Example
Background-Image HTTPS URL of background image. Yes https://cdn.discordapp.com/...
Profile-Avatar HTTPS URL of user avatar. Yes https://cdn.discordapp.com/avatars/...
Display-Name User display name. No JohnDoe
Guild-Name Server name. No My Server
Greeting-Text Main greeting. No Welcome
Member-Count Member count text. No Member #123
Primary-Text-Color Greeting color. No #FFFFFF
Secondary-Text-Color Username color. No #64C8FF
Canvas-Width Card width. No 1024
Canvas-Height Card height. No 400
Typography-Family Font family. No Segoe-UI

Responses

200 Card generated.
{"success":true,"directImageUrl":"https://api.noctra.xyz/api/WelcomeCard/view/abc-123","imageSize":85000}
400 Missing headers.
{"success":false,"message":"Required headers missing: Background-Image and Profile-Avatar"}

Use Cases

  • Generating a personalized welcome image when a new member joins a Discord server
  • Creating custom member join announcements with server branding and member count
  • Building a welcome card preview system in a dashboard where admins can customize colors and layout

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/WelcomeCard/fonts

Retrieves the list of available font families for card generation.

Returns a JSON list of all supported font keys and their display names that can be used in the Typography-Family header for both welcome cards and level cards. Includes system fonts like Arial, Verdana, Georgia, Segoe UI, and others.

Responses

200 Font list.
{"success":true,"fonts":[{"key":"Arial","displayName":"Arial"}]}

Use Cases

  • Populating a font selector dropdown in a card customization UI
  • Validating font family names before sending card generation requests

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/WelcomeCard/encoding-guide

Provides text encoding and emoji handling documentation for card generation.

Returns the encoding guide including API version, supported encoding methods (Base64 recommended, double URL-encoding as fallback), allowed image domains, and a note that emojis are automatically stripped from all text fields. Useful for understanding how to properly encode special characters in HTTP headers.

Responses

200 Encoding guide.
{"version":"8.0.0-S3","system":"Smart Auto-Detect Encoding","allowedDomains":["cdn.discordapp.com"]}

Use Cases

  • Understanding how to encode non-ASCII characters (e.g., Japanese, Arabic) in HTTP headers for card generation
  • Checking which image hosting domains are whitelisted for background and avatar URLs

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Social Media

4 endpoints

Endpoints for checking live streaming status across YouTube, Twitch, and TikTok.

POST /api/Stream/check-all

Checks live streaming status across YouTube, Twitch, and TikTok simultaneously.

Performs parallel live status checks across all specified platforms. Platforms with empty handles or the literal value 'none' are skipped and excluded from the response. YouTube uses the Data API v3 (100 quota units per check, cached 15 minutes). Twitch uses Client Credentials OAuth flow (token cached until expiry). TikTok uses a static availability check with no API key required. API keys can be provided via headers or server configuration (config takes priority).

Prerequisites

  • YouTube API Key for YT checks
  • Twitch credentials for Twitch checks

Required Headers

Name Description Required Example
X-YouTube-ApiKey YouTube API Key (if not in server config). No
X-Twitch-ClientId Twitch Client ID. No
X-Twitch-Secret Twitch Client Secret. No

Parameters

Name Type Location Required Description
youtubeHandle string body No YouTube handle (e.g. @PewDiePie). Use empty or none to skip.
twitchUser string body No Twitch username. Use empty or none to skip.
tikTokUser string body No TikTok username. Use empty or none to skip.

Request Examples

Check all application/json
{"youtubeHandle":"@MrBeast","twitchUser":"xqc","tikTokUser":"khaby.lame"}

Responses

200 Status results.
[{"platform":"YouTube","user":"@MrBeast","isLive":false},{"platform":"Twitch","user":"xqc","isLive":true,"title":"Stream Title","viewerCount":50000}]

Use Cases

  • Live notification systems
  • Stream status dashboards

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/Stream/youtube/{handle}

Checks if a YouTube channel is currently live streaming.

Resolves a YouTube handle to a channel ID (1 quota unit, cached 30 days), then checks for active live streams via search.list (100 quota units, cached 15 minutes). Returns live status, stream title, and direct URL. Pass 'none' as the handle to skip without making any API call. API key can be provided via header or server configuration.

Prerequisites

  • YouTube API Key

Required Headers

Name Description Required Example
X-YouTube-ApiKey YouTube Data API v3 Key. No

Parameters

Name Type Location Required Description
handle string path Yes YouTube handle.

Responses

200 YouTube status.
{"platform":"YouTube","user":"@MrBeast","isLive":false,"url":"https://youtube.com/@MrBeast"}

Use Cases

  • Sending a Discord notification when a specific YouTuber goes live
  • Displaying live status indicators in a streamer dashboard or bot command

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/Stream/twitch/{user}

Checks if a Twitch channel is currently live streaming.

Automatically obtains an App Access Token using the Client Credentials OAuth flow (credentials sent via POST body, not URL). The token is cached server-side using the actual expires_in value from Twitch (minus 5-minute buffer). Checks the Helix streams endpoint for the specified user. Returns live status, stream title, viewer count, and channel URL. Results cached for 60 seconds.

Prerequisites

  • Twitch Client ID and Secret

Required Headers

Name Description Required Example
X-Twitch-ClientId Twitch Client ID. No
X-Twitch-Secret Twitch Client Secret. No

Parameters

Name Type Location Required Description
user string path Yes Twitch username.

Responses

200 Twitch status.
{"platform":"Twitch","user":"xqc","isLive":true,"title":"Gaming","viewerCount":50000}

Use Cases

  • Sending a Discord notification when a Twitch streamer goes live with viewer count
  • Building a multi-platform live status dashboard that shows which streamers are currently broadcasting

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/Stream/tiktok/{user}

Checks if a TikTok user is currently live streaming.

Uses TikTokLiveClient.GetUserStreaming() for a lightweight static availability check — no API key required and no WebSocket overhead. Results are cached for 2 minutes. Pass 'none' as the username to skip without making any check. Returns live status and direct link to the user's live page.

Parameters

Name Type Location Required Description
user string path Yes TikTok username (without @).

Responses

200 TikTok status.
{"platform":"TikTok","user":"khaby.lame","isLive":false,"url":"https://www.tiktok.com/@khaby.lame/live"}

Use Cases

  • Sending a Discord notification when a TikTok creator starts a live stream
  • Monitoring TikTok live status without needing API credentials

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.

Bot

4 endpoints

Endpoints for bot management including backups and server restore.

POST /api/Backup

Creates a new server backup or updates an existing one. (Premium)

Fetches all relevant Discord server data (roles, channels, AutoMod rules, onboarding config, bans) via Discord API v10 and stores it as a JSON file in S3. Uses a stateless, secure architecture with HMAC-SHA256 signatures embedded in S3 filenames for ownership verification. If X-Auth-Key matches an existing backup, the file is updated in-place; otherwise a new backup is created with fresh credentials. Enforces a one-backup-per-guild rule. Maximum backup size: 100 MB. Premium-only feature.

Prerequisites

  • Premium subscription for the guild
  • Bot with Administrator permission (or specific read permissions for all data types)

Required Headers

Name Description Required Example
X-Bot-Token Discord Bot Token with read permissions. Yes TOKEN
X-Guild-Id Guild ID to backup. Yes 123456789012345678
X-Auth-Key Existing auth key for updates. No
X-Filename Custom filename hint. No my-backup

Responses

200 Backup created/updated.
{"status":"New backup created successfully","viewId":"123-abc","authKey":"base64key","fileSize":"2.5 MB"}
403 Not premium.
{"error":"Backups are a premium feature."}
413 Too large.
{"error":"Backup too large (> 100 MB)"}

Use Cases

  • Creating a full server backup before making major structural changes (role reorganization, channel cleanup)
  • Scheduled automated backups for disaster recovery with the auth key stored securely for future updates
  • Migrating server configuration to a new server by backing up and restoring

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
GET /api/Backup/view/{viewId}

Downloads a backup file as a JSON attachment. (Premium)

Retrieves the raw JSON backup file from S3 as a downloadable attachment. The auth key is verified using timing-safe HMAC comparison against the key embedded in the S3 filename. Returns Content-Disposition: attachment header for browser download.

Prerequisites

  • Premium subscription required
  • Valid auth key

Required Headers

Name Description Required Example
X-Auth-Key Secret auth key. Yes base64key

Parameters

Name Type Location Required Description
viewId string path Yes Backup view ID.

Responses

200 JSON file stream.
404 Not found or invalid key.
{"error":"Backup not found or invalid key"}

Use Cases

  • Downloading a backup file for offline storage or manual inspection of server configuration
  • Exporting server structure data for documentation or migration planning

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
DELETE /api/Backup/{viewId}

Permanently deletes a backup from S3 storage. (Premium)

Permanently removes the backup JSON file from S3 after verifying the auth key via timing-safe HMAC comparison. This action is irreversible — the backup data cannot be recovered after deletion.

Prerequisites

  • Premium subscription required
  • Valid auth key

Required Headers

Name Description Required Example
X-Auth-Key Secret auth key. Yes base64key

Parameters

Name Type Location Required Description
viewId string path Yes Backup view ID.

Responses

200 Deleted.
{"status":"Deleted"}

Use Cases

  • Removing outdated backups to free storage space
  • Deleting a backup after a successful restore to prevent stale data from being accidentally restored later

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.
POST /api/Backup/restore/{viewId}

⚠️ DESTRUCTIVE: Restores a Discord server from a backup. (Premium)

WARNING: This action deletes existing roles, channels, and AutoMod rules before recreating them from the backup data. The restore process tracks old IDs vs. new IDs in memory to correctly map permissions, channels, and roles during recreation. Safety measures: requires ?force=true query parameter to execute, enforces a 5-minute cooldown per guild ID, and requires both a valid auth key and a bot token with Administrator permissions. The restore sequence runs: Roles → Channels → AutoMod → Onboarding, with each step reported independently. Premium-only feature.

Prerequisites

  • Premium subscription for the guild
  • Bot with Administrator permission
  • ?force=true query parameter to confirm destructive action
  • 5-minute cooldown between restore attempts for the same guild

Required Headers

Name Description Required Example
X-Auth-Key Secret auth key. Yes base64key
X-Bot-Token Bot token with Administrator. Yes TOKEN

Parameters

Name Type Location Required Description
viewId string path Yes Backup view ID.
force boolean query Yes Must be true to confirm.

Responses

200 Restore complete.
{"status":"Restore sequence finished","report":["Roles restored","Channels restored"]}
400 Missing force=true.
{"error":"Append ?force=true to confirm."}
429 Cooldown active.
{"error":"Cooldown active.","retryAfterSeconds":180}

Use Cases

  • Restoring a server to a known-good state after accidental mass-deletion of channels or roles
  • Migrating a server's complete structure (roles, channels, permissions) to a new guild using backup/restore
  • Disaster recovery after a compromised admin account deleted server infrastructure

Related Endpoints

Try It

Requests are sent directly from your browser to the API. Tokens and headers are never logged or stored on our servers.