modl.gg
Developer API

Upload Replay

Initialize a replay file upload.

POST /v1/minecraft/replays/upload

Initialize a replay file upload. Returns an upload URL and required headers that should be used to upload the actual replay file to the storage provider.

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
mcVersionstringYesThe Minecraft version the replay was recorded on. Must not be blank.
fileSizelongYesThe size of the replay file in bytes. Must be a positive number.
{
  "mcVersion": "1.20.4",
  "fileSize": 15728640
}

Response

200 OK

{
  "status": 200,
  "replayId": "replay_abc123",
  "uploadUrl": "https://storage.example.com/upload/replay_abc123",
  "method": "PUT",
  "requiredHeaders": {
    "Content-Type": "application/octet-stream"
  }
}

Response Fields

FieldTypeDescription
replayIdstringThe unique ID assigned to this replay. Use this to confirm the upload.
uploadUrlstringThe URL to upload the replay file to.
methodstringThe HTTP method to use for the upload (e.g., PUT).
requiredHeadersobjectHeaders that must be included when uploading the file.

Error Responses

Status CodeDescription
400Invalid request body or missing required fields.
401Missing or invalid API key.
429Rate limit exceeded.
500Internal server error.

On this page