---
title: "clear_development_database"
description: "Generated reference for the management action clear_development_database: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/clear-development-database
order: 43
visibility: public
redirects_from: []
---

# clear\_development\_database

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/clear_development_database`, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool `tzcloud_clear_development_database`.

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

Clear your application's development database: drop every table and row and create it again empty under the same role\. It cannot be undone\. The development credential and environment\-file connection string keep working\. Production's database is never cleared\. Give a person `approval_url` to approve in a browser\. Read `read_approval_status` until it ends\. Rebuild only when the outcome says `cleared: true`\. If a step fails after the database drops, its data is gone\. After completion, a development deploy runs its migrations\. A server's development restart runs the serving version's migrations\. Deploy development for edited migration files\. On one environment, restart your local run\. A development deploy or restart in flight when approved fails the clear as `deploy_in_flight`, clearing nothing\.

## More about this action

Pass `request_id` to make a repeat safe\. While the earlier pending action is still live \(requested, approved, or executing\), a call with the same `request_id` from the same account returns that action and creates no second one\. Once the action has completed, failed, been declined, or expired, the same `request_id` starts a new one\.

`environment` is required and must be `development`\. Hand the person the returned `approval_url` and read the outcome with `read_approval_status`\. Read `read_approval_status` until it ends\. After completion, a development deploy runs its migrations\. A server's development restart runs the serving version's migrations\. Deploy development for edited migration files\. If you run locally, start the local run again\. For an app with one environment, use the local run\. A declined clear leaves the database unchanged\. If the clear fails after dropping the database, its old tables and rows are already gone\. Request and approve a new clear to finish with an empty database\. The clear takes no snapshot, and repeating it restores none of the old data\. A development deploy or restart in flight at approval fails the clear with `deploy_in_flight`, clearing nothing\.

## Access and action metadata

```json
{
  "name": "clear_development_database",
  "resource": "environment",
  "tier": "destructive",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Clear the development database: drop it with every table and row in it, and create it again empty under the same role. The development credential and the environment file's connection string stay valid. `restart_application` on development, or a deploy, then runs the application's migrations, which rebuild the tables. Production's database is never cleared.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": false
  }
}
```

## MCP catalog entry

```json
{
  "name": "clear_development_database",
  "title": "Clear development database",
  "tier": "destructive",
  "scenario": "CHI-L0-10",
  "summary": "Clear your application's development database: drop every table and row and create it again empty under the same role. It cannot be undone. The development credential and environment-file connection string keep working. Production's database is never cleared. Give a person `approval_url` to approve in a browser. Read `read_approval_status` until it ends. Rebuild only when the outcome says `cleared: true`. If a step fails after the database drops, its data is gone. After completion, a development deploy runs its migrations. A server's development restart runs the serving version's migrations. Deploy development for edited migration files. On one environment, restart your local run. A development deploy or restart in flight when approved fails the clear as `deploy_in_flight`, clearing nothing.",
  "owners": [
    "DBS-L0-10",
    "PLD-L0-40",
    "MAPI-05"
  ]
}
```

## 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 | `development` alone; `production` is refused `invalid_request`, because no action clears production's database\.<br><br>Type: string<br>Pattern: ^\(development\|production\)$ |
| /<wbr>properties/<wbr>request\_id | Any string you choose\. A repeat from the same account while the earlier pending action is live \(requested, approved, or executing\) returns it again; once it has ended, it starts a new one\. Omitted, every call creates a new one\.<br><br>Type: string |

## response

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | The 202 creation envelope: the pending action and its approval link\. Read the terminal outcome on the pending record with read\_approval\_status\. A completed clear's outcome carries `cleared: true`, the `application`, the `environment`, the `database` name, its `role`, and a `detail` giving the acts that rebuild the tables: a development `restart_application` or deploy where the application has development, and a new local run\. An application with no development database is refused 404 `not_found` at the request\. A development deploy or restart \(a `restart_application`\) in flight when the approved clear runs fails it with `deploy_in_flight`, and nothing is cleared\.<br><br>Type: object<br>Required fields: \["contract\_version","pending\_action","approval\_url"\] |
| /<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>pending\_action | $ref: \#/shapes/pending\_action |
| /<wbr>properties/<wbr>approval\_url | Type: string |
| /<wbr>properties/<wbr>detail | 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": "`development` alone; `production` is refused `invalid_request`, because no action clears production's database."
      },
      "request_id": {
        "type": "string",
        "description": "Any string you choose. A repeat from the same account while the earlier pending action is live (requested, approved, or executing) returns it again; once it has ended, it starts a new one. Omitted, every call creates a new one."
      }
    }
  },
  "response": {
    "type": "object",
    "description": "The 202 creation envelope: the pending action and its approval link. Read the terminal outcome on the pending record with read_approval_status (API-L0-07). A completed clear's outcome carries `cleared: true`, the `application`, the `environment`, the `database` name, its `role`, and a `detail` giving the acts that rebuild the tables: a development `restart_application` or deploy where the application has development, and a new local run (DBS-L0-10). An application with no development database is refused 404 `not_found` at the request. A development deploy or restart (a `restart_application`) in flight when the approved clear runs fails it with `deploy_in_flight`, and nothing is cleared.",
    "required": [
      "contract_version",
      "pending_action",
      "approval_url"
    ],
    "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."
      },
      "pending_action": {
        "$ref": "#/shapes/pending_action"
      },
      "approval_url": {
        "type": "string"
      },
      "detail": {
        "type": "string"
      }
    }
  }
}
```

## 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/)
