def METHOD_NAME(identifier):
    json_data = request.get_json()
    if "profile" not in json_data:
        abort(400, description="profile missing")
    profile = printerProfileManager.get(identifier)
    if profile is None:
        profile = printerProfileManager.get_default()
    new_profile = json_data["profile"]
    merged_profile = dict_merge(profile, new_profile)
    make_default = False
    if "default" in merged_profile:
        make_default = True
        del new_profile["default"]
        merged_profile["id"] = identifier
    try:
        saved_profile = printerProfileManager.save(
            merged_profile,
            allow_overwrite=True,
            make_default=make_default,
            trigger_event=True,
        )
    except InvalidProfileError:
        abort(400, description="profile is invalid")
    except CouldNotOverwriteError:
        abort(400, description="Profile already exists and overwriting was not allowed")
    except Exception as e:
        abort(500, description="Could not save profile: %s" % str(e))
    else:
        return jsonify({"profile": _convert_profile(saved_profile)})