This API allows users to manage their two-factor authentication (2FA) settings.
This endpoint handles the generation, verification, and disabling of 2FA for users.
{
"action": "string", // Can be "generate", "verify", or "disable"
"otp": "string" // Required for "verify" and "disable" actions
}
generate: Generates a new 2FA secret and QR code.verify: Verifies the provided OTP against the stored secret.disable: Disables 2FA for the user.
HTTP 200 OK
{
"qrCode": "string", // Base64 encoded QR code for "generate" action
"setupKey": "string" // The generated secret key for "generate" action
}
HTTP 200 OK
{
"success": true // Indicates successful verification or disabling of 2FA
}
HTTP 400 Bad Request
{
"error": "No secret found" // Returned if no secret exists for the user
}
HTTP 400 Bad Request
{
"error": "Invalid OTP" // Returned if the provided OTP is invalid
}
HTTP 400 Bad Request
{
"error": "Unknown action" // Returned if the action is not recognized
}
HTTP 500 Internal Server Error
{
"error": "Internal Server Error" // Returned for unexpected errors
}
POST /api/2FA
{
"action": "generate"
}
POST /api/2FA
{
"action": "verify",
"otp": "123456" // Replace with actual OTP
}
POST /api/2FA
{
"action": "disable",
"otp": "123456" // Replace with actual OTP
}
This API provides endpoints for managing server categories.
Fetches all server categories along with their associated servers.
{
"id": number,
"name": string,
"servers": [
{
"server_id": number,
"server_name": string,
"order": number,
"categoryId": number,
"image_path": string
}
]
}
GET /api/categories HTTP/1.1
Host: your-domain.com
Creates a new server category.
{
"name": "New Category",
"order": 1
}
{
"success": true,
"category": {
"id": number,
"name": string,
"order": number
}
}
{
"error": "Unauthorized"
}
POST /api/categories HTTP/1.1
Host: your-domain.com
Content-Type: application/json
{
"name": "New Category",
"order": 1
}
Updates an existing server category.
{
"id": 1,
"name": "Updated Category",
"botToken": "optional-bot-token"
}
{
"success": true,
"category": {
"id": number,
"name": string,
"botToken": string
}
}
{
"error": "Unauthorized"
}
{
"error": "Category name is required"
}
PUT /api/categories HTTP/1.1
Host: your-domain.com
Content-Type: application/json
{
"id": 1,
"name": "Updated Category"
}
All endpoints require authentication. The user must have the servers.manage permission to create or update categories.
This endpoint allows authorized users to reorder server categories.
Method: POST
URL: /api/servers/reorder
{
"newOrder": [
{
"id": 1,
"order": 2
},
{
"id": 2,
"order": 1
}
]
}
The newOrder array contains objects with the id of the category and its new order.
HTTP/1.1 200 OK
{
"success": true
}
{
"error": "Unauthorized"
}
Returned when the user is not authenticated or does not have the required permissions.
{
"error": "Failed to reorder categories"
}
Returned when there is an error processing the request.
POST /api/servers/reorder
Content-Type: application/json
Authorization: Bearer {token}
{
"newOrder": [
{
"id": 1,
"order": 2
},
{
"id": 2,
"order": 1
}
]
}
HTTP/1.1 200 OK
{
"success": true
}
HTTP/1.1 401 Unauthorized
{
"error": "Unauthorized"
}
This endpoint allows you to delete a server category by its ID.
DELETE
| Parameter | Description | Type | Required |
|---|---|---|---|
| id | The unique identifier of the server category to delete. | string | Yes |
DELETE /api/server-category/1
HTTP Status: 200 OK
{
"success": true
}
HTTP Status: 401 Unauthorized
{
"error": "Unauthorized"
}
This error occurs if the user is not authenticated or lacks the necessary permissions to manage server categories.
HTTP Status: 500 Internal Server Error
{
"error": "Failed to delete category"
}
This error indicates that an unexpected error occurred while attempting to delete the category.
servers.manage permission to access this endpoint.This endpoint allows you to create or update clans and their members in the database.
Requires a Bearer token in the Authorization header.
{
"clanId": {
"ClanID": "string",
"ClanName": "string | null",
"Members": {
"playerId": {
"PlayerID": "string",
"PlayerName": "string",
"CollectedDogTags": "number"
}
}
}
}
{
"success": true,
"data": "array of created/updated clans and members"
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Invalid request body"
}
{
"success": false,
"error": "Internal Server Error"
}
This endpoint retrieves a list of all clans in the database, ordered by the total collected dog tags.
{
"data": [
{
"ClanID": "string",
"ClanName": "string | null",
"totalCollectedDogTags": "number"
}
]
}
{
"success": false,
"error": "Internal Server Error"
}
| Status Code | Description |
|---|---|
| 401 | Unauthorized access due to missing or invalid token. |
| 400 | Invalid request body format. |
| 500 | Internal server error, something went wrong on the server side. |
This API allows you to manage Discord guilds in your application.
Retrieves a list of all Discord guilds.
{
"guilds": [
{
"id": "string",
"name": "string"
},
...
]
}
GET /api/guilds
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": "123",
"name": "Example Guild"
}
]
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "Internal Server Error"
}
Creates a new Discord guild.
{
"id": "string", // Required: Unique identifier for the guild
"name": "string" // Required: Name of the guild
}
{
"success": true
}
POST /api/guilds
Content-Type: application/json
{
"id": "123",
"name": "New Guild"
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"success": true
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "Missing required fields"
}
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "Internal Server Error"
}
Deletes a Discord guild by its ID.
id: string // Required: Unique identifier of the guild to be deleted
{
"message": "Discord guild deleted successfully"
}
DELETE /api/guilds?id=123
HTTP/1.1 200 OK
Content-Type: application/json
{
"message": "Discord guild deleted successfully"
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "Missing guild ID"
}
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "Internal Server Error"
}
This API allows you to fetch roles for a specific Discord guild.
Retrieve all roles for a specified Discord guild.
GET /api/guilds?guildId=123456789012345678
On success, the API returns a JSON object containing the guild ID and an array of roles.
{
"guildId": "123456789012345678",
"roles": [
{ "id": "987654321098765432", "name": "Admin" },
{ "id": "876543210987654321", "name": "Moderator" }
]
}
{
"error": "Missing guild ID"
}
{
"error": "Internal Server Error"
}
This endpoint requires authentication via a Discord Bot Token. Ensure that the token is included in the environment variables as DISCORD_BOT_TOKEN.
Roles returned will exclude the default '@everyone' role.
Fetches a list of all giveaways.
Creates a new giveaway.
No parameters required.
On success, returns a JSON array of giveaways:
{
"id": 1,
"title": "Sample Giveaway",
"description": "Win amazing prizes!",
"headerImage": "http://example.com/image.png",
"enabled": true,
"startDate": "2023-10-01T00:00:00Z",
"endDate": "2023-10-31T23:59:59Z",
"giveawayOptions": [
{
"id": 1,
"prize": "Gift Card",
"entries": []
}
]
}
{
"title": "Sample Giveaway",
"description": "Win a fantastic prize!",
"headerImage": "http://example.com/image.png",
"enabled": true,
"startDate": "2023-10-01T00:00:00Z",
"endDate": "2023-10-31T23:59:59Z",
"giveawayOptions": [
{
"prize": "Gift Card"
}
]
}
On success, returns the created giveaway object:
{
"id": 2,
"title": "Sample Giveaway",
"description": "Win a fantastic prize!",
"headerImage": "http://example.com/image.png",
"enabled": true,
"startDate": "2023-10-01T00:00:00Z",
"endDate": "2023-10-31T23:59:59Z",
"giveawayOptions": [
{
"id": 1,
"prize": "Gift Card"
}
]
}
When validation fails, the API returns an array of error messages. Example:
[
{
"message": "Title is required",
"path": ["title"]
},
{
"message": "At least one giveaway option is required",
"path": ["giveawayOptions"]
}
]
The POST /api/giveaways endpoint requires the user to have the giveaways.manage permission.
This API endpoint allows users to enter a giveaway by submitting a giveaway ID.
Enter a giveaway by providing the giveaway ID in the request body.
POST /api/admin/giveaways/enter
Content-Type: application/json
{
"giveawayId": "string" // The ID of the giveaway to enter
}
This endpoint requires the user to be authenticated. If the user is not logged in, the API will return a 401 Unauthorized status.
Status: 200 OK
{
"message": "Successfully entered the giveaway!"
}
{
"message": "Giveaway ID is required."
}
{
"message": "Giveaway is not active."
}
{
"message": "You have already entered this giveaway."
}
{
"message": "No giveaway options available."
}
{
"message": "Giveaway not found."
}
{
"message": "Unauthorized. Please log in."
}
{
"message": "Internal server error."
}
POST /api/admin/giveaways/enter
Content-Type: application/json
{
"giveawayId": "12345"
}
Status: 200 OK
{
"message": "Successfully entered the giveaway!"
}
Status: 404 Not Found
{
"message": "Giveaway not found."
}
This API endpoint allows you to pick winners for a giveaway based on the provided giveaway ID.
POST /api/pick-winners
This endpoint requires Bearer Token authentication. Include the token in the Authorization header of your request.
Authorization: Bearer <API_BEARER_TOKEN>
The request body must be in JSON format and include the following parameter:
{
"giveawayId": "12345"
}
{
"winners": ["winner1", "winner2"]
}
{
"message": "Winners have already been picked or giveaway not ended yet."
}
{
"error": "Unauthorized: Invalid or missing Authorization header"
}
{
"error": "Bad Request: giveawayId is required"
}
{
"error": "An unexpected error occurred"
}
| HTTP Status Code | Description |
|---|---|
| 200 | Winners have already been picked or giveaway not ended yet. |
| 201 | Winners successfully picked. |
| 400 | Bad Request: giveawayId is required. |
| 401 | Unauthorized: Invalid or missing Authorization header. |
| 500 | An unexpected error occurred. |
Manage giveaways with ease using our comprehensive API.
Fetch a specific giveaway by its ID.
GET /api/admin/giveaways/123e4567-e89b-12d3-a456-426614174000
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Summer Giveaway",
"description": "Win exciting prizes!",
"headerImage": "http://example.com/image.png",
"enabled": true,
"startDate": "2023-06-01T00:00:00Z",
"endDate": "2023-06-30T23:59:59Z",
"giveawayOptions": [...],
"winnerIds": ["user1", "user2"]
}
Update an existing giveaway.
{
"title": "Updated Title",
"description": "Updated description.",
"headerImage": "http://example.com/new-image.png",
"enabled": true,
"startDate": "2023-07-01T00:00:00Z",
"endDate": "2023-07-31T23:59:59Z",
"giveawayOptions": [
{"id": "existing-option-id", "prize": "New Prize"},
{"prize": "Another New Prize"}
]
}
Delete a specific giveaway by its ID.
DELETE /api/admin/giveaways/123e4567-e89b-12d3-a456-426614174000
{
"message": "Giveaway deleted successfully"
}
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
| action | string | The action to filter logs by. | No | N/A |
| userId | string | The ID of the user associated with the logs. | No | N/A |
| targetId | string | The ID of the target associated with the logs. | No | N/A |
| roleId | string | The ID of the role associated with the logs. | No | N/A |
| serverId | string | The ID of the server associated with the logs. | No | N/A |
| startDate | string | number | The starting date or timestamp for filtering logs. | No | N/A |
| endDate | string | number | The ending date or timestamp for filtering logs. | No | N/A |
| page | string | The page number for pagination. | No | 1 |
| limit | string | The number of logs to return per page. | No | 10 |
| minimize | enum | Whether to return minimized log details. | No | N/A |
| type | enum | The type of log to filter by (oxide or discord). | No | N/A |
HTTP/1.1 200 OK
Content-Type: application/json
{
"logs": [
{
"action": "string",
"timestamp": "string",
"details": { ... }
}
],
"pagination": {
"currentPage": 1,
"totalPages": 10,
"totalItems": 100
}
}
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "startDate is required when minimize is true"
}
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "Internal Server Error"
}
This API allows for the creation, retrieval, and updating of map votes for servers.
Creates a new map vote.
{
"server": "string", // Required: Server ID
"vote_start": "string", // Required: Start date in ISO 8601 format
"vote_end": "string", // Required: End date in ISO 8601 format
"map_start": "string", // Required: Date when the map starts in ISO 8601 format
"map_options": [
{
"value": "string" // Required: Map option value
},
...
] // At least two map options required
}
POST /api/map-vote
{
"server": "12345",
"vote_start": "2023-10-01T10:00:00Z",
"vote_end": "2023-10-02T10:00:00Z",
"map_start": "2023-10-01T10:00:00Z",
"map_options": [
{"value": "https://rustmaps.com/map1"},
{"value": "https://rustmaps.com/map2"}
]
}
Retrieves map votes based on query parameters.
GET /api/map-vote?serverId=12345&status=active
Updates an existing map vote.
{
"id": "string", // Required: Map vote ID
"server": "string", // Required: Server ID
"vote_start": "string", // Required: Start date in ISO 8601 format
"vote_end": "string", // Required: End date in ISO 8601 format
"map_start": "string", // Required: Date when the map starts in ISO 8601 format
"enabled": true, // Required: Status of the map vote
"map_options": [
{
"value": "string" // Required: Map option value
},
...
] // At least two map options required
}
This API allows you to manage navigation items for your application.
Retrieve a list of navigation items.
[
{
"label": "Home",
"url": "/home",
"order": 1
},
{
"label": "About",
"url": "/about",
"order": 2
}
]
Create a new navigation item.
{
"label": "Contact",
"url": "/contact",
"order": 3
}
{
"label": "Contact",
"url": "/contact",
"order": 3,
"id": "abc123"
}
Update an existing navigation item.
{
"id": "abc123",
"label": "Updated Contact",
"url": "/contact-updated",
"order": 4
}
{
"id": "abc123",
"label": "Updated Contact",
"url": "/contact-updated",
"order": 4
}
Delete a navigation item.
{
"id": "abc123"
}
{
"success": true
}
The following schema is used to validate the request body for POST and PUT requests:
{
"label": "string (min 1 character)",
"url": "string",
"order": "integer (min 0)"
}
This API allows admins to manage notes associated with users.
Fetches the notes associated with a user by their ID.
{
"id": "string",
"roles": [
{
"id": "string",
"name": "string",
"order": 1
}
],
"Note": [
{
"id": "string",
"content": "string",
"role": {
"id": "string",
"name": "string",
"order": 1
},
"creator": {
"id": "string",
"name": "string"
}
}
]
}
GET /api/admin/notes/12345
{
"id": "12345",
"roles": [
{
"id": "admin",
"name": "Administrator",
"order": 1
}
],
"Note": [
{
"id": "note1",
"content": "This is a note.",
"role": {
"id": "role1",
"name": "Editor",
"order": 2
},
"creator": {
"id": "creator1",
"name": "John Doe"
}
}
]
}
Creates a new note for a user by their ID.
{
"content": "string",
"roleId": "string"
}
{
"id": "string",
"content": "string",
"role": {
"id": "string",
"name": "string",
"order": 1
},
"creator": {
"id": "string",
"name": "string"
}
}
POST /api/admin/notes/12345
This documentation provides details about the API endpoints related to page metadata management.
Fetches a list of page metadata slugs.
GET
This endpoint requires user authentication. The user must have the seo.manage permission.
{
"slug": "example-page-1"
},
{
"slug": "example-page-2"
}
Status: 200 OK
{
"error": "Unauthorized"
}
Status: 401 Unauthorized
{
"error": "Internal Server Error"
}
Status: 500 Internal Server Error
Creates a new page metadata entry.
POST
The request should contain a JSON object with the page metadata details. Example:
{
"slug": "new-page"
}
This endpoint requires user authentication. The user must have the seo.manage permission.
{
"slug": "new-page",
"createdAt": "2023-10-01T00:00:00.000Z",
"updatedAt": "2023-10-01T00:00:00.000Z"
}
Status: 201 Created
{
"error": "Unauthorized"
}
Status: 401 Unauthorized
{
"error": "Internal Server Error"
}
Status: 500 Internal Server Error
This API allows for the management of page metadata. Below are the available endpoints.
Fetches the metadata for a specific page identified by the slug.
{
"slug": "example-page",
"title": "Example Page",
"description": "This is an example page."
}
{
"error": "Unauthorized"
}
{
"error": "Page not found"
}
{
"error": "Internal Server Error"
}
Updates the metadata for a specific page identified by the slug.
{
"title": "Updated Page Title",
"description": "Updated description for the page."
}
{
"slug": "example-page",
"title": "Updated Page Title",
"description": "Updated description for the page."
}
{
"error": "Unauthorized"
}
{
"error": "Internal Server Error"
}
Deletes the metadata for a specific page identified by the slug.
No content returned on successful deletion.
{
"error": "Unauthorized"
}
{
"error": "Internal Server Error"
}
This API allows for the management of URL redirects. It supports creating, updating, retrieving, and deleting redirects.
Retrieves a list of all redirects.
{
"source": "string",
"destination": "string",
"permanent": boolean,
"createdAt": "string"
}
GET /api/redirects
Creates a new redirect or updates an existing one.
{
"source": "string",
"destination": "string",
"permanent": boolean
}
{
"source": "string",
"destination": "string",
"permanent": boolean,
"createdAt": "string"
}
PUT /api/redirects
Request Body:
{
"source": "/old-path",
"destination": "/new-path",
"permanent": true
}
Deletes a redirect by ID.
{
"success": true
}
DELETE /api/redirects?id=1
This API requires authentication. Ensure that the user has the settings.manage permission to perform any operations.
This API endpoint allows you to retrieve role information from the database.
Fetches a list of roles based on optional query parameters.
| Parameter | Type | Description |
|---|---|---|
| serverId | string | Filters roles by server ID. If provided, it also includes global roles. |
| discordId | string | Filters roles by Discord ID, returning roles associated with the specified Discord guild. |
{
"roles": [
{
"id": "roleId",
"name": "Role Name",
"color": "#FFFFFF",
"order": 1,
"serverId": "serverId",
"oxideGroupName": "Oxide Group Name",
"assignOnBoost": true,
"assignOnVerification": false,
"assignOnGroupJoin": true,
"discordAssociations": [
{
"discordGuild": "discordGuildId",
"discordRole": "discordRoleId"
}
]
}
]
}
{
"error": "Internal Server Error"
}
| Status Code | Description |
|---|---|
| 500 | An internal server error occurred while processing the request. |
GET /api/roles?serverId=myServerId
{
"roles": [
{
"id": "1",
"name": "Admin",
"color": "#FF0000",
"order": 1,
"serverId": "myServerId",
"oxideGroupName": "Admin Group",
"assignOnBoost": true,
"assignOnVerification": false,
"assignOnGroupJoin": true,
"discordAssociations": [
{
"discordGuild": "123456789",
"discordRole": "987654321"
}
]
}
]
}
This endpoint allows authorized users to reorder roles based on the provided order data.
This endpoint accepts a JSON payload with the new order of roles.
{
"newOrder": [
{
"id": "roleId1",
"order": 1
},
{
"id": "roleId2",
"order": 2
}
]
}
On successful reordering of roles, the API will respond with:
HTTP/1.1 200 OK
{
"success": true
}
{
"error": "Unauthorized"
}
{
"error": "Invalid data format"
}
{
"error": "Failed to reorder roles"
}
Users must have the settings.roles.manage permission to access this endpoint.
fetch('/api/roles/reorder', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
newOrder: [
{ id: "roleId1", order: 1 },
{ id: "roleId2", order: 2 }
]
})
})
.then(response => response.json())
.then(data => console.log(data));
This API allows you to manage roles including retrieval, updating, and deletion of roles.
Retrieve a role by ID or oxide group name.
GET /api/roles/123
{
"role": {
"id": "123",
"name": "Admin",
"serverId": "server_1",
"color": "#FF0000",
"oxideGroupName": "oxide_admin",
"assignOnVerification": true,
"assignOnBoost": false,
"assignOnGroupJoin": true,
"discordAssociations": [
{
"discordGuild": "guild_1",
"discordRole": "role_1"
}
]
}
}
Update an existing role.
{
"name": "New Role Name",
"serverId": "new_server_id",
"color": "#00FF00",
"oxideGroupName": "new_oxide_group",
"assignOnVerification": false,
"assignOnBoost": true,
"assignOnGroupJoin": false,
"discordAssociations": [
{
"discordGuild": "new_guild",
"discordRole": "new_role"
}
]
}
PUT /api/roles/123
{
"role": {
"id": "123",
"name": "Updated Role",
"serverId": "server_1",
"color": "#00FF00",
"oxideGroupName": "oxide_updated",
"assignOnVerification": false,
"assignOnBoost": true,
"assignOnGroupJoin": false,
"discordAssociations": [
{
"discordGuild": "new_guild",
"discordRole": "new_role"
}
]
}
}
Delete a role by ID or oxide group name.
DELETE /api/roles/123
This API allows for the management of servers including creation, updating, and deletion.
Create a new server.
{
"id": "string", // Unique identifier for the server
"name": "string", // Name of the server
"order": "integer", // Order of the server
"image_path": "string", // Path to the server image
"server_address": "string", // Address of the server
"discordBotToken": "string", // Discord bot token (optional)
"categoryId": "string" // ID of the category to connect
}
POST /api/servers
{
"id": "srv123",
"name": "My Server",
"order": 1,
"image_path": "/images/server.png",
"server_address": "192.168.1.1",
"discordBotToken": "xyz123",
"categoryId": "cat456"
}
Update an existing server.
{
"oldServerId": "string", // The ID of the server to update
"serverId": "string", // New unique identifier for the server
"name": "string", // Updated name of the server
"imagePath": "string", // Updated path to the server image
"serverAddress": "string", // Updated address of the server
"enabled": "boolean", // Whether the server is enabled
"discordBotToken": "string" // Updated Discord bot token (optional)
}
PUT /api/servers
{
"oldServerId": "srv123",
"serverId": "srv123-updated",
"name": "My Updated Server",
"imagePath": "/images/server-updated.png",
"serverAddress": "192.168.1.2",
"enabled": true,
"discordBotToken": "xyz456"
}
Delete a server.
id=string // The ID of the server to delete
DELETE /api/servers?id=srv123
This endpoint allows authorized users to reorder servers within a specific category.
POST /api/servers/reorder
POST
| Parameter | Type | Description | Required |
|---|---|---|---|
categoryId |
String | The ID of the category the servers belong to. | Yes |
serverIds |
Array of Strings | An array of server IDs in the order they should be arranged. | Yes |
{
"categoryId": "123456",
"serverIds": ["server1", "server2", "server3"]
}
On success, the API will return a JSON object indicating the operation was successful.
HTTP/1.1 200 OK
{
"success": true
}
If the user is not authenticated or does not have the required permissions.
HTTP/1.1 401 Unauthorized
{
"error": "Unauthorized"
}
If an error occurs during the processing of the request.
HTTP/1.1 500 Internal Server Error
{
"error": "Failed to reorder servers"
}
Ensure that the user has the servers.manage permission to access this endpoint.
Manage Discord integration settings for your application.
Method: GET
Description: Retrieves the current Discord integration settings.
This endpoint requires the user to be authenticated and have the settings.manage permission.
{
"id": 1,
"guildId": "123456789012345678",
"webhookUrl": "https://discord.com/api/webhooks/.../... ",
"verificationHookColor": "#00FF00",
"verificationHookEnabled": true,
"ticketHookUrl": "https://discord.com/api/webhooks/.../... ",
"ticketHookColor": "#FF0000",
"ticketHookEnabled": false
}
{
"error": "Discord integration settings not found"
}
{
"error": "Unauthorized"
}
{
"error": "Failed to fetch Discord integration settings"
}
Method: PUT
Description: Updates the Discord integration settings.
This endpoint requires the user to be authenticated and have the settings.manage permission.
{
"guildId": "123456789012345678",
"webhookUrl": "https://discord.com/api/webhooks/.../... ",
"verificationHookColor": "#00FF00",
"verificationHookEnabled": true,
"ticketHookUrl": "https://discord.com/api/webhooks/.../... ",
"ticketHookColor": "#FF0000",
"ticketHookEnabled": false
}
{
"success": true
}
{
"error": "Unauthorized"
}
{
"error": "Failed to update Discord integration settings"
}
This API provides endpoints to manage site metadata. It supports both retrieval and updating of metadata, with built-in authorization checks.
Retrieve the current site metadata.
GET
Requires the user to have the role seo.manage.
{
"id": 1,
"title": "My Website",
"description": "This is my personal website.",
"keywords": "personal, blog, portfolio"
}
Update the site metadata.
POST
Requires the user to have the role seo.manage.
The request body must be a JSON object containing the metadata fields to update.
{
"title": "Updated Website Title",
"description": "Updated description of my website.",
"keywords": "updated, keywords, for, seo"
}
{
"id": 1,
"title": "Updated Website Title",
"description": "Updated description of my website.",
"keywords": "updated, keywords, for, seo"
}
This endpoint allows you to update the permissions of a specific role in the system.
PUT /api/roles/update
PUT
This endpoint requires authentication. Users must have the settings.roles.manage permission to access this endpoint.
{
"roleId": "string", // The ID of the role to be updated
"permissions": [ // An array of permissions to be assigned to the role
"string"
]
}
On a successful update, the response will contain the updated role object.
HTTP/1.1 200 OK
{
"id": "string", // The ID of the role
"permissions": "string" // The updated permissions as a comma-separated string
}
HTTP/1.1 401 Unauthorized
{
"error": "Unauthorized"
}
Returned when the user is not authenticated or does not have the required permissions.
HTTP/1.1 400 Bad Request
{
"error": "Missing required fields"
}
Returned when the request is missing required fields such as roleId or permissions.
HTTP/1.1 400 Bad Request
{
"error": "Permissions must be an array"
}
Returned when permissions is not an array.
HTTP/1.1 500 Internal Server Error
{
"error": "Failed to update permissions"
}
Returned when there is an error updating the role in the database.
PUT /api/roles/update
Content-Type: application/json
{
"roleId": "12345",
"permissions": ["read", "write", "delete"]
}
HTTP/1.1 200 OK
{
"id": "12345",
"permissions": "read,write,delete"
}
This API allows for the management of user roles within the application.
This endpoint retrieves a list of roles from the database.
GET
Requires user to have settings.roles.manage permission.
{
"roles": [
{
"name": "Admin",
"order": 1,
"permissions": ""
},
...
]
}
This endpoint creates a new role in the database.
POST
{
"name": "NewRole"
}
Requires user to have settings.roles.manage permission.
{
"success": true
}
This endpoint updates the permissions of an existing role.
PUT
{
"role": {
"name": "ExistingRole"
},
"permissions": ["permission1", "permission2"]
}
Requires user to have settings.roles.manage permission.
{
"success": true
}
This endpoint allows authorized users to update site settings.
PATCH /api/settings
PATCH
This endpoint requires user authentication. The user must have the role that includes the permission settings.manage.
The request body must be a JSON object containing the settings to update. Example:
{
"settingKey1": "newValue1",
"settingKey2": "newValue2"
}
On a successful update, the API will return the updated settings with a 200 status code.
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"settingKey1": "newValue1",
"settingKey2": "newValue2"
}
If the user is not authenticated or does not have the required permissions, the API will return a 401 status code.
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"error": "Unauthorized"
}
If there is an error while processing the request, the API will return a 500 status code.
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "Failed to update settings"
}
After a successful update, all paths are revalidated to ensure the latest settings are reflected in the application.
Fetches the current store sale details.
Method: GET
{
"id": 1,
"enabled": true,
"title": "Summer Sale",
"description": "Get up to 50% off!",
"url": "https://example.com/sale"
}
Updates or creates the store sale details.
Method: POST
Headers:
Content-Type: application/jsonBody:
{
"enabled": true,
"title": "Black Friday Sale",
"description": "Massive discounts on all items!",
"url": "https://example.com/black-friday"
}
{
"id": 1,
"enabled": true,
"title": "Black Friday Sale",
"description": "Massive discounts on all items!",
"url": "https://example.com/black-friday"
}
This API requires authentication. Ensure that the user has the appropriate roles to access the endpoints.
The following permission is required for the POST endpoint:
This API allows you to retrieve and update store settings.
Endpoint: /api/store-settings
HTTP Method: GET
Description: Retrieve the current store settings.
{
"id": 1,
"settingName": "example",
"settingValue": "value"
}
Code: 500
{}
Endpoint: /api/store-settings
HTTP Method: POST
Description: Update the store settings. Requires authorization.
{
"settingName": "example",
"settingValue": "newValue"
}
Code: 200
{
"success": true
}
Code: 401
{
"error": "Unauthorized"
}
Code: 500
{
"error": "Failed to update store settings"
}
This API requires the user to be authenticated and have the settings.manage permission to update store settings.
Ensure that the request body for the POST method contains valid JSON with the required fields.
This API allows you to manage ticket categories, including creating, updating, retrieving, and deleting categories.
Retrieve all ticket categories along with their associated steps and fields.
{
"categories": [
{
"id": "string",
"name": "string",
"slug": "string",
"webhook": "string",
"steps": [
{
"id": "string",
"name": "string",
"fields": [
{
"id": "string",
"label": "string",
"key": "string",
"type": "string",
"required": true,
"options": ["string"]
}
]
}
],
"flags": [
{
"id": "string",
"name": "string",
"color": "string"
}
]
}
]
}
Create a new ticket category.
{
"name": "string",
"steps": [
{
"name": "string",
"fields": [
{
"label": "string",
"key": "string",
"type": "string",
"required": true,
"options": ["string"]
}
]
}
],
"flags": [
{
"name": "string",
"color": "string"
}
],
"webhook": "string"
}
{
"id": "string",
"name": "string",
"slug": "string",
"webhook": "string",
"steps": [
{
"id": "string",
"name": "string",
"fields": [
{
"id": "string",
"label": "string",
"key": "string",
"type": "string",
"required": true,
"options": ["string"]
}
]
}
],
"flags": [
{
"id": "string",
"name": "string",
"color": "string"
}
]
}
Update an existing ticket category.
{
"slug": "string",
"name": "string",
"steps": [
{
"id": "string",
"name": "string",
"fields": [
{
"id": "string",
"label": "string",
"key": "string",
"type": "string",
"required": true,
"options": ["string"]
}
]
}
],
"flags": [
{
"id": "string",
"name": "string",
"color": "string"
}
],
"webhook": "string"
}
{
"success": true,
"message": "Category updated successfully"
}
{
"success": false,
"message": "Failed to update category",
"error": "Error details"
}
Delete an existing ticket category.
{
"slug": "string"
}
{
"success": true,
"message": "Category and permissions deleted successfully"
}
{
"success": false,
"messageadmin/ticket-settings/[slug]/flags
Ticket Flags API
GET /api/ticket-flags/{slug}
Description
This endpoint retrieves a list of ticket flags associated with a specific category identified by the slug parameter.
Authentication
This endpoint requires user authentication. A valid session must be established to access the flags.
Parameters
-
slug (string, required): The unique identifier for the category of ticket flags to retrieve.
Request Example
GET /api/ticket-flags/12345
Responses
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 1,
"name": "Urgent",
"categoryId": "12345"
},
{
"id": 2,
"name": "Pending",
"categoryId": "12345"
}
]
Error Responses
Unauthorized
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"error": "Unauthorized"
}
Internal Server Error
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
{
"error": "Failed to fetch flags"
}
Notes
Ensure that the provided slug corresponds to an existing category. The API will return an error if the session is invalid or if there is an issue with the database query.
admin/tickets
GET /api/tickets
Fetches a list of tickets based on user permissions and optional user ID.
Endpoint
GET /api/tickets
Authentication
This endpoint requires authentication. A valid session is necessary to access ticket data.
Query Parameters
Parameter
Description
Type
Required
userId
The ID of the user whose tickets are to be fetched.
string
No
Response
Successful Response
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": "1",
"title": "Ticket 1",
"status": "open",
"createdAt": "2023-10-01T12:00:00Z",
"user": {
"name": "John Doe",
"image": "https://example.com/image.jpg"
},
"category": {
"name": "Support",
"slug": "support"
},
"flag": null
},
...
]
Error Responses
Status Code
Description
Response Body
401
Unauthorized - No valid session found.
{
"error": "Unauthorized"
}
Permissions
User permissions determine which tickets can be viewed. Users with the tickets.manage permission can view all tickets. Others will only see tickets in categories they have access to.
Example Request
GET /api/tickets?userId=12345
Notes
Ensure that the user has the necessary permissions to view the requested tickets. If no userId is provided, it will default to the current user's tickets based on their permissions.
admin/tickets/[id]
Ticket API Documentation
This API allows for managing tickets, including retrieving, updating, and deleting tickets.
Endpoints
GET /tickets/:id
Retrieve a Ticket
Fetches a ticket by its ID.
Parameters
- id (string): The ID of the ticket to retrieve.
Responses
{
"id": 1,
"user": {
"name": "John Doe",
"image": "url_to_image",
"storeId": 123,
"createdAt": "2023-01-01T00:00:00Z",
"accounts": [
{
"provider": "github",
"providerAccountId": "123456"
}
]
},
"category": {
"name": "General Inquiry",
"slug": "general-inquiry"
},
"flag": null
}
Error Responses
{
"error": "Unauthorized"
}
{
"error": "Ticket not found"
}
{
"error": "Forbidden"
}
PUT /tickets/:id
Update a Ticket
Updates the specified ticket's status and/or flag.
Parameters
- id (string): The ID of the ticket to update.
Request Body
{
"flagId": 2,
"status": "open" // optional
}
Responses
{
"id": 1,
"flagId": 2,
"status": "open"
}
Error Responses
{
"error": "Unauthorized"
}
{
"error": "Ticket not found"
}
{
"error": "Forbidden"
}
{
"error": "Failed to update ticket"
}
DELETE /tickets/:id
Delete a Ticket
Marks the specified ticket as closed.
Parameters
- id (string): The ID of the ticket to delete.
Responses
{
"success": true
}
Error Responses
{
"error": "Unauthorized"
}
{
"error": "Ticket not found"
}
{
"error": "Forbidden"
}
{
"error": "Failed to close ticket"
}
Authentication
All endpoints require authentication. A valid session is necessary to access ticket data.
Permissions
Users must have the appropriate permissions to manage tickets. Permissions include:
- tickets.manage: General permission to manage tickets.
- tickets.{category_slug}
admin/tickets/[id]/messages
Ticket Message API
This API allows you to interact with ticket messages in the system. You can retrieve messages for a specific ticket and post new messages.
Endpoints
GET /api/tickets/{id}/messages
Retrieve all messages for a specific ticket.
Parameters
- id (path, required): The ID of the ticket.
Response
{
"id": 1,
"messages": [
{
"id": 101,
"content": "Hello, how can I help you?",
"createdAt": "2023-10-01T12:00:00Z",
"user": {
"name": "John Doe",
"image": "https://example.com/johndoe.png"
}
}
]
}
Error Responses
- 401 Unauthorized: User is not authenticated.
Example Request
GET /api/tickets/1/messages
POST /api/tickets/{id}/messages
Post a new message to a specific ticket.
Parameters
- id (path, required): The ID of the ticket.
Request Body
{
"message": "This is a new message."
}
Response
{
"id": 102,
"content": "This is a new message.",
"createdAt": "2023-10-01T12:01:00Z",
"user": {
"id": 1,
"image": "https://example.com/johndoe.png"
}
}
Error Responses
- 401 Unauthorized: User is not authenticated.
- 404 Not Found: Ticket not found.
Example Request
POST /api/tickets/1/messages
Content-Type: application/json
{
"message": "This is a new message."
}
admin/user-count
Accounts
GET /api/accounts/count
Retrieves the count of accounts associated with the 'steam' provider.
HTTP Method
GET
Request Parameters
This endpoint does not require any query parameters.
Expected Responses
Success Response
{
"count": 10
}
Returns a JSON object containing the count of accounts.
Error Response
{
"error": "Internal Server Error"
}
Returns an error object in case of server issues.
Error Codes
- 500: Internal Server Error - An unexpected error occurred on the server.
Example Request
GET /api/accounts/count
Example Response
{
"count": 5
}
Authentication
This endpoint is protected and requires authentication. Ensure that you include a valid token in the request headers.
Authentication Header
Authorization: Bearer YOUR_ACCESS_TOKEN
Notes
This endpoint specifically counts accounts from the 'steam' provider. Adjust the provider parameter in the database query as necessary for other providers.
admin/users
User Management API
GET /api/users
Fetch a list of users with optional filtering and pagination.
Request Parameters
- page (optional, integer): The page number to retrieve. Defaults to 1.
- pageSize (optional, integer): The number of users per page. Defaults to 10.
- search (optional, string): A search query to filter users by name, storeId, or linked accounts.
- userId (optional, string): A specific user ID to fetch.
Response
{
"users": [
{
"id": "string",
"name": "string",
"storeId": "string",
"image": "string",
"steamId": "string | null",
"discordId": "string | null",
"createdAt": "string"
}
],
"total": "integer"
}
Example Request
GET /api/users?page=1&pageSize=10&search=john
Example Response
{
"users": [
{
"id": "1",
"name": "John Doe",
"storeId": "store123",
"image": "http://example.com/image.jpg",
"steamId": "steamAccountId123",
"discordId": null,
"createdAt": "2023-01-01T00:00:00Z"
}
],
"total": 1
}
Error Responses
- 500 Internal Server Error: If an error occurs while fetching users.
{
"error": "Failed to fetch users"
}
admin/users/linked
Endpoint
GET /api/users
Description
Fetches a list of users who have connected their accounts via the Discord provider. The response includes the provider account IDs of these users.
HTTP Method
GET
Authentication
This endpoint is protected and requires authentication. Ensure that you have valid credentials to access this resource.
Request Parameters
No request parameters are required for this endpoint.
Response
Success Response
On a successful request, the API will return a JSON object containing an array of provider account IDs.
{
"users": [
"providerAccountId1",
"providerAccountId2",
...
]
}
Response Status Codes
- 200 OK - Successfully fetched the users.
- 500 Internal Server Error - An error occurred while fetching users.
Error Response
In the event of an error, the API will return a JSON object with an error message.
{
"error": "Failed to fetch users"
}
Example Request
GET /api/users
Example Successful Response
{
"users": [
"123456789012345678",
"987654321098765432"
]
}
Example Error Response
{
"error": "Failed to fetch users"
}
admin/vote-results
Endpoint
Retrieve active map votes.
GET /api/votes/active
HTTP Method
GET
Authentication
This endpoint requires authentication. Use a valid token in the request headers.
Request Parameters
No query parameters are required for this request.
Response
On success, the API will return a JSON array of active map votes.
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"vote_start": "2023-10-01T12:00:00Z",
"vote_end": "2023-10-01T14:00:00Z",
"wipe_time": "2023-10-01T14:00:00Z",
"map": {
"id": "map123",
"thumbnailUrl": "https://example.com/thumbnail.jpg",
"userVotes": 10
},
"server": {
"id": "server456",
"name": "Server Name"
}
}
]
Response Fields
- vote_start: The start time of the voting period.
- vote_end: The end time of the voting period.
- wipe_time: The time when the map will start.
- map: An object containing details about the map:
- id: The unique identifier of the map.
- thumbnailUrl: URL to the map's thumbnail image.
- userVotes: The count of user votes for the map.
- server: An object containing server details:
- id: The unique identifier of the server.
- name: The name of the server.
Error Responses
Common Error Codes
- 401 Unauthorized: Authentication failed or token is missing.
- 500 Internal Server Error: An unexpected error occurred on the server.
Example Request
curl -X GET "https://api.example.com/api/votes/active" -H "Authorization: Bearer YOUR_TOKEN"
Notes
Ensure to replace YOUR_TOKEN with a valid access token.
auth/[...nextauth]x
This documentation provides details about the authentication API using NextAuth.
Endpoints
-
GET /api/auth
Handles authentication requests using the GET method.
-
POST /api/auth
Handles authentication requests using the POST method.
HTTP Methods
-
GET: Retrieve authentication session or redirect to sign-in.
-
POST: Submit credentials for authentication.
Parameters
Request Parameters
-
req: An instance of
NextRequest containing the request data.
-
res: An instance of
NextRequest used to send the response.
Expected Responses
Successful Responses
On successful authentication, the API returns a session object with user information.
{
"user": {
"name": "John Doe",
"email": "john.doe@example.com",
"image": "https://example.com/john.jpg"
},
"expires": "2023-10-30T12:00:00.000Z"
}
Error Responses
In case of an error, the API will return an error message with a status code.
{
"error": "Authentication failed",
"status": 401
}
Error Codes
-
401: Unauthorized - Invalid credentials provided.
-
403: Forbidden - Access denied for the requested resource.
-
500: Internal Server Error - An unexpected error occurred on the server.
Examples
GET Request Example
GET /api/auth HTTP/1.1
Host: example.com
Authorization: Bearer your_token_here
POST Request Example
POST /api/auth HTTP/1.1
Host: example.com
Content-Type: application/json
{
"email": "john.doe@example.com",
"password": "your_password"
}
bans
BattleMetrics API
API for retrieving ban information from BattleMetrics.
GET /bans
Fetches a list of bans from the BattleMetrics API.
Endpoint
https://api.yourdomain.com/bans
HTTP Method
GET
Query Parameters
Parameter
Type
Description
Default
pageSize
integer
Number of bans to return per page.
25
pageKey
string
Key for pagination to fetch the next page of results.
filter[search]
string
Search term to filter bans.
filter[banList]
string
ID of the ban list to filter results. (fixed value)
7b844ef0-1baf-11ef-83d3-c1d70e327b8d
Success Response
HTTP/1.1 200 OK
{
"data": [
{
"id": "ban_id",
"attributes": {
"reason": "ban_reason",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z"
}
}
],
"meta": {
"total": 100,
"page": {
"size": 25,
"key": "next_page_key"
}
}
}
Error Responses
500 Internal Server Error
HTTP/1.1 500 Internal Server Error
{
"error": "BattleMetrics API key is not configured"
}
HTTP/1.1 500 Internal Server Error
{
"error": "An error occurred while fetching the bans."
}
Example Request
GET https://api.yourdomain.com/bans?pageSize=10&filter[search]=example
Notes
- Ensure that the environment variable
BM_API_KEY is set correctly.
- The
banListId is fixed and should not be changed.
cache
API Documentation
Dark-themed API documentation for the PayNow Cache Management.
Endpoints
- GET /api/cache
- PATCH /api/cache
GET /api/cache
Fetches cached data based on a provided key.
Parameters
Parameter
Type
Description
key
string
The key for the cache entry. This parameter is required.
Responses
Successful Response
{
"data": { ... } // Cached data
}
Status Code: 200
Error Responses
- 400 Bad Request: Key is required.
- 404 Not Found: Cache not found.
- 500 Internal Server Error: Failed to fetch cache.
Example Request
GET /api/cache?key=exampleKey
PATCH /api/cache
Refreshes the cache for all defined endpoints.
Responses
Successful Response
{
"message": "Cache refreshed successfully"
}
Status Code: 200
Error Responses
- 500 Internal Server Error: Failed to refresh cache.
Example Request
PATCH /api/cache
Notes
The cache is refreshed for the following endpoints:
- store
- store/tags
- store/navlinks
- store/products
comments/[id]
User Comments API
This API allows you to fetch user details and create comments associated with a user.
Endpoints
GET /api/users/{id}
Fetch user details along with their associated comments and roles.
Parameters
- id (string): The unique identifier of the user.
Responses
- 200 OK: Returns user details along with roles and comments.
- 404 Not Found: User not found.
- 500 Internal Server Error: An error occurred while fetching user details.
Example Request
GET /api/users/12345
Example Response
{
"id": "12345",
"name": "John Doe",
"image": "url_to_image",
"roles": [...],
"Comment": [
{
"content": "This is a comment",
"role": {...},
"creator": {
"id": "67890",
"name": "Jane Smith",
"image": "url_to_image"
}
}
]
}
POST /api/users/{id}/comments
Create a comment for a specific user.
Parameters
- id (string): The unique identifier of the user.
Request Body
{
"content": "Your comment content here"
}
Responses
- 201 Created: Comment created successfully.
- 400 Bad Request: Content is required or creator has no roles.
- 401 Unauthorized: User must be authenticated to create a comment.
- 404 Not Found: Creator not found.
- 500 Internal Server Error: An error occurred while creating the comment.
Example Request
POST /api/users/12345/comments
Content-Type: application/json
{
"content": "This is a new comment"
}
Example Response
{
"id": "1",
"content": "This is a new comment",
"userId": "12345",
"roleId": "role_id",
"creatorId": "67890",
"role": {...},
"creator": {
"id": "67890",
"name": "Jane Smith",
"image": "url_to_image"
}
}
Error Codes
- 400: Bad Request - Invalid input data.
- 401: Unauthorized - Authentication required.
- 404: Not Found - Resource not found.
- 500: Internal Server Error - Unexpected error occurred.
leaderboard-tabs
Leaderboard API Documentation
This API provides access to leaderboard tabs and their associated columns.
Endpoints
GET /api/leaderboard/tabs
Fetch Leaderboard Tabs
Retrieves a list of leaderboard tabs along with their columns.
HTTP Method:
GET
Request Parameters:
No request parameters required.
Success Response:
HTTP/1.1 200 OK
[
{
"id": 1,
"name": "Tab 1",
"order": 1,
"columns": [
{
"id": 1,
"name": "Column 1",
"order": 1
},
{
"id": 2,
"name": "Column 2",
"order": 2
}
]
},
{
"id": 2,
"name": "Tab 2",
"order": 2,
"columns": [
{
"id": 3,
"name": "Column 3",
"order": 1
}
]
}
]
Error Response:
HTTP/1.1 500 Internal Server Error
{
"message": "Error fetching leaderboard tabs"
}
Error Codes:
- 500 - Internal Server Error: Indicates that there was an error while fetching the leaderboard tabs.
Error Handling
In case of an error, the API will return a JSON response with a message indicating the nature of the error, along with a corresponding HTTP status code.
Example Error Response:
{
"message": "Error fetching leaderboard tabs"
}
Notes
- Ensure the database is connected and the schema is correctly set up for the API to function properly.
- All responses are returned in JSON format.
manage-comment/[noteId]
Manage Comment API
This API allows users to manage comments associated with notes.
Endpoints
DELETE /api/manage-comment/[noteId]
Delete a Comment
Removes a comment identified by the noteId parameter.
Request
DELETE /api/manage-comment/{noteId}
Parameters
- noteId (path parameter): The ID of the comment to delete.
Responses
- 200 OK: Comment successfully deleted.
- 401 Unauthorized: User is not authenticated.
- 403 Forbidden: User does not have permission to delete this comment.
- 404 Not Found: Comment with the specified ID does not exist.
- 500 Internal Server Error: An error occurred while processing the request.
Example Request
DELETE /api/manage-comment/12345
Example Response
{ "success": true }
PUT /api/manage-comment/[noteId]
Update a Comment
Updates the content of a comment identified by the noteId parameter.
Request
PUT /api/manage-comment/{noteId}
Parameters
- noteId (path parameter): The ID of the comment to update.
Request Body
{
"content": "Updated comment content"
}
Responses
- 200 OK: Comment successfully updated.
- 400 Bad Request: Content is required or invalid.
- 401 Unauthorized: User is not authenticated.
- 403 Forbidden: User does not have permission to update this comment.
- 404 Not Found: Comment with the specified ID does not exist.
- 500 Internal Server Error: An error occurred while processing the request.
Example Request
PUT /api/manage-comment/12345
Example Request Body
{
"content": "This is the updated content."
}
Example Response
{
"id": "12345",
"content": "This is the updated content.",
"creator": {
"id": "67890",
"name": "John Doe",
"image": "https://example.com/image.jpg"
}
}
maps
Map Votes API
This API allows you to retrieve map votes based on their status.
Endpoints
GET /api/mapVotes
Description
Fetches map votes filtered by their status.
Query Parameters
- status (optional): The status of the votes to retrieve. Acceptable values are:
active: Votes that are currently ongoing.
completed: Votes that have ended.
Response
Returns a JSON array of map votes that match the specified criteria.
Success Response
{
"mapVotes": [
{
"id": 1,
"vote_start": "2023-10-01T00:00:00Z",
"vote_end": "2023-10-31T23:59:59Z",
"map_options": [
{
"id": 1,
"name": "Map A",
"userVotes": [
{
"user_id": 1,
"vote": true
}
]
}
],
"server": {
"server_id": 1,
"server_name": "Server 1",
"server_address": "192.168.1.1"
}
}
]
}
Error Responses
- 500 Internal Server Error - If an error occurs while fetching data.
{
"error": "Internal Server Error"
}
Example Request
GET /api/mapVotes?status=active HTTP/1.1
Host: example.com
Accept: application/json
Notes
Ensure to handle errors appropriately in your application. The API will return a 500 status code for any internal errors.
maps/[id]
MapVote API Documentation
This API allows you to retrieve details about a specific map vote, including options and associated user votes.
GET /api/mapvote/{id}
Retrieve a specific map vote by its unique identifier.
Request
This endpoint requires the following parameters:
- Path Parameter:
id (string): The unique identifier of the map vote.
Response
The response will return a JSON object containing the map vote details.
Successful Response
{
"id": "123",
"vote_end": "2023-10-25T12:00:00Z",
"map_options": [
{
"id": "1",
"name": "Option 1",
"vote_count": 10
},
{
"id": "2",
"name": "Option 2",
"vote_count": 5
}
],
"server": {
"server_id": "abc123",
"server_name": "Game Server 1"
}
}
Error Responses
- 204 No Content: Mapvote not found.
{
"error": "Mapvote not found"
}
- 500 Internal Server Error: An error occurred while fetching the map vote.
{
"error": "Internal Server Error"
}
Example Request
GET /api/mapvote/123
Notes
The vote_count field will only be populated if the voting period has ended.
players
Players API Documentation
This API allows for retrieving and managing player data.
Endpoints
GET /api/players
Retrieves player information based on Steam IDs.
Parameters
- ids (string, required): A comma-separated list of Steam IDs.
Response
[
{
"username": "PlayerOne",
"steam_id": "123456789",
"avatar": "http://avatar.url",
"user": {
"image": "http://user.image.url"
}
},
...
]
Error Responses
- 400 Bad Request: Invalid or missing parameters.
Example Request
GET /api/players?ids=123456789,987654321
POST /api/players
Creates or updates player information.
Request Body
{
"steamId": "123456789",
"username": "PlayerOne",
"avatar": "http://avatar.url"
}
Response
{
"success": true
}
Error Responses
- 400 Bad Request: Missing required fields.
- 500 Internal Server Error: An error occurred on the server.
Example Request
POST /api/players
Content-Type: application/json
{
"steamId": "123456789",
"username": "PlayerOne",
"avatar": "http://avatar.url"
}
Authentication
Both endpoints require authentication. Ensure you include the necessary authentication tokens in your requests.
redirects
Redirects API
GET /api/redirects
This endpoint retrieves a list of redirects.
HTTP Method
GET
Request Parameters
No parameters are required for this endpoint.
Response
The response will return a JSON array containing redirect objects.
{
"redirects": [
{
"from": "/old-path",
"to": "/new-path"
},
...
]
}
Headers
- Cache-Control:
s-maxage=300, stale-while-revalidate
Success Response
HTTP Status Code: 200 OK
{
"redirects": [
{
"from": "/old-path",
"to": "/new-path"
},
{
"from": "/another-old-path",
"to": "/another-new-path"
}
]
}
Error Response
In case of an error while fetching redirects, the API will return an empty array.
HTTP Status Code: 200 OK
[]
Error Codes
- 500 Internal Server Error: Occurs when there is an issue in fetching redirects from the data source.
Caching
The API response is cached for 300 seconds (5 minutes) to improve performance and reduce load on the server.
Notes
Ensure to handle the empty response case in your client application.
roles/[id]
API Documentation
Endpoint: Get Role by ID
HTTP Method: GET
URL: /api/roles/{id}
Parameters
Parameter
Description
Required
id
The unique identifier for the role. This can be a Discord role ID, an oxide group name, or the role name.
Yes
Responses
Success Response
{
"role": {
"id": "string",
"name": "string",
"serverId": "string",
"oxideGroupName": "string",
"assignOnBoost": true,
"assignOnVerification": true,
"assignOnGroupJoin": true,
"discordAssociations": [
{
"discordGuild": "string",
"discordRole": "string"
}
]
}
}
Error Responses
Role Not Found
{
"error": "Role not found"
}
Status Code: 204
Internal Server Error
{
"error": "Failed to lookup Discord roles"
}
Status Code: 500
Example Request
GET /api/roles/123456789012345678
Example Success Response
{
"role": {
"id": "123",
"name": "Admin",
"serverId": "456",
"oxideGroupName": "Admins",
"assignOnBoost": true,
"assignOnVerification": false,
"assignOnGroupJoin": true,
"discordAssociations": [
{
"discordGuild": "My Guild",
"discordRole": "Admin Role"
}
]
}
}
Notes
- This endpoint is protected and requires authentication.
- Ensure that the provided ID corresponds to an existing role in the database.
servers
Endpoint: Retrieve Server Categories
This endpoint retrieves all server categories along with their enabled servers.
GET /api/server-categories
Description
Fetches a list of server categories, each containing a sorted list of enabled servers.
Request
This endpoint accepts a GET request without any required parameters.
Response
On success, the API returns a JSON object containing an array of categories with their respective servers.
Success Response
{
"data": [
{
"id": 1,
"name": "Category 1",
"servers": [
{
"server_id": 1,
"server_name": "Server A",
"server_address": "192.168.1.1",
"image_path": "/images/server-a.png",
"order": 1,
"mapVotes": [
{
"id": 1
}
]
},
{
"server_id": 2,
"server_name": "Server B",
"server_address": "192.168.1.2",
"image_path": "/images/server-b.png",
"order": 2,
"mapVotes": []
}
]
},
{
"id": 2,
"name": "Category 2",
"servers": []
}
]
}
Error Response
{
"error": "Query failed"
}
In case of an error, the API will return a 500 status code along with an error message.
Error Codes
- 500: Internal Server Error - The query failed due to an unexpected error.
Notes
- The servers are sorted by their 'order' field within each category.
- Only enabled servers with a future map start time are included in the response.
session/update
GET /api/user/session
Fetches the current user's session information, including whether they have joined a Steam group and their boosted guilds.
HTTP Method
GET
Request Parameters
No query parameters are required for this endpoint.
Authentication
This endpoint requires a valid user session. If the session is invalid or the user ID is not present, a 400 error will be returned.
Responses
Success Response
{
"joinedSteamGroup": true,
"boostedGuilds": ["guildId1", "guildId2"]
}
Returns a JSON object containing:
- joinedSteamGroup:
boolean indicating if the user has joined the Steam group.
- boostedGuilds:
array of IDs representing the guilds the user has boosted.
Error Responses
400 Bad Request
{
"success": false,
"message": "invalid session"
}
Returned when the session is invalid or the user ID is not found.
404 Not Found
{
"success": false,
"message": "user not found"
}
Returned when the user does not exist in the database.
500 Internal Server Error
{
"success": false,
"message": "internal server error"
}
Returned when there is an unexpected error during the request processing.
Example Request
GET /api/user/session
Notes
Ensure that the user is authenticated and has a valid session before making this request.
site-settings
Comprehensive documentation for the Site Settings API.
Endpoints
GET /api/site-settings
Description
Fetches the current site settings. If no settings are found, it creates default settings.
HTTP Method
GET
Request Parameters
None
Responses
Success Response
{
"name": "Noble Rust Template",
"discordInvite": "https://discord.gg/ArWvQaYFfx"
}
Status Code: 200 OK
Default Creation Response
{
"name": "Noble Rust Template",
"discordInvite": "https://discord.gg/ArWvQaYFfx"
}
Status Code: 201 Created
Error Response
{
"error": "Internal Server Error"
}
Status Code: 500 Internal Server Error
Example Request
GET /api/site-settings HTTP/1.1
Host: example.com
Accept: application/json
Error Codes
- 500: Internal Server Error - An unexpected error occurred while processing the request.
sitemap
Sitemap API Documentation
This API allows you to generate and retrieve a sitemap in XML format.
Endpoints
GET /api/sitemap
Description
Fetches the generated sitemap. Returns the sitemap in XML format if successful, or an error message if the sitemap cannot be generated.
HTTP Method
GET
Request Parameters
No parameters are required for this endpoint.
Responses
Successful Response
HTTP/1.1 200 OK
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>https://example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
...
</urlset>
Error Responses
HTTP/1.1 404 Not Found
Content-Type: text/plain
Sitemap is empty
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Error generating sitemap
Error Codes
- 404 Not Found: Returned when the sitemap is empty or invalid.
- 500 Internal Server Error: Returned when there is an error during sitemap generation.
Example Request
GET /api/sitemap HTTP/1.1
Host: example.com
stats
This documentation covers the endpoints for managing player statistics.
Endpoints
GET /api/stats
Fetch statistics for a specified tab.
Parameters
- tab (required): The statistics table to query. Possible values:
pvp_stats, resources_stats, explosives_stats, farming_stats, misc_stats, events_stats.
- page (optional): The page number for pagination. Default is
1.
- pageSize (optional): The number of records per page. Default is
10.
- sortField (optional): The field to sort by.
- sortOrder (optional): The order of sorting. Can be
ASC or DESC. Default is ASC.
- filter (optional): A search filter for player username or steam ID.
- server (optional): The server ID to filter results.
Responses
{
"data": [
{
"steam_id": "123456789",
"username": "player1",
"kills": 10,
"deaths": 5,
"kdr": 2
}
],
"totalPages": 5,
"totalCount": 50
}
Error Codes
- 400: Invalid tab specified.
- 500: Query failed.
POST /api/stats
Update player statistics.
Request Body
[
{
"steamId": "123456789",
"serverId": "server_1",
"kills": 5,
"deaths": 2
},
{
"steamId": "987654321",
"serverId": "server_2",
"kills": 10,
"deaths": 3
}
]
Responses
{
"success": true
}
Error Codes
- 400: Invalid updates format or missing required fields.
- 500: Update failed.
Data Models
StatUpdate
type StatUpdate = {
steamId: string;
serverId: string;
[key: string]: any;
};
TotalCountResult
type TotalCountResult = {
total: bigint; // BigInt is used to match the COUNT query's return type
};
Notes
Ensure that all server IDs are created via the admin panel before updating statistics.
support
Ticket API Documentation
This API allows you to manage ticket categories and create tickets.
Endpoints
GET /api/tickets/categories
Fetches all ticket categories with their associated steps and fields.
HTTP Method
GET
Response
[
{
"id": "1",
"name": "Support",
"steps": [
{
"id": "1",
"title": "Step 1",
"fields": [
{ "id": "1", "name": "Field 1", "order": 1 },
{ "id": "2", "name": "Field 2", "order": 2 }
]
}
]
}
]
POST /api/tickets/create
Creates a new ticket under a specified category.
HTTP Method
POST
Request Body
{
"categoryId": "string", // The slug of the category
"content": "string | object" // The content of the ticket
}
Response
{
"id": "string",
"categoryId": "string",
"content": "string",
"userId": "string",
"createdAt": "string",
"updatedAt": "string"
}
Error Responses
- 401 Unauthorized: User session is required.
- 204 No Content: Category not found.
- 500 Internal Server Error: Failed to create ticket.
Example Request
POST /api/tickets/create
Content-Type: application/json
{
"categoryId": "support",
"content": "I need help with my account."
}
Example Response
{
"id": "abc123",
"categoryId": "support",
"content": "I need help with my account.",
"userId": "user123",
"createdAt": "2023-10-01T12:00:00Z",
"updatedAt": "2023-10-01T12:00:00Z"
}
support/[slug]
Ticket Category API Documentation
Overview
This API provides access to ticket categories, allowing users to retrieve detailed information about a specific category based on its unique slug identifier.
Endpoints
GET /api/ticket-categories/:slug
Retrieve a specific ticket category by its slug.
HTTP Method
GET
Parameters
Parameter
Type
Description
slug
string
The unique identifier for the ticket category.
Expected Responses
Success Response
Status Code: 200 OK
{
"id": 1,
"slug": "example-category",
"steps": [
{
"id": 1,
"order": 1,
"fields": [/* array of field objects */]
},
{
"id": 2,
"order": 2,
"fields": [/* array of field objects */]
}
]
}
Error Responses
Status Code: 404 Not Found
{
"error": "Ticket category not found"
}
Examples
Request
GET /api/ticket-categories/example-category
Response
{
"id": 1,
"slug": "example-category",
"steps": [
{
"id": 1,
"order": 1,
"fields": [{ "id": 1, "name": "Field 1" }]
},
{
"id": 2,
"order": 2,
"fields": [{ "id": 2, "name": "Field 2" }]
}
]
}
tickets
Tickets API
GET /api/tickets
Retrieve a list of tickets associated with the authenticated user.
Authentication
This endpoint requires user authentication. A valid session must be established.
Request
GET /api/tickets
Response
The response will return a JSON array of ticket objects or an error message if unauthorized.
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": 1,
"title": "Ticket Title 1",
"category": {
"name": "Category Name",
"slug": "category-slug"
}
},
{
"id": 2,
"title": "Ticket Title 2",
"category": {
"name": "Category Name",
"slug": "category-slug"
}
}
]
Error Responses
Possible error responses include:
-
401 Unauthorized
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"error": "Unauthorized"
}
Parameters
This endpoint does not require any query parameters.
tickets/reportable
Players API Documentation
This API allows you to retrieve player information based on a search query.
Endpoint
GET /api/players
Authentication
This endpoint requires user authentication. A valid session must be established to access this resource.
Query Parameters
Parameter
Type
Required
Description
search
string
No
Search term to filter players by username or steam ID.
Response
Success Response
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"username": "player1",
"steam_id": "123456789",
"user": {
"image": "https://example.com/image1.png"
}
},
{
"username": "player2",
"steam_id": "987654321",
"user": {
"image": "https://example.com/image2.png"
}
}
]
Error Response
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"error": "Unauthorized"
}
Error Codes
Error Code
Description
401
The request is unauthorized. Ensure the user is authenticated.
Example Request
GET /api/players?search=player1
Notes
- The response will return up to 20 players sorted by their last seen time in descending order.
tickets/[id]
This documentation outlines the available endpoints for managing tickets.
GET /api/tickets/:id
Retrieve a specific ticket by its ID.
Parameters:
- id (string): The ID of the ticket to retrieve.
Request Example:
GET /api/tickets/1
Responses:
- 200 OK: Returns the ticket object.
- 401 Unauthorized: If the user is not authenticated.
Response Example:
{
"id": 1,
"title": "Sample Ticket",
"status": "open",
"category": {
"name": "Support",
"slug": "support"
}
}
DELETE /api/tickets/:id
Close a specific ticket by its ID.
Parameters:
- id (string): The ID of the ticket to close.
Request Example:
DELETE /api/tickets/1
Responses:
- 200 OK: Returns success message.
- 401 Unauthorized: If the user is not authenticated.
- 500 Internal Server Error: If there is an error closing the ticket.
Response Example:
{
"success": true
}
Error Response Example:
{
"error": "Failed to close ticket"
}
tickets/[id]/messages
Ticket Messages API
This API allows users to retrieve and post messages related to specific tickets.
Endpoints
GET /api/ticketMessages/{id}
Retrieve Messages
Fetch all messages for a specific ticket.
Parameters:
- id (path parameter): The ID of the ticket for which messages are being retrieved.
Authentication:
This endpoint requires user authentication. A valid session is needed to access the messages.
Responses:
- 200 OK: Returns an array of messages for the specified ticket.
- 401 Unauthorized: Returned when the user is not authenticated.
Example Request:
GET /api/ticketMessages/1
Example Response:
[
{
"id": 1,
"content": "Hello, how can I help you?",
"createdAt": "2023-10-01T10:00:00Z",
"user": {
"name": "John Doe",
"image": "https://example.com/image.jpg"
}
}
]
POST /api/ticketMessages/{id}
Post a Message
Create a new message for a specific ticket.
Parameters:
- id (path parameter): The ID of the ticket to which the message is being posted.
Request Body:
{
"message": "Your message content here."
}
Authentication:
This endpoint requires user authentication. A valid session is needed to post a message.
Responses:
- 201 Created: Returns the created message object.
- 401 Unauthorized: Returned when the user is not authenticated.
Example Request:
POST /api/ticketMessages/1
Example Request Body:
{
"message": "Thank you for reaching out!"
}
Example Response:
{
"id": 2,
"content": "Thank you for reaching out!",
"createdAt": "2023-10-01T10:05:00Z",
"user": {
"id": "123",
"name": "Jane Doe",
"image": "https://example.com/image2.jpg"
}
}
Error Codes
Status Code
Description
401
Unauthorized - The user is not authenticated.
404
Not Found - The specified ticket does not exist.
500
Internal Server Error - An unexpected error occurred.
user
This API allows for the management of user roles in both Oxide and Discord environments.
Endpoints
GET /api/roles
Retrieve user roles based on the specified type (oxide or discord).
Parameters
- type (query parameter, required): The type of role management. Possible values are
oxide or discord.
- playerId (query parameter, required for oxide): The Steam ID of the player.
- serverId (query parameter, required for oxide): The server ID.
- discordId (query parameter, required for discord): The Discord user ID.
- guildId (query parameter, required for discord): The Discord guild ID.
Responses
Success Response
{
"roles": ["role1", "role2"]
}
Error Response
{
"success": false,
"message": "Missing playerId or serverId"
}
Error codes:
- 400 - Bad Request: Missing required parameters or invalid type.
POST /api/roles
Assign or revoke roles for users in either Oxide or Discord.
Parameters
- type (query parameter, required): The type of role management. Possible values are
oxide or discord.
- serverId (query parameter, required for oxide): The server ID for Oxide roles.
Request Body
Oxide Example
{
"roles": [
{
"steamId": "123456789",
"role": "Admin",
"action": "added"
},
{
"steamId": "987654321",
"role": "User",
"action": "revoked"
}
]
}
Discord Example
{
"roles": [
{
"discordGuildId": "guild123",
"userId": "user456",
"role": "Moderator",
"action": "added"
}
]
}
Responses
Success Response
{
"success": true,
"message": "Roles processed successfully"
}
Error Response
{
"success": false,
"message": "Invalid request body",
"errors": [...]
}
Error codes:
- 400 - Bad Request: Missing required parameters or invalid request body.
Schemas
Oxide Role Schema
{
"steamId": "string",
"role": "string",
"action": "added" | "revoked"
}
Discord Role Schema
{
"discordGuildId": "string",
"userId": "string",
"role": "string",
"action": "added" | "revoked"
}
user/discord/[id]
Discord Account Retrieval
Endpoint
GET /api/discord/account/{id}
Description
Retrieves the Discord account information linked to a given Discord account ID. This includes user details, linked Steam account information, and user roles.
Parameters
Parameter
Type
Description
id
string
The unique identifier for the Discord account.
Responses
Success Response
On success, returns a JSON object with user details.
{
"user": {
"id": "string",
"name": "string",
"image": "string",
"steamId": "string | null",
"boostedGuilds": ["string"],
"isLinked": true,
"storeId": "string | null",
"joinedSteamGroup": true,
"roles": [
{
"name": "string",
"serverId": "string",
"oxideGroupName": "string",
"discordAssociations": [
{
"discordGuild": "string",
"discordRole": "string"
}
]
}
]
}
}
Error Responses
Status Code
Message
Description
204
{"success": false, "message": "Discord account not found"}
No Discord account found for the provided ID.
500
{"message": "Internal server error"}
An unexpected error occurred while processing the request.
Example Request
GET /api/discord/account/1234567890
Example Successful Response
{
"user": {
"id": "1234567890",
"name": "John Doe",
"image": "https://example.com/image.png",
"steamId": "76561198012345678",
"boostedGuilds": ["guild1", "guild2"],
"isLinked": true,
"storeId": "store123",
"joinedSteamGroup": true,
"roles": [
{
"name": "Admin",
"serverId": "server123",
"oxideGroupName": "oxideGroup1",
"discordAssociations": [
{
"discordGuild": "guild1",
"discordRole": "role1"
}
]
}
]
}
}
user/nitro
Discord Nitro User API
This API allows you to manage Discord Nitro users and their boosted guilds.
Endpoints
GET /api/nitro-user
Retrieve boosted guilds for a specific Discord user.
Query Parameters
- discordId (string, required): The Discord ID of the user.
Responses
{
"success": true,
"guilds": ["guildId1", "guildId2"]
}
If no guilds are boosted:
{
"success": true,
"guilds": []
}
If the user is not found:
{
"success": false,
"message": "User not found"
}
If discordId is missing:
{
"success": false,
"message": "Missing discordId"
}
POST /api/nitro-user
Add a boosted guild for a specific Discord user.
Request Body
{
"guildId": "guildId1",
"discordId": "discordId1"
}
Responses
On success:
{
"success": true
}
If any required field is missing:
{
"success": false,
"message": "Missing guildId or discordId"
}
If the user is not found:
{
"success": false,
"message": "User not found"
}
If there is an error updating the user:
{
"success": false,
"message": "Error updating user"
}
DELETE /api/nitro-user
Remove a boosted guild from a specific Discord user.
Query Parameters
- guildId (string, required): The ID of the guild to remove.
- discordId (string, required): The Discord ID of the user.
Responses
On success:
{
"success": true
}
If any required field is missing:
{
"success": false,
"message": "Missing discordId or guildId"
}
If the user is not found:
{
"success": false,
"message": "User not found"
}
If there is an error updating the user:
{
"success": false,
"message": "Error updating user"
}
user/search/[id]
User Accounts API
Get User Accounts
Retrieve user accounts based on user ID or provider account ID.
Endpoint
GET /api/users/{id}
Parameters
Parameter
Type
Description
id
string
The user ID or provider account ID to search for.
Responses
Success Response
{
"users": [
{
"id": "user-id-1",
"name": "User Name",
"image": "http://example.com/image.jpg",
"boostedGuilds": ["guild-id-1", "guild-id-2"],
"steamId": "steam-account-id",
"discordId": "discord-account-id",
"isLinked": true,
"scrap": true,
"storeId": "store-id",
"joinedSteamGroup": true,
"roles": [
{
"name": "Admin",
"serverId": "server-id",
"oxideGroupName": "oxide-group",
"discordAssociations": [
{
"discordGuild": "guild-id",
"discordRole": "role-id"
}
]
}
]
}
]
}
Error Responses
Status Code
Description
Response
204
No accounts found
{
"success": false,
"message": "No accounts with this id has been found"
}
500
Internal server error
{
"message": "Internal server error"
}
Example Request
GET /api/users/user-id-1
Notes
Ensure that the user ID or provider account ID exists in the database to receive a successful response.
user/session
Get User Roles and Session Information
This API endpoint retrieves the roles and session information for the authenticated user.
Endpoint
GET /api/user/roles
HTTP Method
GET
Authentication
This endpoint requires authentication via a session token stored in cookies.
Request Parameters
No query parameters are required for this endpoint.
Request Headers
- Cookie: Contains the session token.
Expected Responses
Successful Response
{
"roles": [
{
"id": "1",
"name": "Admin",
"permissions": ["read", "write", "delete"]
},
{
"id": "2",
"name": "User",
"permissions": ["read"]
}
],
"twoFAVerified": true,
"is2FAEnabled": true
}
Status Code: 200 OK
Unauthorized Response
{
"error": "Unauthorized"
}
Status Code: 401 Unauthorized
Error Response
{
"error": "Failed to retrieve session and roles"
}
Status Code: 500 Internal Server Error
Error Codes
- 401 - Unauthorized: The user is not authenticated or the session token is missing/invalid.
- 500 - Internal Server Error: An error occurred while processing the request.
Example Request
GET /api/user/roles
Cookie: next-auth.session-token=exampleSessionToken
Notes
Ensure that the session token is valid and that the user is authenticated before making a request to this endpoint.
user/steam/[id]
Steam Account API Documentation
This API allows you to retrieve information about Steam accounts linked to users in the system.
Endpoint
GET /api/steam/{id}
Parameters
Parameter
Type
Description
id
string
The unique identifier for the Steam account.
type
string (optional)
Specifies the type of data to return. If set to 'oxidegroups', it filters roles by server.
server
string (optional)
The server ID to filter oxide groups when type is 'oxidegroups'.
Responses
Success Response
{
"user": {
"id": "string",
"name": "string",
"image": "string",
"boostedGuilds": ["string"],
"isLinked": true,
"storeId": "string",
"joinedSteamGroup": true,
"steamId": "string",
"roles": [
{
"name": "string",
"serverId": "string",
"oxideGroupName": "string",
"discordAssociations": [
{
"discordGuild": "string",
"discordRole": "string"
}
]
}
]
}
}
Empty Response
{
"success": false,
"message": "Steam account not found"
}
Error Response
{
"message": "Internal server error"
}
Example Request
GET /api/steam/1234567890?type=oxidegroups&server=serverId123
Error Codes
Status Code
Description
204
No content, Steam account not found.
500
Internal server error, unable to fetch user data.
user/unlink
Discord Account Unlinking API
Endpoint
DELETE /api/unlink-discord
Description
This endpoint allows users to unlink their Discord account from the application. The user must be authenticated to perform this action.
Authentication
This endpoint requires user authentication. A valid session must be present; otherwise, it will return an unauthorized error.
Request
Method: DELETE
URL: /api/unlink-discord
Headers:
Authorization: Bearer <token>
Response
Success Responses:
{
"success": true
}
No Discord Account Found:
{
"success": false,
"message": "Discord account not found"
}
Error Responses:
{
"success": false,
"message": "Error unlinking discord account"
}
HTTP Status Codes
- 200 OK: Successfully unlinked the Discord account.
- 204 No Content: No Discord account found for the user.
- 401 Unauthorized: User is not authenticated.
- 500 Internal Server Error: An error occurred while unlinking the Discord account.
Example Request
DELETE /api/unlink-discord
Authorization: Bearer your_access_token
Example Response
{
"success": true
}
vote
Voting API Documentation
This API allows users to cast their votes for map options and retrieve their voting history.
Endpoints
POST /api/vote
Cast a vote for a specific map option.
Request
{
"vote_id": "string",
"map_option_id": "string"
}
Parameters
- vote_id (string): The ID of the vote.
- map_option_id (string): The ID of the map option being voted for.
Responses
200 OK
{
"message": "Your vote has been recorded"
}
400 Bad Request
{
"error": "Missing vote_id or map_option_id"
}
{
"error": "You have already voted for this map"
}
401 Unauthorized
{
"error": "Unauthorized"
}
204 No Content
{
"error": "Vote not found"
}
{
"error": "Map option not found"
}
GET /api/vote
Retrieve the user's voting history.
Responses
200 OK
[
{
"vote_id": "string",
"vote_option_id": "string",
"user_id": "string"
},
...
]
401 Unauthorized
{
"error": "Unauthorized"
}
Authentication
All requests require user authentication. Ensure that the user is logged in to access the endpoints.
Error Codes
Status Code
Description
200
Request succeeded.
204
No content available.
400
Bad request due to missing parameters or duplicate votes.
401
Unauthorized access.