Capture One for macOS has a robust AppleScript dictionary. This is also JXA compatible.
Accessing the Dictionary
You can access the AppleScript dictionary via the Scripts -> Open Scripting Dictionary.
Or within macOS's bundled Script Editor which is under Window -> Library, then choose Capture One 20. If you do not see it as an option, select the plus icon and choose your Capture One 20.app. If you are running Capture One 12, then choose Capture One 12.
Executing .scpt files from within Capture One
Though not absolutely necessary, it's possible to populate the Scripts menu in Capture One with your own scripts. To do so, simply save a copy of the .scpt file in ~/Library/Scripts/Capture One Scripts/. If you don't see your script in the menu, choose Scripts -> Update Scripts or restart Capture One.
You can find many resources online for starting with AppleScript or JXA. A good place to start is Apple's AppleScript Language Guide.
There is also a user-to-user forum specifically for scripting Capture One.
Why isn't my script working? What does error -1728 mean?
Due to the variety of what's possible in AppleScript, Capture One Support is unable to provide troubleshooting or help debug your script. Thus, we recommend referring to the aforementioned links.