The Java API allows access to EA:s "Object Model," which is also accessible from C# and from in-EA scripts (which can be written in VBScript, JavaScript or JScript). Through this Object Model you can retrieve and update information in an EA repository.
There is also an "Add-In Model" which, in addition to the Object Model functionality, allows your code to respond to a number of events triggered when the user connects to a repository, creates a diagram, initiates model validation, etc, and also allows you to add your own GUI elements to EA. This Add-In Model is only available through .NET.
Check the help file under Automation and Scripting - Enterprise Architect Object Model. The necessary setup is documented in Using the Automation Interface, and the API in Reference.