Use POST /v1/applications/{applicationShortId}/environments or the matching create_environment MCP tool to add a named environment with a public URL and an isProduction flag. Web and API applications are supported, matching the environments you add under Settings → Applications & Envs.
Calls are idempotent: sending the same name again returns the existing environment with created: false instead of adding a duplicate. An agent can set up an application and its environments in one workflow.
More on this: create environment API reference, MCP for coding agents and multi-environment testing.