Full documentation for the Scripting API is now available as part of the Toolbox Guide:
including basic information about how to use the API, real world examples of how it can be used, and documentation with examples for every API function.
The Scripting API is a new feature in 5.2, which is available as a beta for anyone to test now:
As with all betas there may be instability or issues (do email us to let us know!) so we don’t recommend running it as a part of any business-critical system.