melonly logomelonly logo
melonly logo
Dashboard
Log in

Errors

What the API's error responses mean and how to handle them.

How Do Errors Look?

When a request fails, you get an HTTP status code and an error object:

{
  "error": {
    "code": "not_found",
    "message": "log not found"
  }
}
FieldDescription
codeA short code you can check in your code. These don't change.
messageWhat went wrong, in plain English. Good for logs, but it may change, so don't check it in code.
detailsExtra information, for some errors.

Invalid Fields

If a request has invalid fields, you get a 400 with the code validation_failed, and details.fields lists every problem at once:

{
  "error": {
    "code": "validation_failed",
    "message": "one or more fields are invalid",
    "details": {
      "fields": [
        { "field": "username", "message": "must be a Roblox username: 3-20 letters, digits or underscores" },
        { "field": "text", "message": "must be 1-2048 characters" }
      ]
    }
  }
}

Fields the endpoint doesn't know about are rejected too, so a typo like usrname fails instead of being silently ignored.

Error Codes

StatuscodeWhat it meansWhat to do
400bad_requestThe request couldn't be read, such as broken JSON or a bad orderBy.Check the message.
400validation_failedOne or more fields are invalid.Fix the fields in details.fields.
401unauthorizedThe token is missing, wrong, expired or deactivated.Check your Authorization header and token.
403forbiddenThe acting member isn't allowed to do this, or it needs premium.Check the member's permissions, or your plan.
404not_foundIt doesn't exist, or it belongs to another server.Check the ID.
405method_not_allowedThe endpoint exists, but not with that method.Check the method, such as POST or PATCH.
408request_timeoutThe request took too long.Try again. For writes, check first.
409conflictIt can't be done right now, such as ending a shift that already ended.Get the latest state and try again if it makes sense.
413payload_too_largeThe body is over 64 KB.Send less.
415unsupported_media_typeThe body isn't marked as JSON.Add Content-Type: application/json.
429rate_limitedYou've hit a rate limit.Wait for Retry-After seconds.
500internal_errorSomething broke on our end.Try again later, and tell us if it keeps happening.
502upstream_errorA write didn't get confirmed.See below.
503service_unavailableWrites are paused.Try again later.

When a Write Fails

A 502 on a write means Melonly couldn't confirm it, but it may still have gone through. Before you try again, check whether it happened. For example, after a failed Create a Log, look for the log with List a Player's Logs.

Retrying without checking can create the log twice, and send the player two DMs.

Where to Go Next

Need help?

Still have questions? Join our Discord server for support from the Melonly Team.