---
title: "Pre-flight check for account deletion"
method: GET
path: "/v1/account/deletion-preflight"
tags: ["Account"]
---

# Pre-flight check for account deletion

`GET /v1/account/deletion-preflight`

## Request

- Base URL: `https://api.zindex.ai`
- URL: `https://api.zindex.ai/v1/account/deletion-preflight`
- Auth: API key in cookie `zindex_session`

Returns what will happen when the account is closed: the personal workspace's subscription, its state and the refund policy, and the team workspaces involved (teams). Requires a session cookie; it reads the signed-in user's own workspace.

## Response `200`

Pre-flight summary.

- object
  - `workspaceId` string
  - `workspaceName` string
  - `plan` string
  - `activeSubscription` object, nullable
    - `stripeSubscriptionId` string
    - `status` string
    - `currentPeriodEnd` string, date-time
    - `willBeCanceledImmediately` boolean
    - `refundPolicy` string
  - `teams` object: Team workspaces the person is in. blocking: they are its last owner and others are in it, so closing is refused until someone else is an owner or it is deleted. deletedWithAccount: they are alone in it, so it is deleted with the account, subscription included. leaving: the rest, which they leave; the diagrams they made there stay. On a leaving team the person pays for, their card is removed from it when the account closes, and youPay names the remaining owner the billing contact moves to; every remaining owner is asked to add a card.
    - `blocking` object[]
      - `id` string
      - `name` string
      - `role` 'owner' | 'member' | 'viewer'
      - `plan` string
      - `others` integer: People in it besides the person
    - `deletedWithAccount` object[]
      - `id` string
      - `name` string
      - `role` 'owner' | 'member' | 'viewer'
      - `plan` string
      - `others` integer: People in it besides the person
    - `leaving` object[]
      - `id` string
      - `name` string
      - `role` 'owner' | 'member' | 'viewer'
      - `plan` string
      - `others` integer: People in it besides the person
      - `youPay` object, nullable: Set when the person pays for this team's subscription: closing the account removes their card from it, its billing contact moves to the earliest-joined remaining owner, and the owners are asked by email to add a card before it renews. null otherwise.
        - `owner` string: The remaining owner the billing contact moves to: their name, else their email

## Other responses

- `401`: Missing or invalid API key. Response includes a `code` field that distinguishes the failure mode so clients (dashboard, MCP server) can render actionable copy: `AUTH_REQUIRED` (no key or session was sent), `API_KEY_INVALID` (key not found), `API_KEY_REVOKED` (key was revoked, or its person is no longer in its workspace), `API_KEY_EXPIRED` (key passed its expires_at), and for the site's session cookie `SESSION_EXPIRED` (past its 24 hours), `SESSION_REVOKED` (the account's sessions were ended, for example by a password reset) and `SESSION_INVALID` (not a session this server signed).
- `404`: Not found, or not yours
- `429`: RATE_LIMITED: over the request rate limit (see Rate Limiting). Wait retryAfter seconds (also the Retry-After header), then try again.

---

[API](https://skmtc.dev/zindex/apis/zindex-api.md) · [All operations](https://skmtc.dev/zindex/apis/zindex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zindex/apis/zindex-api/revisions/1d21bd5bbf8e?raw)
