ServerOps.ggbeta
Server owners

Roblox - Getting started

Connect your Roblox experience to ServerOps for logging and media uploads.

Roblox: Getting started

This guide connects your Roblox experience to ServerOps. You can use ServerOps to store moderation logs, upload evidence screenshots, and track player events across your experience.

Before you start

  • Complete Getting your API token. You need a token with the scopes for what you want to do (media:write for uploads, logs:write for logging).
  • You need to be the owner or a developer of the Roblox experience.
  • HTTP requests must be enabled in your experience settings.

Enable HTTP requests

  1. Open Roblox Studio.
  2. Go to Home > Game Settings > Security.
  3. Turn on Allow HTTP Requests.
  4. Publish your experience.

Only enable HTTP requests if you trust your server-side scripts. HTTP calls can only run in server scripts (ServerScript), never in LocalScript. A LocalScript cannot reach ServerOps.

Storing your token safely

Your API token must never be accessible to players. Store it in a ModuleScript inside ServerStorage (not ReplicatedStorage):

  1. In the Explorer, right-click ServerStorage and add a ModuleScript.
  2. Rename it to ApiConfig.
  3. Replace the default code with:
-- ServerStorage/ApiConfig
return {
    ApiToken = "so_live_..."  -- Replace with your token
}

ServerStorage is never replicated to clients, so players cannot read this value.

Sending logs

Create a Script (ServerScript) in ServerScriptService and add:

-- ServerScriptService/ServerOpsLogger.server.luau
local HttpService = game:GetService("HttpService")
local Config = require(game:GetService("ServerStorage").ApiConfig)

local API_URL = "https://api.serverops.gg/v1/logs"

local function SendLog(level, message, meta)
    local ok, err = pcall(function()
        HttpService:RequestAsync({
            Url = API_URL,
            Method = "POST",
            Headers = {
                ["Authorization"] = "Bearer " .. Config.ApiToken,
                ["Content-Type"] = "application/json",
            },
            Body = HttpService:JSONEncode({
                level = level,
                message = message,
                meta = meta or {}
            })
        })
    end)
    if not ok then
        warn("[ServerOps] Log failed:", err)
    end
end

-- Example: log when a player joins
game.Players.PlayerAdded:Connect(function(player)
    SendLog("info", "Player joined", {
        name = player.Name,
        userId = player.UserId,
        accountAge = player.AccountAge
    })
end)

-- Example: log when a player leaves
game.Players.PlayerRemoving:Connect(function(player)
    SendLog("info", "Player left", {
        name = player.Name,
        userId = player.UserId
    })
end)

Uploading images

Roblox does not support multipart file uploads natively. Instead, use the /media/base64 endpoint to send image data encoded as base64.

The most common use case is uploading a screenshot captured with TeleportService or a render-to-texture workflow. Here is an example sending a base64-encoded image string:

local function UploadImage(base64Data, filename)
    local ok, result = pcall(function()
        return HttpService:RequestAsync({
            Url = "https://api.serverops.gg/v1/media/base64",
            Method = "POST",
            Headers = {
                ["Authorization"] = "Bearer " .. Config.ApiToken,
                ["Content-Type"] = "application/json",
            },
            Body = HttpService:JSONEncode({
                file = base64Data,
                filename = filename or "screenshot.png"
            })
        })
    end)

    if ok and result.Success then
        local data = HttpService:JSONDecode(result.Body)
        print("[ServerOps] Uploaded:", data.url)
        return data.url
    else
        warn("[ServerOps] Upload failed:", result)
    end
end

Viewing your data

Check your dashboard to see logs and uploaded files. The Logs section lets you filter by level and search by message or player name.

Troubleshooting

"HTTP requests are not enabled": Go to Game Settings > Security and enable Allow HTTP Requests.

"ServerStorage.ApiConfig is not a valid member": The ModuleScript name must match exactly: ApiConfig. Check the spelling in the Explorer.

Logs not appearing: Make sure the script is a Script (server), not a LocalScript. LocalScripts cannot make HTTP requests.

On this page