· ildyria · Api Documentation · 4 min read
About Lychee API documentation
With v6 at the horizon, we had to drop the support of Scramble, a library responsible for automated API documentation. We explain here the reasons which motivated such choice.

x1ntt asked the following question and I thought it deserved a visible answer.
Even without API documentation, is the v6 version compatible with this API? I think APIs are very important because I have a need for automated development. Maintaining a good API will lead to the emergence of excellent third-party clients and tools.
In short: Yes and No.
Yes because v6 will provide a legacy api option which can be enabled by setting LEGACY_API_ENABLED in your .env. Furthermore, the URL of the legacy API do not change, they stay the same. So no need to change your code, you will just need to set the .env variable.
No, because v6 will provide a completely upgrade of the API which makes use of a bit more than just POST requests. It will also support GET, PATCH, DELETE (to get closer to proper REST spec).
About v4 and v5 documentation
Documentation on v4 and v5 was making use of dedoc/scramble. This extension of Laravel was doing a static analysis of the routes, checking the controllers, the requests objects and the resources files. Using those data it generated a nice interface with readable documentation.
It has been brought to our attention that Scramble is not even working anymore on version 5.5.1 and most likely suffers from an infinite recursion during the serialization of one of the response (out of memory error).
In the spirit of open source, I could try to fix it. However, scramble fails at the following:
- proper software design respecting SOLID architecture (refusal to have proper design with interface, uses reflections instead to check if some methods are available, and violation of the Liskov substitution principle).
- lack of static analysis such as Phpstan.
As I do not feel comfortable to contribute to such code base, it is an easier decision to drop the scramble component completely.

Furthermore, with version 6 we are now using Spatie Data. This allows us to generate typescripts definitions from those objects, and thus ensuring stronger type compatibility between front-end and back-end.
Scramble only support Spatie Data in the pro version, we respect the decision of romalytvynenko, and remove it as we are no longer able to use it anymore.
About v6
It is likely that I will release version 6 without API documentation at first. My time is limited and I prefer to focus on adding back the functionalities rather than writing documentations, especially given that the v1 api will remain available.
And to clarify, this does not mean that there won’t be documentation of the API at some point. As x1ntt says “Maintaining a good API will lead to the emergence of excellent third-party clients and tools.” For this reason I am also exploring other documentation options such as scribe.
At the time of writing the list of the api v2 routes is as follows (and subject to change):
GET api/v2/Album ............................................. Gallery\AlbumController@getPOST api/v2/Album ..................................... Gallery\AlbumController@createAlbumPATCH api/v2/Album ..................................... Gallery\AlbumController@updateAlbumPOST api/v2/Album::cover .................................... Gallery\AlbumController@coverPOST api/v2/Album::delete .................................. Gallery\AlbumController@deleteGET api/v2/Album::getTargetListAlbums ........ Gallery\AlbumController@getTargetListAlbumsPOST api/v2/Album::header .................................. Gallery\AlbumController@headerPOST api/v2/Album::move ...................................... Gallery\AlbumController@movePATCH api/v2/Album::rename .................................. Gallery\AlbumController@renamePOST api/v2/Album::transfer .............................. Gallery\AlbumController@transferPOST api/v2/Album::updateProtectionPolicy .. Gallery\AlbumController@updateProtectionPolicyGET api/v2/Albums ........................................... Gallery\AlbumsController@getGET api/v2/Auth::config ......................................... AuthController@getConfigPOST api/v2/Auth::login .............................................. AuthController@loginPOST api/v2/Auth::logout ............................................ AuthController@logoutGET api/v2/Auth::rights ................................... AuthController@getGlobalRightsGET api/v2/Auth::user ...................................... AuthController@getCurrentUserGET api/v2/Diagnostics ................................ Admin\DiagnosticsController@errorsGET api/v2/Diagnostics::config ........................ Admin\DiagnosticsController@configGET api/v2/Diagnostics::info ............................ Admin\DiagnosticsController@infoGET api/v2/Diagnostics::permissions . Admin\DiagnosticsController@getFullAccessPermissionsGET api/v2/Diagnostics::space .......................... Admin\DiagnosticsController@spaceGET api/v2/Gallery::Init ................................ Gallery\ConfigController@getInitGET api/v2/Gallery::getLayout .................. Gallery\ConfigController@getGalleryLayoutGET api/v2/Gallery::getMapProvider ............... Gallery\ConfigController@getMapProviderGET api/v2/Gallery::getUploadLimits ............. Gallery\ConfigController@getUploadCOnfigGET api/v2/Jobs ................................................ Admin\JobsController@listGET api/v2/LandingPage .................................... LandingPageController@__invokeGET api/v2/Maintenance::cleaning ........................ Admin\Maintenance\Cleaning@checkPOST api/v2/Maintenance::cleaning ........................... Admin\Maintenance\Cleaning@doGET api/v2/Maintenance::genSizeVariants .......... Admin\Maintenance\GenSizeVariants@checkPOST api/v2/Maintenance::genSizeVariants ............. Admin\Maintenance\GenSizeVariants@doGET api/v2/Maintenance::jobs ............................. Admin\Maintenance\FixJobs@checkPOST api/v2/Maintenance::jobs ................................ Admin\Maintenance\FixJobs@doGET api/v2/Maintenance::missingFileSize ......... Admin\Maintenance\MissingFileSizes@checkPOST api/v2/Maintenance::missingFileSize ............ Admin\Maintenance\MissingFileSizes@doPOST api/v2/Maintenance::optimize ........................... Admin\Maintenance\Optimize@doGET api/v2/Maintenance::tree ............................. Admin\Maintenance\FixTree@checkPOST api/v2/Maintenance::tree ................................ Admin\Maintenance\FixTree@doGET api/v2/Maintenance::update ................................ Admin\UpdateController@getPOST api/v2/Maintenance::update .............................. Admin\UpdateController@checkGET api/v2/Oauth .................................................... OauthController@listGET api/v2/Photo ............................................. Gallery\PhotoController@getPOST api/v2/Photo .......................................... Gallery\PhotoController@uploadPATCH api/v2/Photo .......................................... Gallery\PhotoController@updateDELETE api/v2/Photo .......................................... Gallery\PhotoController@deletePOST api/v2/Photo::copy ...................................... Gallery\PhotoController@copyPOST api/v2/Photo::fromUrl ................................ Gallery\PhotoController@fromUrlPOST api/v2/Photo::move ...................................... Gallery\PhotoController@movePATCH api/v2/Photo::rename .................................. Gallery\PhotoController@renamePOST api/v2/Photo::rotate .................................. Gallery\PhotoController@rotatePOST api/v2/Photo::star ...................................... Gallery\PhotoController@starPATCH api/v2/Photo::tags ...................................... Gallery\PhotoController@tagsPOST api/v2/Profile::resetToken .............................. ProfileController@resetTokenPOST api/v2/Profile::unsetToken .............................. ProfileController@unsetTokenPOST api/v2/Profile::update ...................................... ProfileController@updateGET api/v2/Settings ...................................... Admin\SettingsController@getAllGET api/v2/Settings::getLanguages .................. Admin\SettingsController@getLanguagesPOST api/v2/Settings::setConfigs ...................... Admin\SettingsController@setConfigsGET api/v2/Sharing ........................................ Gallery\SharingController@listPOST api/v2/Sharing ...................................... Gallery\SharingController@createPOST api/v2/Sharing::delete .............................. Gallery\SharingController@deletePOST api/v2/Sharing::edit .................................. Gallery\SharingController@editPOST api/v2/TagAlbum ............................... Gallery\AlbumController@createTagAlbumPATCH api/v2/TagAlbum ............................... Gallery\AlbumController@updateTagAlbumGET api/v2/UserManagement ............................ Admin\UserManagementController@listPOST api/v2/UserManagement::create .................. Admin\UserManagementController@createPOST api/v2/UserManagement::delete .................. Admin\UserManagementController@deletePOST api/v2/UserManagement::save ...................... Admin\UserManagementController@saveGET api/v2/Users .................................................... UsersController@listGET api/v2/Users::count ............................................ UsersController@countGET api/v2/Version ................................................. VersionController@getGET api/v2/WebAuthn ............................... WebAuthn\WebAuthnManageController@listPATCH api/v2/WebAuthn ............................... WebAuthn\WebAuthnManageController@editPOST api/v2/WebAuthn::delete ..................... WebAuthn\WebAuthnManageController@deletePOST api/v2/WebAuthn::login ....... webauthn.login › WebAuthn\WebAuthnLoginController@loginPOST api/v2/WebAuthn::login/options webauthn.login.options › WebAuthn\WebAuthnLoginControl…POST api/v2/WebAuthn::register webauthn.register › WebAuthn\WebAuthnRegisterController@reg…POST api/v2/WebAuthn::register/options webauthn.register.options › WebAuthn\WebAuthnRegist…GET auth/{provider}/authenticate ....... oauth-authenticate › OauthController@authenticateGET auth/{provider}/redirect .................................. OauthController@redirectedGET auth/{provider}/register ................... oauth-register › OauthController@register
Lychee