Error Handling

The flu.lu APIs use standard HTTP status codes and application error messages to indicate the success or failure of a request.

Structure of Application Error Responses

When an application-specific error occurs, the response body will contain useful details to understand the issue:

{
  "error_code": "unique_code",
  "message": "Descriptive error message"
}

Examples of Common Application Errors

Missing Parameter

{
  "error_code": "missing_parameter",
  "message": "The 'url' parameter is required and missing in the request."
}

Invalid Shortcode

{
  "error_code": "invalid_shortcode",
  "message": "The specified shortcode is invalid or does not exist."
}

Link Already Exists

{
  "error_code": "link_already_exists",
  "message": "The link you tried to create already exists."
}

Quota Limit Reached

{
  "error_code": "quota_reached",
  "message": "You have reached the maximum number of shortened links allowed by your plan."
}

Generic Internal Error

{
  "error_code": "internal_error",
  "message": "An internal error occurred, please try again later or contact support."
}