API Documentation

You send us files with POST and we will store them and return an url for you in JSON.


Example Request

curl -F "file=@test.txt" https://file.bz/api/upload

Example Success Response

{
    "status": true,
    "data": {
        "file": {
            "url": {
                "full": "https://file.bz/u1C0ebc4b0/file.txt",
                "short": "https://file.bz/u1C0ebc4b0"
            },
            "metadata": {
                "id": "u1C0ebc4b0",
                "name": "file.txt",
                "size": {
                    "bytes": 6861,
                    "readable": "6.7 KB"
                }
            }
        }
    }
}

Example Error Response

{
    "status": false,
    "error": {
        "message": "The file is too large. Max filesize: 5 GiB",
        "type": "ERROR_FILE_SIZE_EXCEEDED",
        "code": 31
    }
}

Error Codes & Types

  • (10) ERROR_FILE_NOT_PROVIDED
  • (11) ERROR_FILE_EMPTY
  • (12) ERROR_FILE_INVALID
  • (20) ERROR_USER_MAX_FILES_PER_HOUR_REACHED
  • (21) ERROR_USER_MAX_FILES_PER_DAY_REACHED
  • (22) ERROR_USER_MAX_BYTES_PER_HOUR_REACHED
  • (23) ERROR_USER_MAX_BYTES_PER_DAY_REACHED
  • (30) ERROR_FILE_DISALLOWED_TYPE
  • (31) ERROR_FILE_SIZE_EXCEEDED
  • (32) ERROR_FILE_BANNED
  • (40) STATUS_ERROR_SYSTEM_FAILURE