modl.gg

Sync

Synchronize player data, punishments, and notifications with the server.

POST /v1/minecraft/players/sync

Synchronize player data, punishments, and notifications between the Minecraft server plugin and the modl platform. This endpoint should be called periodically to keep the server in sync with the latest moderation actions and player notifications.

Authentication

Requires the X-API-Key header with your server's API key.

X-API-Key: your-api-key-here

Request

Headers

HeaderTypeRequiredDescription
X-API-KeystringYesYour server's API key.
Content-TypestringYesMust be application/json.

Body

FieldTypeRequiredDescription
lastSyncTimestampstringNoISO 8601 timestamp of the last successful sync. Used to retrieve only changes since that time.
onlinePlayersarrayNoList of currently online players. Each object contains uuid, username, and ipAddress.
serverStatusobjectNoCurrent server status information.
onlinePlayers Object
FieldTypeRequiredDescription
uuidstringYesThe player's Minecraft UUID.
usernamestringYesThe player's current username.
ipAddressstringYesThe player's IP address.
serverStatus Object
FieldTypeRequiredDescription
onlinePlayerCountintegerNoNumber of players currently online.
maxPlayersintegerNoMaximum player capacity of the server.
serverVersionstringNoThe Minecraft server version string.
timestampstringNoISO 8601 timestamp of the status report.
{
  "lastSyncTimestamp": "2024-01-15T12:00:00Z",
  "onlinePlayers": [
    {
      "uuid": "550e8400-e29b-41d4-a716-446655440000",
      "username": "Notch",
      "ipAddress": "192.168.1.1"
    }
  ],
  "serverStatus": {
    "onlinePlayerCount": 42,
    "maxPlayers": 100,
    "serverVersion": "1.21.1",
    "timestamp": "2024-01-15T12:00:00Z"
  }
}

Response

200 OK

{
  "timestamp": "2024-01-15T12:00:05Z",
  "data": {
    "pendingPunishments": [],
    "recentlyStartedPunishments": [],
    "recentlyModifiedPunishments": [],
    "playerNotifications": [],
    "activeStaffMembers": [],
    "staffPermissionsUpdatedAt": null,
    "punishmentTypesUpdatedAt": null
  }
}

Error Responses

Status CodeDescription
400Invalid request body. One or more fields failed validation.
401Missing or invalid API key.
429Rate limit exceeded.
500Internal server error.

On this page