Export or delete your account #

View this page as Markdown

On this page

Prompt: export your data

Help me export my account data.

Prompt: delete your account

Show me how to delete my account.

Also works:

  • "Save a copy of my account's declarations."
  • "Export my app's production database."
  • "What does deleting my account remove?"

Save your account's records, including its product records, with export_account under your own sign-in. Export each application's database and files with tzcloud_request_export. If your account holds tzMesh, export its participants, channels and messages separately with tzmesh_export. Keep the exports before requesting deletion on the website’s Account & security page. Deletion requires your approval in a browser signed in to the same account.

What your AI does #

  • Reads and follows the delete-account skill (read_context, id skill:delete-account) before calling export_account, including when you only want an export.
  • Saves the account, application and tzMesh exports in a private folder outside your project and repository.
  • Asks you to request deletion on the website’s Account & security page. Nothing is deleted until you approve in a browser signed in to the same account.

What you need #

  • For a deletion, first save the export somewhere you choose. Then sign in to a browser with the same account. Only a browser signed in to that account can approve the deletion.

Before your AI starts #

For your AI assistant. Check the following before starting.

  • A connected, signed-in AI assistant (Connect your AI assistant).
  • From tzcloud_list_applications: the applications that hold a database or stored files, and the environments each one uses.
  • For a shutdown, ask whether to delete the named app first or close the account once the copies are safe. Ask which other projects need to stay open.

Steps #

Read skill:delete-account first. Then call export_account. If the export is partial, follow the advice below for its cause before retrying. Follow step 2 to export each application and environment holding data. Download each export once it is completed.

If your account holds tzMesh, call tzmesh_export and save that copy separately. The account export contains no tzMesh data. If the account has a deletion lock, lift it before requesting deletion. Last, request deletion on the website’s Account & security page and approve it in the browser. Your AI assistant cannot request account deletion through its MCP connection.

1. Export #

export_account takes no arguments. It returns the account's saved configuration and the records listed below as one JSON document under export, with a read_at time. The document contains:

  • the account record and product profiles;
  • applications with their manifests, sizes and environment names, plus the serving version and deployment state of production;
  • the settings of each end-user realm, without its users, with the count of registered devices by platform;
  • each environment's push configuration, with the provider identifiers and secret names, without the secret values;
  • the storage areas and upstreams you declared, and your secret names, without their values;
  • your token records, without the token values;
  • saved picture records in images, with each picture's name, size, creation time and retention deadline. The export includes neither the image file nor a download link;
  • your feedback, where the platform runs its issue service. This holds your own reports with their histories and comments, and the signals and asks lists. Those two lists are empty. spaces holds your own filings from each issue space you have, your account's own spaces and each application's. Without the issue service, the export leaves this member out;
  • your tzTrack records, as tztrack, under your own sign-in, where you hold tzTrack and the platform runs its issue service. spaces holds each of your account's own issue spaces whole: every issue, comment, landing, build, and check in it, whoever filed it. The signals and asks lists are empty. Each issue and check has lease set to null because the export leaves out temporary holds from next. A pause for a used-up balance does not stop this export.

The account export contains no tzMesh data. If your account holds tzMesh, use tzmesh_export separately for your participants, the channels they belong to, and their messages. That copy can include what other people wrote. On the owner's signed-in connection, leave out as to export the whole account. An agent sign-in gives that participant's copy.

The account export lists saved account images as metadata, without the image files. To keep the images, download them separately before deleting your account.

The export is not a snapshot taken at one moment. It reads these records one after another, so a change made while it runs may show in some parts only. read_at is when the export was stamped, just after it read the account record.

If a product cannot be read, the export still returns everything else and says what is missing. partial is true, and products_not_read names tztrack. Both fields appear at the top of the response and inside export, so the saved file shows what was missing. tztrack here also covers your feedback; where only that read failed, detail names your feedback.

When detail says sign_in_required, repeat the export under your own sign-in. Waiting with the same credential will not fill those product records. The tzTrack bullet above describes what your own sign-in can read.

Keep the partial copy and read detail before trying again. After a temporary outage, try again after a short wait. A space or account too large for the read's bounds can stay partial on every repeat; waiting does not remove that bound. Check what your copy is missing before deleting the account.

2. Export each application's data #

export_account leaves out application code, database contents, and stored files. Keep a copy of your application's source. The platform keeps the image it builds from your artifact to run the application. You cannot download that image. The rules below describe how long an uploaded ZIP stays in storage.

Keep your own copies of these items.

  • Source code, migration files and original assets from your project.
  • Any secret values or credentials you still need, from your secure records or their issuers.
  • End-user records you are allowed to keep, from your own records.

A zip deployed with artifact stays a stored file in your own storage area. A zip uploaded through tzcloud_deploy's upload form stays in the application's deploy area until the deploy that read it ends. A zip that no deploy reads stays until a later deploy's upload replaces it, or until the platform's daily cleanup deletes it once it is more than a day old.

To export an application's database and stored files, your AI assistant calls tzcloud_request_export. Each call covers one application and one environment. Where you give no environment, it exports production.

To start an export, call tzcloud_request_export with application and optionally environment, leaving out download, export, and local_path. Use the download form below once the export is complete.

{
  "application": "<application id>",
  "environment": "production"
}

It returns 202 at once with the export's export id, the state running, and next, the tzcloud_read_export call to make. If an export of the same application and environment is still running, the call returns that export with repeated: true and starts no second one. Record the application, environment, and export ID. Call tzcloud_read_export with the application and export ID until the state is completed or failed. If it fails, read outcome, detail, and any manifest before deciding whether to start a new export.

{
  "application": "<application id>",
  "export": "<export id>"
}

When the export is completed, call tzcloud_request_export with download: true and the export id and run the returned line, as Download the export shows.

The export writes its files to the application's export area, export-<application id>, in a folder named after the export id:

  • each database table as one CSV file with a header line, <export id>/database/<table>.csv;
  • a manifest, <export id>/manifest.json, which tzcloud_read_export also returns.

The manifest lists each table's file, columns, and row count. It also lists each file in the application's other storage areas, with its size and version. It leaves out the deploy area, deploy-<application id>. A new export of the same application and environment first deletes the folders of earlier exports.

If manifest is null after the run ends, the read could not return the manifest. The file may be missing, or the platform may have been unable to read or parse it. Read the export’s state and outcome before trying to download it.

Each of the two parts is consistent on its own:

  • The database is read in one repeatable-read transaction, a read that sees every table at the same moment. So every table is as it was at the manifest's database.read_at.
  • The stored files are listed, not copied. If a download returns a different version (its ETag) from the one the manifest lists, the file changed after the listing. The download keeps the version it received and marks the file as changed since the listing.

The export's files count toward the application's stored-data limit from the next daily check, so delete them once you have them. Uploads stop if the files take the application over that limit. They resume when you delete files and the next check finds it within the limit (Size and usage). File storage is charged daily; read its rate on the pricing page, or call read_rate_card.

If a table's CSV file would pass 16 GiB, the export ends failed with table_bound_exceeded, and an available manifest names the table and the bound. Retrying an unchanged export will hit the same bound if the table still produces a CSV larger than 16 GiB. The export reads no secret value and no end-user list.

This export gives you table CSVs. If you need a PostgreSQL archive to restore later, see Export a custom-format archive.

An export is the copy you hold yourself. For backup coverage, restore requests and the data that backups cannot restore, read Durability and backups. A promote, which applies a version to production, takes no snapshot of the production database.

Download the export #

Once the export is completed, call tzcloud_request_export with download: true, application, export, and optionally local_path. Leave out environment. The export ID selects the environment recorded when the export started. If the download request reports the files are gone and you still need a copy, start a new export and use its ID.

In this tzcloud_request_export call, local_path is the folder on your machine to write into, as an absolute path or one relative to the folder the line runs in. Your AI coding agent runs the line in the application's folder, as it runs the deploy line. So ../notes-export puts the export beside the application, so a deploy does not include it. Keep the export in a private folder outside the repository too.

{
  "download": true,
  "application": "<application id>",
  "export": "<export id>",
  "local_path": "../notes-export"
}

The response has one download command in four forms:

  • command_npx and command_npx_windows, through npx for macOS/Linux and Windows, with no global installation needed;
  • command and command_windows, the installed forms, using turnzero and turnzero.cmd.

Your AI coding agent first runs command_npx, or command_npx_windows on Windows, once, exactly as given, before the response's expires_at. Keep the returned command private until its grant expires. Running and writing lines explains what to do if npx can't run here. For this call, the installed command is:

echo <grant> | turnzero export download --origin https://dev.turnzero.ai --export <application id>/<export id> --path "../notes-export"

The line passes a download grant, a kind of transfer grant, to the turnzero command. The grant is in the line and nowhere else in the response. Until the response's expires_at, five minutes after minting by default, it reads, by name, this export's own files and the application's stored files in the exported environment. It lists nothing and writes nothing, a read does not use it up, and every other route refuses it. So no long-lived token reaches your shell.

Keep the actual command and its grant out of chat, issues and shared logs.

Of the application's stored files, the grant reads those created by the time the export listed them. The line asks for each file the manifest lists and for no other. A file that was rewritten after the export is downloaded with its newer bytes and reported as moved.

If the download response says the export recorded no time for its list of stored files, the grant reads only the export's own files. To download the application's stored files, start a fresh export for the same application and environment.

A file first stored after the export is in no manifest, so the line does not read it and counts nothing for it. A file deleted and stored again after the export is in the manifest but is not downloaded. Its read returns 404 no_such_file, as a name with no file does, and the line counts it as a failed file. A new export has the application's files as they are now.

The command reads the export's manifest, then each file it lists, four at a time. It writes manifest.json, each table as database/<table>.csv, and each stored file as files/<area>/<name>.

Each file is written under a temporary name first. It takes its final name only once every byte has arrived, so a half-written file never has its final name. If your computer's file system would refuse or change a file name, the command writes the file under an escaped, safe form of the name and prints it. A name with a . or .. path segment is a failed file, and nothing is read for it.

An index file in the folder, .turnzero-cloud-export.json, records each finished file, and a second run skips every file it records whose size on disk matches. If the platform returns 429 rate_capped, the command waits for the next minute and reads again. It waits for at most five minutes in one run.

Give local_path a folder outside your application's folder, so that no deploy zips the export. Without local_path, the line writes a new folder, export-<export id>, in the folder it runs in, and it refuses to run in a folder that has a package.json.

Use a new, empty folder for the first download. To resume, use the same folder and export ID. The command refuses a folder that already holds files but has no index for this export.

A local_path with a character that tzcloud_deploy_command refuses in its own local_path is refused 400 invalid_request, and nothing is minted. The tzcloud_deploy_command reference lists those characters. The line does not expand ~: name your home folder in full.

The line ends with one of four exit statuses:

  • 0: every file the manifest lists is on disk;
  • 1: one or more files failed to download. If the closing lines report HTTP 404 no_such_file, the file was not read and repeating the line will fail for that file again. The same is true if a file was deleted and stored again after the export. In either case, call tzcloud_request_export again without download to export the files as they are now. For other file failures, run the same line before the grant expires. It reads only the files that failed;
  • 2: the run stopped before the end, as when the grant expired. Call tzcloud_request_export again with download: true, the same export, and the same local_path, and run the new line. It skips the files already on disk;
  • 3: nothing was written, for example because the grant in the line is not valid or the folder is refused.

Your own script can read the same files without the command. It sends GET /storage/v0/areas/<area>/files/<name> with a minted token, and sets the x-turnzero-cloud-environment header to the exported environment. The database files are in the export area. Each other file is in its own storage area.

3. Delete #

Before you start a deletion request, confirm the account and which apps the request covers. Open the private folder where you saved the account and any tzMesh exports. Check the downloaded database and file copies against the manifest for each app and environment. Resolve missing products, failed downloads and changed files. If something is still missing, decide whether the copies you have are enough.

Save the exports and lift any account lock and any application locks. Then open Account & security on the website. Choose Request account deletion, then Start request to open the approval page. The page does not export your data first. Your AI assistant cannot request account deletion through its MCP connection.

If Account deletion is blocked lists applications with locks, choose Review application lock to open each application’s page. Decide which projects should close before you approve removing their locks.

A script can call delete_account over HTTPS for its own account with an account-scoped bearer token that has the destructive class. To approve the request, choose Allow in a browser signed in to that account. Customer MCP tool lists leave out this action.

If a deletion of one of your applications is already running, the account deletion waits for it, for about six minutes at most. If deletions of several of your applications are running, it waits for all of them, for twenty minutes at most in all. A production database move that is still running also holds up account deletion, within the same twenty-minute limit. If deletion or a database move is still running when its wait ends, the account deletion stops before removing anything. Its outcome is deletion_in_progress or database_move_in_flight. Request account deletion again after the operation ends.

Before you approve, the browser page shows what the deletion removes. It names each application by label and counts each other kind: sign-in identities, product profiles, secrets, upstreams, storage areas, databases, end-user realms, issue spaces where there are any, and minted tokens.

It also says that every session ends and that you should export first, and it names what the export could not read then, including your feedback where that read alone failed. Where your account holds tzMesh, it also says the account export contains no tzMesh data. Above its buttons, the page says the deletion cannot be undone and that Turn Zero offers no way to restore what it deletes.

Each kind is deleted with everything that belongs to it:

  • each application, deleted exactly as tzcloud_delete_application deletes it, which Delete the application lists;
  • each storage area with its files, and each database with its roles;
  • each end-user realm with its users;
  • each issue-tracking space, your applications' and your account's own, with every record in it, deleted at the issue service. Its daily copies are deleted with it. A copy being written at that moment is deleted at the next daily run.

If you use tzMesh, save your tzMesh export before you approve account deletion.

Account deletion ends your tzMesh participants and removes the text of messages you sent. In conversations that remain, each message you sent stays as a placeholder. It shows no name and no content. It keeps its time, and other members can see that the same deleted sender wrote each one. Channels your account owns are deleted with everything in them, including other members' messages. A direct conversation stays for the other person.

Some things stay. The secret store keeps deleted secret values for ninety days, then purges them. No action of yours can read or restore them (Secrets). To stop a key from working, replace it at the service that issued it.

Console output from container hosting stays in the hosting provider's log store for up to thirty days; deletion and tzcloud_purge_logs do not remove it. Saved console excerpts from ended pods are deleted with the environment's log stream.

The platform's record of actions and its usage metering history keep their rows. Turn Zero accounts sign in through the builder realm. Account deletion removes that account's page views, purchases, refunds, and records of removed sign-in methods from the realm's event log. The realm keeps all other event records.

Deleting your account erases your identity from every report you filed in the platform's own feedback. It deletes no report, and each report keeps its text as written.

In spaces others shared with you, including ones you left, account deletion ends your membership and removes your account ID and byline name from your records while keeping your text. If an issue in one of those spaces was waiting for you by name, deletion removes your account ID from the recorded wait and from the issue's history.

Each deleted application leaves one record with its identifier, its retired label, and the deletion time. Its name, its manifest, and your account's identifier are cleared from that record. Deletion ends the account's services. It does not change who owns your own work, such as your source code.

Set or lift an account deletion lock #

A deletion lock protects your account against accidental deletion. It blocks account deletion while it stands. You can still export your data and use the account.

On the website, open Account & security.

  • If you see Deletion protection is off, choose Turn on deletion lock. Enter a reason of 1 to 200 characters on one line, then choose Turn on lock. The lock takes effect without a separate approval, and the page shows it.
  • If you see Deletion protection is on, the page shows the reason and when the lock was set. The account deletion control is hidden. Choose Remove lock to open its approval page. The lock stays in place until you approve its removal there.

If you signed in more than eight hours ago, each action is a link to sign in again first. Return to Account & security to continue.

To set the lock with your AI assistant, ask it to call set_account_delete_lock with a nonblank reason of 1 to 200 characters on one line. Leave out control characters, Unicode format characters such as zero-width characters, and personal details.

To set the lock, use a signed-in session or a token minted for the whole account. Lifting the lock requires a signed-in session or a whole-account token with the destructive class. A token bounded to one application cannot set or lift the lock. Setting the lock acts on the calling account only, refuses synthetic accounts, and takes effect without browser approval.

The answer includes the account identifier, changed, and delete_lock, with its reason and UTC set_at. A second set leaves the reason and time in place and returns changed: false. To check the current lock, use read_account. Its account.delete_lock is null when there is no lock.

While the lock stands, delete_account returns 409 delete_locked with the lock's reason and time, before it creates an approval request. The same check applies to an operator's request. If you set an account or application lock after requesting deletion, an attempt to approve that earlier request ends with description_changed and erases nothing.

To lift the lock with your AI assistant, ask it to call lift_account_delete_lock. It needs a signed-in session or a token with the destructive grant. Open the returned approval link in a browser signed in to the requesting account. On the Remove the deletion lock? page, check the account ID, account type, listed applications, and the lock's reason and time. Choose Keep lock to decline or Remove lock to approve the lift.

Approval lifts only the lock shown on the page. If the lock changes or disappears before the approval check, the request ends as declined with description_changed. If that happens after the check and before the lock is removed, the action ends as failed with not_locked. A new lift request when there is no lock returns 409 not_locked before it creates an approval request.

A credential with super_admin can use subject_account on the lift request to name another account. A credential without that grant cannot name another account. That request returns 403 grant_required. The person signed in to the requesting account approves the lift.

Once the lift completes, request and approve account deletion separately on the website’s Account & security page.

Expected result #

export_account returns partial, products_not_read, and export, which has read_at, partial, products_not_read, and the members account, applications, realms, push, areas, images, custody, upstreams, and tokens. It also has feedback where the platform runs its issue service. Under your own sign-in, it has tztrack where you hold tzTrack. A member the export could not read is left out, and products_not_read names its product.

images lists the pictures your account still keeps from generation without an application. Each entry has name, size, created_at, and kept_until, with no picture bytes or download links. The list is empty where none remain.

tzcloud_request_export returns 202 with export, state: "running", area, folder, and next. tzcloud_read_export returns state completed with the manifest: its database member with read_at and one entry per table, and its files member with one entry per area.

tzcloud_request_export with download: true returns export, application, environment, expires_at, command, command_windows, command_npx, and command_npx_windows. The line prints its version line, then one line that starts with downloaded: and counts the files on disk. It ends with status 0.

The website requests a pending action and opens its approval page. After you approve and deletion completes, the account’s services and sessions end. If your AI assistant loses the connection, it should report the last confirmed result and ask what you saw in the browser.

Refusals #

See the refusals reference for other platform errors.

A pending action can record description_changed, delete_locked, not_locked, deletion_in_progress, database_move_in_flight, execution_failed, or interrupted as its outcome. read_approval_status shows it.

Refusal Status Cause Remedy
invalid_request 400 A member is missing or malformed, such as no id for read_approval_status. The detail names it. Correct the named member and call again.
fresh_authentication_required 403 A change from the dashboard, such as the deletion request, came more than 8 hours after you signed in on that browser. Follow the page's Sign in again link, then repeat the change.
not_found 404 read_approval_status named a pending action that is not yours. Or tzcloud_read_export, or tzcloud_request_export with download: true, named an export the application does not have. The download form also refuses files that a later export replaced or that were deleted. Use the id the destructive call returned, or the export id from the export request. If the files are gone, call tzcloud_request_export without download and download the new export.
no_such_application 404 tzcloud_request_export or tzcloud_read_export named an application that is not your account's. Use an application id tzcloud_list_applications returns.
application_other_account 403 application names an application that belongs to another account, not the account the call is signed in as. The detail names the account the call acted as and nothing of the other one. Compare turnzero whoami --origin https://dev.turnzero.ai with read_account over your AI assistant's connection. Make the call from the one signed in to the account that holds the application.
export_not_completed 409 tzcloud_request_export with download: true named an export that is still running or failed. For a running export, call tzcloud_read_export until it is completed or failed. When completed, request its download with download: true. For failed, read outcome and detail. If it was interrupted, start a new export for the same application and environment. A new export removes earlier export files for that application and environment. For table_bound_exceeded, use bounded tzcloud_query_database reads if the manifest names the table.
transfer_grant_expired 403 The download grant expired, five minutes after minting by default, before the line read every file. The line ends with status 2 where it had read a file. It ends with status 3, with nothing written, where the grant had expired before its first read. Call tzcloud_request_export again with download: true, the same export, and the same local_path and run the new line. It skips the files already on disk.
transfer_grant_not_admitted 403 The download grant was used for something other than reading a named file of its export or its application, such as a listing. A line run as the call returned it can also be refused by this name on a stored file. Run the line as the call returned it. Where that line was refused on a stored file, call tzcloud_request_export again with download: true and the same export and run the new line. For any other request, use your signed-in session or a minted token.
no_such_file 404 The stored file is missing, or it was created after the export listed its files. An export that recorded no time for its list also returns this refusal for each listed stored file. The download counts each as a failed file. Call tzcloud_request_export again without download and download the new export, which has the application's files as they are now.
approval_expired 409 The pending action expired before you approved it in the browser. Approval requests last 24 hours by default. Check expires_at for the request's deadline. Request the action again and approve the new record before it expires.
approval_wrong_account 403 The approving browser is signed in to a different account from the one that asked. Sign in to the account that asked, then open the approval link again.
delete_locked 409 The account or one or more of its applications has a deletion lock. The refusal lists those applications in locked_applications and gives the account's delete_lock if it has one. If erasure first meets a lock after approval, the action ends failed with this error. Lift the account's lock if present and lift each listed application lock. Approve each lift in the browser before requesting account deletion again.
not_locked 409 lift_account_delete_lock found no matching lock at the request or when executing an approved lift. Nothing was lifted. For an approved lift, check read_approval_status. To check the current lock on your account, use read_account.
grant_required 403 lift_account_delete_lock named another account in subject_account, and the credential reaching the action lacks super_admin. No pending action was created. Omit subject_account to request a lift for your own account.
destructive_class_required 403 lift_account_delete_lock used a minted token without the destructive class. Use a signed-in session or a token minted with the destructive class.
token_scope_refused 403 A token bounded to one application called either account deletion lock action. Use a signed-in session or a token minted for the whole account. To lift the lock with a minted token, it also needs the destructive class.
description_changed none At approval, the platform's new description of what would be deleted differed from the one you approved. The record ends declined, and nothing ran. Request the action again and approve its current description.
deletion_in_progress 409 Another deletion of one of your applications kept running after the account deletion waited for it. The account deletion stopped without removing that application. The detail gives the application and the time its hold ends. Wait for that deletion to finish; read_approval_status or tzcloud_list_applications shows it. Then request the account deletion again.
database_move_in_flight 409 After waiting for a production database move, the account deletion stopped before removing anything. Wait for the database move to end, then request and approve account deletion again.
execution_failed none The deletion failed partway with an error that has no refusal name. The outcome identifies the part that failed, a reference to the platform's record of the error, and what was removed before it. Read the outcome and the current state, then request the action again. Any request_id, or none, starts a new pending action.
interrupted none The deletion ran for more than thirty minutes without finishing and was marked failed. Check the current state before you request and approve another attempt, because some parts may already be removed.