They have an example in the samples here of multi tables if you are a Python user: python tableauSDKSample.py --build --multitable
It is no way to define the join programmatically, you would need to define them in Desktop.
I hope it is helpful,
You might want to try our pre-re1lease of the new Hyper API (the successor of the Extract API). With the all-new Hyper API, Developers can now utilize full CRUD support at Hyper-speed and unleash the power of SQL to interact with .hyper files.
To get access to the pre-release, you need to join the Tableau Develop Program. If you are not part of the Developer Program yet, register here and join the “Developer Program Sprint Demos!” under “AVAILABLE OPPORTUNITIES”. Then, go here for more information on Hyper API features, supported languages and platforms.