---
title: "set_database_size"
description: "Generated reference for the management action set_database_size: its description, access metadata, payload contract, and registration status."
slug: /reference/actions/set-database-size
order: 17
visibility: public
redirects_from: []
---

# set\_database\_size

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

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

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

Move your application's production database to a dedicated size or back to shared\. Call only when its owner asks\. Ask for any size they have not chosen\. If nobody can answer, change nothing and report\. Returns 202 with a pending action for browser approval\. A decline or expiry changes nothing\.

Approval starts the copy, switch and production redeploy\. Production is unavailable from freeze until redeploy succeeds or a revert restores the source\. Production deploys and promotes are refused `database_move_in_flight` until the whole move ends, including server creation\. Repeat afterward\. Development stays shared\. Charge is priced when the server is ready, before production pauses, for days left this month\. A failed move keeps it, and that month's line covers a repeat of the size\.

A successful `read_approval_status` outcome confirms the start\. Use `read_status` with `wait_seconds` for production's `database_move.outcome`: null while unfinished, then `done` or `reverted`\.

## More about this action

The `size` argument chooses `database-shared`, `database-dedicated-2gb`, `database-dedicated-4gb` or `database-dedicated-8gb`\. The database stays in its cell\. Moving between dedicated sizes creates a new server; only production moves, and development stays shared\.

A dedicated size requires an estate that serves dedicated databases\. An unbilled account may use any dedicated size\. A billed account may use only those the `dedicated-database-sizes` setting lists; its empty default opens none\. `database_size_not_open` lists the dedicated sizes open, or says none are open, and creates no pending action\. The dedicated\-size setting does not restrict a move back to shared\.

The move freezes production, copies the database and checks the restored table counts, switches its connection and redeploys production\. Production is unavailable from freeze until redeploy ends deployed, or a revert lifts the freeze on the source\. Production deploys and promotes are refused `database_move_in_flight` until the whole move ends, including server creation\. Repeat them after it ends\. The production password, host and connection quantity change; moving to a dedicated size changes the port only where production previously used the pooled port\. Dedicated\-to\-dedicated moves and unlimited applications keep the direct port\. On a move back to shared, the port stays direct until the next promote or production deploy of a version that recorded the pooled port\.

The application, its hostname, environments, role and database identifiers, code, setting identifiers, development database and files stay\. A new move removes an earlier move's kept copy first\. Charge is priced when the new server is ready, before production pauses, for days left this month\. A failed move keeps it; that month's line covers a repeat of the size\. An unbilled account's line, and a line before the charging switch, is recorded without drawing the balance\. No credit is returned for a size left\.

Pass `request_id` to make a repeat safe\. While the earlier pending action is requested, approved or executing, the same account and `request_id` return it again\. Once it has ended, that identifier starts a new pending action\. A decline or expiry changes nothing\.

Read `read_approval_status` for the pending action\. Its successful outcome gives `application`, `size`, `previous_size`, and `move` with its `id`, initial `phase` and `started_at`, plus `detail`\. That outcome confirms the move started; it does not report the move's completion\. Then call `read_status` with `wait_seconds` and read production's latest `database_move`\. Its `outcome` is null while unfinished, then `done` or `reverted`; `ended_at` gives when it ended\.

`account_paused` refuses this act while the account is paused\. Wait until the reset instant in the detail, or ask support for an operator move back to shared\. `not_found` means there is no production database; `no_such_application` means the id is absent from your account\. `deploy_in_flight` means a production version is in flight; wait for that version to end\. `database_move_in_flight` means a move is unfinished; wait for it to end\.

`server_unavailable` means no shared server in the cell admits the move back\. `dedicated_capacity` means the cell, region or concurrent\-move bound is full; ask support for room, or repeat after another move ends\. `cell_move_in_flight` means a cross\-cell move is unfinished; wait for it to end\. `balance_short` means the usage balance is not more than the new charge; repeat when it is\. `rates_unread` means a new charge needs rate rows or a charging switch instant that could not be read; repeat shortly\. Each refuses this act before a new move starts\. At prepare, a repeated redeploy or charge check can refuse a started move, including with `balance_short` or `rates_unread`, without freezing production or charging; `read_status` then reports `database_move.outcome: reverted` with no reason member\.

`database_too_large_to_move` gives the database's bytes and the act's move bound\. Ask support for an operator move at an agreed time\. `invalid_request` covers a size outside the four values, a size production already has, or a dedicated size for a serverless application\. A serverless application stays `database-shared`; a dedicated size needs a server application\. A refused request creates no pending action and changes no database\.

## Access and action metadata

```json
{
  "name": "set_database_size",
  "resource": "application",
  "tier": "destructive",
  "surface": "tzcloud",
  "addresses": [
    "tzcloud"
  ],
  "product": "cloud",
  "summary": "Move your application's production database to a dedicated size or back to the cell's shared server. Returns 202 with a pending action for browser approval. Approval starts the copy, switch and production redeploy. Production is interrupted, and production deploys and promotes are refused `database_move_in_flight` until the whole move ends; repeat them afterward. Development stays shared. A decline or expiry changes nothing. A dedicated size can start a monthly charge.",
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "openWorldHint": true
  }
}
```

## MCP catalog entry

```json
{
  "name": "set_database_size",
  "title": "Change database size",
  "tier": "destructive",
  "scenario": "API-L0-31",
  "summary": "Move your application's production database to a dedicated size or back to shared. Call only when its owner asks. Ask for any size they have not chosen. If nobody can answer, change nothing and report. Returns 202 with a pending action for browser approval. A decline or expiry changes nothing.\n\nApproval starts the copy, switch and production redeploy. Production is unavailable from freeze until redeploy succeeds or a revert restores the source. Production deploys and promotes are refused `database_move_in_flight` until the whole move ends, including server creation. Repeat afterward. Development stays shared. Charge is priced when the server is ready, before production pauses, for days left this month. A failed move keeps it, and that month's line covers a repeat of the size.\n\nA successful `read_approval_status` outcome confirms the start. Use `read_status` with `wait_seconds` for production's `database_move.outcome`: null while unfinished, then `done` or `reverted`.",
  "owners": [
    "API-L0-31"
  ]
}
```

## request

| JSON pointer | Description and constraints |
|---|---|
| "" \(root\) | Type: object<br>Required fields: \["application","size"\] |
| /<wbr>properties/<wbr>application | Your account's application id from `list_applications`; only its production database moves\.<br><br>Type: string |
| /<wbr>properties/<wbr>size | The production database size to move to\. A dedicated size uses its own server; `database-shared` moves back to the cell's shared server\. Development stays shared\.<br><br>Type: string<br>Allowed values: \["database\-shared","database\-dedicated\-2gb","database\-dedicated\-4gb","database\-dedicated\-8gb"\] |
| /<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 pending record with `read_approval_status`\. Approval starts a database move; the successful outcome records its start, not its completion\. A decline or expiry changes nothing\.<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 | The pending action requiring a person's browser approval\. Its successful outcome describes the database move that started\.<br><br> |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>0 | $ref: \#/shapes/pending\_action |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1 | Type: object |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome | On successful approval execution, records the move that was started, not its completion\. A failed execution carries its refusal instead\.<br><br>Type: \["object","null"\] |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>application | The application id whose production database move started\.<br><br>Type: string |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>size | The requested production database size\.<br><br>Type: string<br>Allowed values: \["database\-shared","database\-dedicated\-2gb","database\-dedicated\-4gb","database\-dedicated\-8gb"\] |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>previous\_size | The production database size read before this move started\.<br><br>Type: string<br>Allowed values: \["database\-shared","database\-dedicated\-2gb","database\-dedicated\-4gb","database\-dedicated\-8gb"\] |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>move | The move at its start; this is a snapshot, not a progress read\.<br><br>Type: object<br>Required fields: \["id","phase","started\_at"\] |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>move/<wbr>properties/<wbr>id | The identifier of the database move that started\.<br><br>Type: string |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>move/<wbr>properties/<wbr>phase | The move's phase when its start was recorded\.<br><br>Type: string |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>move/<wbr>properties/<wbr>started\_at | The UTC instant the move's first record was created\.<br><br>Type: string<br>Format: date\-time |
| /<wbr>properties/<wbr>pending\_action/<wbr>allOf/<wbr>1/<wbr>properties/<wbr>outcome/<wbr>properties/<wbr>detail | Says the database move started and continues after this call; deploys and promotes wait until it ends\.<br><br>Type: string |
| /<wbr>properties/<wbr>approval\_url | Open this link in the browser for the person to approve or decline the pending action\.<br><br>Type: string |
| /<wbr>properties/<wbr>detail | Says a destructive action completes only through browser approval, directs you to give the person the link, and points to `read_approval_status` for the outcome\.<br><br>Type: string |

## Complete payload contract

```json
{
  "request": {
    "type": "object",
    "required": [
      "application",
      "size"
    ],
    "properties": {
      "application": {
        "type": "string",
        "description": "Your account's application id from `list_applications`; only its production database moves."
      },
      "size": {
        "type": "string",
        "enum": [
          "database-shared",
          "database-dedicated-2gb",
          "database-dedicated-4gb",
          "database-dedicated-8gb"
        ],
        "description": "The production database size to move to. A dedicated size uses its own server; `database-shared` moves back to the cell's shared server. Development stays shared."
      },
      "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 pending record with `read_approval_status`. Approval starts a database move; the successful outcome records its start, not its completion. A decline or expiry changes nothing.",
    "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": {
        "allOf": [
          {
            "$ref": "#/shapes/pending_action"
          },
          {
            "type": "object",
            "properties": {
              "outcome": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "On successful approval execution, records the move that was started, not its completion. A failed execution carries its refusal instead.",
                "properties": {
                  "application": {
                    "type": "string",
                    "description": "The application id whose production database move started."
                  },
                  "size": {
                    "type": "string",
                    "enum": [
                      "database-shared",
                      "database-dedicated-2gb",
                      "database-dedicated-4gb",
                      "database-dedicated-8gb"
                    ],
                    "description": "The requested production database size."
                  },
                  "previous_size": {
                    "type": "string",
                    "enum": [
                      "database-shared",
                      "database-dedicated-2gb",
                      "database-dedicated-4gb",
                      "database-dedicated-8gb"
                    ],
                    "description": "The production database size read before this move started."
                  },
                  "move": {
                    "type": "object",
                    "required": [
                      "id",
                      "phase",
                      "started_at"
                    ],
                    "description": "The move at its start; this is a snapshot, not a progress read.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "The identifier of the database move that started."
                      },
                      "phase": {
                        "type": "string",
                        "description": "The move's phase when its start was recorded."
                      },
                      "started_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The UTC instant the move's first record was created."
                      }
                    }
                  },
                  "detail": {
                    "type": "string",
                    "description": "Says the database move started and continues after this call; deploys and promotes wait until it ends."
                  }
                }
              }
            }
          }
        ],
        "description": "The pending action requiring a person's browser approval. Its successful outcome describes the database move that started."
      },
      "approval_url": {
        "type": "string",
        "description": "Open this link in the browser for the person to approve or decline the pending action."
      },
      "detail": {
        "type": "string",
        "description": "Says a destructive action completes only through browser approval, directs you to give the person the link, and points to `read_approval_status` for the outcome."
      }
    }
  }
}
```

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