create_environment
Adds one place a project runs, so Heimdall can lay down the development, staging, UAT and production rows of a new project.
Add an environment to a project: project_id and name are required; kind is development by default or one of local, qa, staging, uat, preproduction, production, custom; component_id names the component it runs (omit it when it serves the whole project); url, api_url, admin_url, branch, hosting, region, auto_deploy, protected (a deployment then needs a promotion approval), health_check_url, current_version and notes (HTML) fill in the rest. The environment is written through the same action the Environments page and the intake wizard run, and environment.created goes out.
The health is recorded by monitoring and a freeze is a release manager's call in the application; neither is written here. A staff token with environment:create on the project is needed.
Requires ability
The token behind the MCP session must hold it, or the call is refused with TOKEN_MISSING_ABILITY.
Runs the same action as
The REST endpoint and this tool share one action, so validation, permissions and events are identical.
Fires one event
Delivered to every endpoint subscribed to it once the change is made.
Annotations
A client that honours annotations asks a person before running it.
Arguments
project_id*stringUUID of the project.
name*stringWhat the environment is called, such as Staging, 2 to 60 characters.
kindstringoptionalWhat the environment is for; development by default.
localdevelopmentqastaginguatpreproductionproductioncustomcomponent_idstringoptionalUUID of the component it runs; omit when it serves the whole project.
urlstringoptionalThe address people open.
api_urlstringoptionalThe address the API answers on.
admin_urlstringoptionalThe address of the back office.
branchstringoptionalThe branch deployed there.
hostingstringoptionalWhere it runs, in words.
regionstringoptionalThe region it runs in.
auto_deploybooleanoptionalWhether the pipeline deploys to it without a hand.
protectedbooleanoptionalWhether a deployment needs a promotion approval.
health_check_urlstringoptionalThe address the scheduled health check calls.
current_versionstringoptionalThe version running there, as last recorded.
notesstringoptionalAnything the team should know, as HTML.
What it returns
{ "data": { "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b", "project_id": "7f3d1c92-8b45-4e6a-9d21-5c8e0a4b6f13", "component_id": "c0a1b2c3-d4e5-4f60-8a7b-9c0d1e2f3a4b", "name": "Staging", "kind": "staging", "url": "https://staging.example.test", "api_url": null, "admin_url": null, "branch": "develop", "hosting": null, "region": null, "auto_deploy": true, "protected": false, "health": "unknown", "health_check_url": null, "last_checked_at": null, "consecutive_failures": 0, "current_version": null, "frozen_until": null, "frozen": false, "notes": null, "position": 2, "created_at": "2026-10-28T09:20:00+00:00", "updated_at": "2026-10-28T09:20:00+00:00" }}How it fails
VALIDATION_FAILEDname missing or outside 2 to 60 characters, a kind outside the list, an address that is not a URL, a component_id that is not the project's, or a name already used for the same component.
RESOURCE_NOT_FOUNDunknown project_id, or a project outside the token's scope or the person's visibility.
FORBIDDENthe token is a client guest's, or the holder's role on the project does not carry environment:create.
TOKEN_MISSING_ABILITYtoken lacks environment:create.
How is this guide?
Last updated on