How to flash Photon bootloader by OTA?

I find out that bootloader is not backward compatibility.
How to flash bootloader by OTA?
Is there an API to do it?

You can flash the bootloader by the CLI or the API, just like you flash a user firmware or system firmware binary, just specify the bootloader payload.

particle flash DEVICE_NAME_OR_ID bootloader-0.6.2-photon.bin

It must be online or breathing magenta (safe mode) of course.

By USB, you can flash one in listening mode (blinking dark blue) using --serial but you cannot flash a bootloader in DFU mode (blinking yellow) using --usb.

Thanks,will try it.