projectID, and most need an
environment alias too. If all you have is a token, the way to find them is to
resolve upward from the project rather than listing every workspace you can
see. This recipe reads a project, the workspace that owns it, and the
environments inside it, then identifies which one is live.
Last verified 2026-08-15 by executing the recipe end to end.
The recipe
main.sh
How it works
- Get project returns the project along
with the
teamIDof the workspace that owns it, so one call gives you both halves of the identity. - Get workspace turns that
teamIDinto a name, which is the check worth making before any write: an ID alone never tells you which workspace you are about to change. - List environments returns
every environment in the project. Exactly one carries
isMain: true, and that is the one the Studio calls Production. - Environments are addressed by alias, not by ID, everywhere else in the API. See Publishing through environments.
- Every call here authenticates with a personal access token. See Authentication.