---
title: "halt_environment"
description: "Generated reference for the management action halt_environment: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/halt-environment
order: 37
visibility: public
redirects_from: ["/reference/actions/resume-environment"]
---

# halt\_environment

Generated automatically from the [published contract sources](/cloud/reference/about/#contract-sources).

A script calls this action over HTTPS at `POST https://tzcloud.dev.turnzero.ai/v1/halt_environment`, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool `tzcloud_halt_environment`.

OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts ([Sign-in, sessions, and tokens](/cloud/concepts/sign-in-sessions-and-tokens/)).

**Build metadata:** Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.

## Contract description

Halt your deployed environment or resume it with `resume: true`\. A halt keeps the version, data, credentials and declarations\. New scheduled runs stop\. The hostname returns 503 `environment_halted` once routers refresh\. Resume restarts schedules from that instant without replaying missed runs\. A deploy ends a development halt\. Halted production refuses deploys, promotes, rollbacks and restarts until resumed\. Halting production during its deploy's image build ends that deploy\. After the build, `deploy_in_flight` refuses the halt\. A production halt needs the owner's request or consent and the account's session or a whole\-account minted token\. Development needs no ask\. A resume needed for that agreed promote or roll back is part of the same request\.

## More about this action

A production halt stops its compute\. A container app stops during the call\. For a pod, the platform records the halt and returns before it tries to stop the pod\. The hostname returns `503 environment_halted` when each router refreshes\. A router can keep using a previously saved address while it cannot refresh\. While development is halted, requests and schedules do not start its compute\. Its compute stops when idle at the latest\.

The `environment` argument: `development` or `production`\. A halt of `production` is an account action\. It is accepted under the account's session, or under a minted token scoped to the whole account\. Under a minted token bounded to one application, it is refused 403 `account_credential_required`, so that a leaked application token cannot stop production\. A halt of `development`, and `halt_environment` with `resume: true`, are accepted under either token\.

A halt is refused `deploy_in_flight` while a deploy, promote, or restart of the environment is in progress, with one exception\. A halt of `production` while a production deploy is still building its image is accepted, and it ends that deploy\. Once that deploy is past its build, the halt is refused until the deploy ends\.

If development has not been added, a halt or resume of development gives HTTP 409 `environment_not_created`\. An existing environment with no deployed version refuses a halt with `environment_never_deployed`\. A halt of an environment that is already halted returns its current state with the outcome `unchanged`\.

End a halt: the hostname responds again, every schedule of the environment restarts from the resume time, no run due during the halt is replayed, and the compute the halt stopped is started\. A resume starts production's compute\.

If the pod's scaler is missing, the resume ends the halt and restarts the schedules from the resume time\. The resume starts no compute\. The response's `detail` reports the missing scaler, and the platform logs a warning for its operator\. Call `read_status` to check the environment\. If serving compute needs to be restored, use `restart_application` to recreate it and its scaler\. A development environment of either size starts on its next request\. A resume of an environment that is not halted returns the outcome `unchanged`\. A deploy to a halted development environment also ends its halt\. The halt ends when the deploy passes its start checks\. A later build or health check failure leaves the halt cleared\. A deploy, promote, rollback or restart of halted production is refused `target_environment_halted` until you call this\.

## Access and action metadata

```json
{
  "name": "halt_environment",
  "resource": "environment",
  "tier": "reversible",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "clients": [
    "bearer",
    "browser_session"
  ],
  "product": "cloud",
  "summary": "Halt your deployed environment without deleting it: requests to its hostname are refused 503 `environment_halted`, its schedule rows leave the tick's claim, and its version, data, credentials, and declarations remain. Production's compute stops. A halted development environment serves nothing, and its compute stops when idle at the latest, for either size. A container app stops in the call, and a pod's scaler is paused at zero within about 11 seconds after it. A halt on a halted environment returns `unchanged`. A halt of production is an account action: admitted under the account's session or a minted token scoped to the whole account, and refused 403 `account_credential_required` under a minted token bounded to one application, so that a leaked application-bounded token cannot stop production; a development halt and `halt_environment` with `resume: true` keep the bounded token's admission. A halt is refused `deploy_in_flight` while a deploy, promote, or restart of the environment runs, save one case. A halt of production while a production deploy is still building its image is admitted and ends that deploy; past its build, the halt is refused until the deploy ends. With `resume: true`, the hostname responds again and every schedule row restarts from the resume instant. Production's compute starts; development of either size starts on its next request. A resume on a running environment returns `unchanged`; a deploy to a halted development environment also ends its halt.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true
  }
}
```

## MCP catalog entry

```json
{
  "name": "halt_environment",
  "title": "Halt environment",
  "tier": "reversible",
  "scenario": "CHI-L0-09",
  "summary": "Halt your deployed environment or resume it with `resume: true`. A halt keeps the version, data, credentials and declarations. New scheduled runs stop. The hostname returns 503 `environment_halted` once routers refresh. Resume restarts schedules from that instant without replaying missed runs. A deploy ends a development halt. Halted production refuses deploys, promotes, rollbacks and restarts until resumed. Halting production during its deploy's image build ends that deploy. After the build, `deploy_in_flight` refuses the halt. A production halt needs the owner's request or consent and the account's session or a whole-account minted token. Development needs no ask. A resume needed for that agreed promote or roll back is part of the same request.",
  "owners": [
    "PLD-L0-41",
    "PLD-L0-47",
    "PLD-L0-40"
  ]
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["application","environment"\] |
| /<wbr>properties/<wbr>application | Your account's application `id` from `list_applications`, not its name or label\.<br><br>Type: string |
| /<wbr>properties/<wbr>environment | A production halt needs the account's session or an account\-wide token, else HTTP 403 `account_credential_required`\. Missing development gives HTTP 409 `environment_not_created`\. A halt of an existing environment with no deploy gives `environment_never_deployed`\.<br><br>Type: string<br>Pattern: ^\(development\|production\)$ |
| /<wbr>properties/<wbr>resume | `true` ends the halt on either environment and restarts its schedules from the resume instant, without replaying runs missed during the halt\.<br><br>Type: boolean |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | The environment's halted state after your call; `unchanged` where a halt found the environment halted or a resume found it running\.<br><br>Type: object<br>Required fields: \["contract\_version","application","environment","halted","outcome","detail"\] |
| /<wbr>properties/<wbr>contract\_version | Required value: 1 |
| /<wbr>properties/<wbr>reference | The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row\. Quote it when you report the call\.<br><br>Type: string<br>Pattern: ^\[0\-9a\-f\]\{10\}$ |
| /<wbr>properties/<wbr>application | Type: string |
| /<wbr>properties/<wbr>environment | Type: string |
| /<wbr>properties/<wbr>halted | False where the environment is running, never true; otherwise the halt's instant and author\.<br><br>Type: \["object","boolean"\]<br>Required fields: \["at","by"\] |
| /<wbr>properties/<wbr>halted/<wbr>properties/<wbr>at | The instant the halt began, in UTC \(ISO 8601\)\.<br><br>Type: string |
| /<wbr>properties/<wbr>halted/<wbr>properties/<wbr>by | Who halted the environment: `developer` through `halt_environment`, or `platform` through the activity cap of the daily pass\.<br><br>Type: string<br>Allowed values: \["developer","platform"\] |
| /<wbr>properties/<wbr>outcome | Type: string<br>Allowed values: \["halted","resumed","unchanged"\] |
| /<wbr>properties/<wbr>detail | Describes the outcome\. When the call sets a halt, it explains the hostname's `503 environment_halted` response, what happens to compute, and any production deploy it ended\. When the call ends a halt, it describes the schedule restart and reports when a missing pod scaler prevented compute from starting\. If the halt state stays as it was, it says so\.<br><br>Type: string |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "application",
      "environment"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application `id` from `list_applications`, not its name or label."
      },
      "environment": {
        "type": "string",
        "pattern": "^(development|production)$",
        "description": "A production halt needs the account's session or an account-wide token, else HTTP 403 `account_credential_required`. Missing development gives HTTP 409 `environment_not_created`. A halt of an existing environment with no deploy gives `environment_never_deployed`."
      },
      "resume": {
        "type": "boolean",
        "description": "`true` ends the halt on either environment and restarts its schedules from the resume instant, without replaying runs missed during the halt."
      }
    }
  },
  "response": {
    "type": "object",
    "required": [
      "contract_version",
      "application",
      "environment",
      "halted",
      "outcome",
      "detail"
    ],
    "properties": {
      "contract_version": {
        "const": 1
      },
      "reference": {
        "type": "string",
        "pattern": "^[0-9a-f]{10}$",
        "description": "The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call."
      },
      "application": {
        "type": "string"
      },
      "environment": {
        "type": "string"
      },
      "halted": {
        "type": [
          "object",
          "boolean"
        ],
        "required": [
          "at",
          "by"
        ],
        "properties": {
          "at": {
            "type": "string",
            "description": "The instant the halt began, in UTC (ISO 8601)."
          },
          "by": {
            "type": "string",
            "enum": [
              "developer",
              "platform"
            ],
            "description": "Who halted the environment: `developer` through `halt_environment`, or `platform` through the activity cap of the daily pass (PLD-L0-41)."
          }
        },
        "description": "False where the environment is running, never true; otherwise the halt's instant and author (PLD-L0-41)."
      },
      "outcome": {
        "type": "string",
        "enum": [
          "halted",
          "resumed",
          "unchanged"
        ]
      },
      "detail": {
        "type": "string",
        "description": "Describes the outcome. When the call sets a halt, it explains the hostname's `503 environment_halted` response, what happens to compute, and any production deploy it ended. When the call ends a halt, it describes the schedule restart and reports when a missing pod scaler prevented compute from starting (PLD-L0-41). If the halt state stays as it was, it says so."
      }
    },
    "description": "The environment's halted state after your call; `unchanged` where a halt found the environment halted or a resume found it running (PLD-L0-41)."
  }
}
```

## Shared contracts

- [Refusals](/cloud/reference/refusals/): every refusal, by surface, with its cause and its remedy
- [schemas/wire\_error\.schema\.json](/cloud/reference/sources/schemas/wire-error-schema/)
- [schemas/wire\_errors\.json](/cloud/reference/sources/schemas/wire-errors/)
- [schemas/action\_payloads\.json](/cloud/reference/sources/schemas/action-payloads/) (includes shared shapes)
- [management\_api\_contract\.md](/cloud/reference/sources/management-api-contract/)
