# Deleting and restoring

## Summary

An organization can be deleted, and so can a single workspace. Both work the
same way, in two stages:

1. **Deleted.** The organization or workspace disappears for everyone at
   once. Nothing is thrown away yet. For 30 days it can be restored, exactly
   as it was.
2. **Removed for good.** After the 30 days everything in it is permanently
   deleted. This cannot be undone.

Deleting an organization is for its owners. They must have a verified email
address and type the organization's name. Restoring is for owners too.

This page describes the organization in full. Workspaces follow the same
model with a few differences, which are listed at the end and described in
full in [Workspaces](workspaces.md#deleting-a-workspace).

Deleting your own account is a different thing. See
[Deleting an account](../accounts/delete-account.md).

## Who can do what

| Action | Owner | Admin | Member | Verified email | Session | Credential |
| --- | --- | --- | --- | --- | --- | --- |
| Delete the organization | Yes | No | No | Required | Yes | No |
| See a deleted organization | Yes | No | No | No | Yes | No |
| Restore a deleted organization | Yes | No | No | No | Yes | No |
| Delete a workspace | Yes | Yes | No | Required | Yes | No |
| List deleted workspaces | Yes | Yes | No | No | Yes | No |
| Restore a deleted workspace | Yes | Yes | No | No | Yes | No |

- The roles are organization roles. A member who is owner of a single
  workspace cannot delete or restore it.
- Any owner can delete the organization, and any owner can restore it. It
  does not have to be the same person.
- A credential never deletes or restores. It gets `403 FORBIDDEN` with
  `details.reason` `SESSION_REQUIRED`.
- Removal for good is done by Talewright when the 30 days are over. Nobody
  can trigger it earlier, and nobody can stop it except by restoring in
  time.

## How it works

### Deleting an organization

- Only an owner deletes an organization.
- The owner's email address must be verified.
- The request must repeat the organization's name in `confirmName`, exactly
  as it is. The comparison is exact: upper and lower case and spaces count.
  This keeps a stray request from deleting an organization.
- The answer is `202` with `purgeAfter`, the moment the organization is
  removed for good. It is 30 days after the deletion.
- No email is sent to anyone.
- The organization does not need to be empty. It is deleted with every
  workspace, file and member in place.

The checks happen in this order. The first that fails decides the answer:

1. Not signed in: `401 UNAUTHENTICATED`.
2. The organization is unknown or already deleted, or you are not a member:
   `404 NOT_FOUND`.
3. You are an admin or member: `403 FORBIDDEN`.
4. Your email is not verified: `403 EMAIL_NOT_VERIFIED`.
5. `confirmName` is not the organization's name: `422 VALIDATION_FAILED` on
   `confirmName`.
6. Otherwise it is deleted: `202`.

### What stops at once

From the moment of deletion:

- **Workspaces.** Nobody can open any workspace of the organization. That
  includes its owners. Every request for a workspace or anything in it
  answers `404 NOT_FOUND`.
- **Admins and members.** The organization no longer exists for them. It
  leaves their lists, and every request about it answers `404 NOT_FOUND`,
  the same as for an organization that never existed.
- **Owners.** They still see the organization in their list, with
  `deletedAt` and `purgeAfter`, and can read it. Reading shows its name,
  their role and no workspaces. They can do exactly one thing with it:
  restore it.
- **Everything else about the organization is refused**, for owners too:
  renaming, creating workspaces, inviting, changing roles, removing members,
  leaving, exporting, and reading its members, invitations or exports. All
  answer `404 NOT_FOUND`.
- **API keys and connected apps.** Every credential of the organization
  stops working. Requests with one answer `401 UNAUTHENTICATED`. The
  credentials are not revoked: they are suspended with the organization.
- **Public links.** Every public link to a file or folder of the
  organization stops working.
- **Signed download links and archive links** handed out before the
  deletion stop working.
- **Invitations.** Pending invitation links answer `400 TOKEN_INVALID`.
  Nobody can join a deleted organization.
- **The organization folder** is unreachable, like the workspaces.

### What is kept during the 30 days

Nothing is deleted yet. All of this is kept exactly as it was:

- the organization's name and ID,
- every member and their role,
- every workspace, with its members,
- every file, version, folder and tag, in every workspace and in the
  organization folder, including what was in the trash,
- the file statuses and fields,
- every public link address,
- pending invitations,
- API keys and connected apps,
- exports.

Some clocks keep running while the organization is deleted:

- A pending invitation still expires 7 days after it was sent.
- A ready export still expires 7 days after it became ready.
- An API key still expires on its own date.
- A workspace that had been deleted on its own before still reaches its own
  30 days.
- A file that was in the trash still reaches the end of its own trash
  period, and is then deleted for good. See
  [Trash and restore](../files/trash.md).

Deleting does not sign anyone out. Members keep their accounts, their
sessions and their other organizations.

### The restore window

- A deleted organization can be restored for 30 days.
- The deadline is `purgeAfter`. It is set at the moment of deletion and
  never sooner than 30 days after it.
- Until the deadline, owners see the organization marked as deleted, with
  the date.
- At the deadline, restoring stops being possible and the organization
  leaves its owners' lists, whether or not it has been removed yet.
- The window cannot be extended. Restoring and deleting again starts a new
  30 days.
- The window cannot be shortened. There is no way to remove an organization
  for good before the deadline.

### Restoring an organization

- Only an owner restores, and only before the deadline.
- A verified email is not needed, and the name does not have to be typed.
- The answer is `200` with the organization, live again.
- A restore brings back everything that was kept:
  - every workspace opens again for the people who could open it before,
  - every member has the role they had,
  - every file, version, folder and tag is there,
  - API keys and connected apps work again, unless they expired meanwhile,
  - public links work again at the same addresses,
  - signed download links from before the deletion work again until they
    expire on their own,
  - pending invitations work again, unless they expired meanwhile,
  - ready exports can be downloaded again, unless they expired meanwhile.
- A file that came to be public while the organization was deleted gets its
  public link at the restore.
- A workspace that had been deleted on its own is not restored by restoring
  the organization. It stays in the list of deleted workspaces with its own
  deadline.
- No email is sent.

The checks happen in this order:

1. Not signed in: `401 UNAUTHENTICATED`.
2. The organization is unknown, not deleted or past its deadline, or you are
   not one of its owners: `404 NOT_FOUND`. For its admins and members a
   deleted organization does not exist.
3. Otherwise it is restored: `200`.

### Removal for good

Shortly after the deadline, Talewright removes the organization for good.
This removes:

- the organization itself,
- every membership and role,
- every workspace, including workspaces that were deleted on their own,
- every file and every version, in every workspace and in the organization
  folder, together with the stored content,
- every folder, tag, upload and organization folder suggestion,
- the file statuses and fields,
- every pending invitation,
- every export and its archive,
- every API key and connected app of the organization.

It does not remove:

- the accounts of its members. They keep their accounts, sessions and other
  organizations.
- anything of any other organization.
- the audit trail entries about the organization. See
  [Audit trail](../reference/audit-trail.md).

Removal for good cannot be undone. A restore after it answers
`404 NOT_FOUND`.

### Owners while an organization is deleted

- Membership of a deleted organization is frozen. Nobody can be added,
  removed or given another role, and nobody can leave.
- Every owner of the organization keeps the right to restore it.
- An owner who deletes their account leaves the deleted organization like
  any other. If they were its only owner, nobody is left who can restore it,
  and it is removed for good at its deadline. The rule that an organization
  always has an owner protects live organizations only. See
  [Members and roles](members-and-roles.md#the-last-owner-rule).
- An owner cannot delete their account while they are the only owner of a
  live organization. Deleting that organization first is one way to make
  account deletion possible, and it is allowed on purpose: the organization
  is then purged when its 30 days end, and nobody can restore it.

### Workspaces: the same model

Deleting and restoring a workspace works like deleting and restoring an
organization. The full rules are in
[Workspaces](workspaces.md#deleting-a-workspace). The differences:

| | Organization | Workspace |
| --- | --- | --- |
| Who deletes | Owners | Owners and admins of the organization |
| Who restores | Owners | Owners and admins of the organization |
| Verified email to delete | Required | Required |
| Name to confirm | The organization's | The workspace's |
| Who still sees it while deleted | Owners, in their organization list | Owners and admins, under "Deleted workspaces" |
| Can the last one be deleted | Yes | No. An organization keeps at least one live workspace (`409 CONFLICT`, reason `LAST_WORKSPACE`) |
| Name while deleted | Kept. Organization names are not unique | Free for a new workspace |
| Restore refused for the name | Never | While a live workspace has its name (`409 CONFLICT`, reason `NAME_TAKEN`) |
| Credentials while deleted | All of the organization's answer `401` | Still valid, but cannot reach the deleted workspace |
| Restore window | 30 days | 30 days |
| Answer when deleting | `202` with `purgeAfter` | `202` with `id`, `name`, `deletedAt`, `purgeAfter` |

How the two combine:

- Deleting an organization hides all its workspaces. Restoring it brings
  back the workspaces that were live when it was deleted.
- A workspace that was already deleted keeps its own deadline. Deleting or
  restoring the organization does not move it.
- A deleted workspace cannot be restored while its organization is deleted.
  Restore the organization first.
- If the organization is removed for good, its deleted workspaces go with
  it, whatever their own deadlines were.
- If a deleted workspace reaches its own deadline while the organization is
  deleted, it is removed for good on its own.

## In the app

### Deleting the organization

**Settings > Organization > Delete organization** is shown to owners only.

1. The section "Delete organization" says "Everyone loses access to {name}
   and its {n} workspaces at once. Owners can restore it for 30 days; after
   that its workspaces, files and exports are deleted for good." With one
   workspace it reads "and its workspace".
2. Type the organization's name into "Confirm organization name". The hint
   reads `Type "{name}" to confirm.`
3. "Delete organization" stays disabled until the field holds the name
   exactly.
4. After deleting, the app shows "{name} deleted. Owners can restore it
   until {date}." The page now shows the organization as deleted.

- A wrong name shows "Type the organization's name exactly."
- If your email is not verified, the page shows "Verify your email": "To
  delete this organization, first open the link we sent to {address}." with
  the button "Resend verification email". After resending it says
  "Verification email sent. Check your inbox." Nothing is deleted.
- An admin or member does not see the link to this page. If they open its
  address, it says "Only owners can delete the organization."

### A deleted organization in the app

For an owner:

- The organization stays in the settings organization picker and in
  **Settings > Organizations**, with the label "Deleted".
- Its settings navigation shows only "General".
- Its page shows the name, the label "Deleted" and "Your role: Owner".
- In place of the usual sections it shows "Restore organization": "{name}
  was deleted. Nobody can open its workspaces. Unless an owner restores it,
  it and all its files are deleted for good on {date}."
- Its workspaces are gone from the workspace switcher. Their pages show "Not
  found".
- If it was their only organization, home shows "Set up your organization"
  with the line "{name} was deleted. Restore {name} until {date}."

For admins and members:

- The organization is gone from the switcher, the picker and the list.
- Its pages show "Not found".
- Someone who has one of its workspaces open reads "You no longer have
  access to {workspace}" at their next action and is taken home.
- Someone who has its settings open reads "You no longer have access to
  {organization}" at their next action and is taken home.
- Home opens a workspace of another organization, or "Set up your
  organization" when they have no other.

### Restoring the organization

1. Open the deleted organization from the picker, from **Settings >
   Organizations** or from the "Restore {name}" link on "Set up your
   organization".
2. Choose "Restore organization".
3. The app shows "{name} restored". The usual sections, the workspaces in
   the switcher, the files and the members are back.

- After the deadline: "This organization can no longer be restored."
- For any other failure: "Could not restore the organization. Try again."

### Workspaces in the app

Deleting a workspace, the "Deleted workspaces" list and "Restore" are
described in [Workspaces](workspaces.md#deleting-a-workspace-in-the-app).

## For agents

No delete or restore operation is open to a credential, and none is an MCP
tool. An agent cannot delete an organization or a workspace, and cannot
restore one.

| Operation | Capability ID | Access |
| --- | --- | --- |
| `DELETE /v1/organizations/{organizationID}` | `organizations.delete` | session only |
| `POST /v1/organizations/{organizationID}/restore` | `organizations.restore` | session only |
| `DELETE /v1/workspaces/{workspaceID}` | `workspaces.delete` | session only |
| `POST /v1/workspaces/{workspaceID}/restore` | `workspaces.restore` | session only |
| `GET /v1/organizations/{organizationID}/deleted-workspaces` | `organizations.deleted_workspaces.list` | session only |

### What the organization operations take and return

Delete takes the name and answers `202`:

```json
{ "confirmName": "Acme" }
```

```json
{ "purgeAfter": "2026-12-01T10:00:00Z" }
```

Restore takes no body and answers `200` with the organization, as
`GET /v1/organizations/{organizationID}` returns it, with `deletedAt` and
`purgeAfter` back to `null`.

While it is deleted, an owner reads:

```json
{
  "id": "01928f3e-7c1a-7d2b-9a41-3f0c2d9e8b17",
  "name": "Acme",
  "role": "owner",
  "createdAt": "2026-10-01T09:30:00Z",
  "deletedAt": "2026-11-01T10:00:00Z",
  "purgeAfter": "2026-12-01T10:00:00Z",
  "workspaces": []
}
```

In the owner's organization list, the deleted organization's
`workspaceCount` is the number of workspaces a restore brings back.

### What an agent sees

- When its organization is deleted, every request with its credential
  answers `401 UNAUTHENTICATED` with `details.reason` `INVALID_TOKEN`. This
  is the same answer as for a revoked or expired credential. The agent
  cannot tell the cases apart.
- When the organization is restored, the same credential works again
  without any change.
- When one of its workspaces is deleted, the credential keeps working. The
  workspace is missing from `workspaces_list`, and requests for it answer
  `404 NOT_FOUND`. After a restore it is back.
- After removal for good, the credential is gone with the organization.

An agent that meets `401` or a missing workspace should stop and tell the
person it works for. It must not retry in a loop.

## Edge cases

| Situation | What happens | Why |
| --- | --- | --- |
| An admin tries to delete the organization | `403 FORBIDDEN`. Nothing changes. | Only owners delete. |
| A member tries to delete the organization | `403 FORBIDDEN`. | Same rule. |
| Someone outside the organization tries to delete it | `404 NOT_FOUND`. | Outsiders cannot tell it exists. |
| `confirmName` differs in case ("acme" for "Acme") | `422 VALIDATION_FAILED` on `confirmName`. Nothing is deleted. | The name must be repeated exactly. |
| `confirmName` has a space at the end | `422 VALIDATION_FAILED` on `confirmName`. | The comparison is exact; nothing is trimmed. |
| The organization was renamed in another browser while the delete page was open | The old name is refused with `422 VALIDATION_FAILED`. Reload and type the new name. | The name is compared with the current one. |
| The owner's email is not verified | `403 EMAIL_NOT_VERIFIED`. The app offers "Resend verification email". | Deleting needs a verified email. |
| An admin with an unverified email tries to delete | `403 FORBIDDEN`, not `EMAIL_NOT_VERIFIED`. | The role is checked before the email. |
| Two owners delete at the same moment | One gets `202`. The other gets `404 NOT_FOUND`. | The second finds it already deleted. |
| A deleted organization is deleted again | `404 NOT_FOUND`. The deadline does not move. | It is already deleted. |
| An owner deletes while an admin is creating a workspace | The two are handled one after the other. Either the workspace is created and then hidden with the organization, or the creation gets `404 NOT_FOUND`. | A workspace is never added to a deleted organization. |
| A member has a workspace open when the organization is deleted | Their next action is refused. They read "You no longer have access to {workspace}" and are taken home. | Nobody can open a workspace of a deleted organization. |
| An owner opens a workspace of the deleted organization | `404 NOT_FOUND`. | Owners keep the right to restore, not access to content. |
| An owner tries to export the deleted organization | `404 NOT_FOUND`. | Export before deleting, or restore first. |
| An owner tries to rename, invite or change roles in the deleted organization | `404 NOT_FOUND`. | A deleted organization allows only reading and restoring, by owners. |
| A file of the organization was public | Its link stops working at once. After a restore the same link works again. | Nothing of a deleted organization is public, and link addresses are kept. |
| An API key of the organization is used | `401 UNAUTHENTICATED`. After a restore the key works again. | Credentials are suspended, not revoked. |
| An API key expires during the 30 days | It stays expired after a restore. | Expiry dates do not pause. |
| An invitation is pending when the organization is deleted | Its link answers `400 TOKEN_INVALID`. If the organization is restored within the invitation's 7 days, the link works again. | Invitations are kept, and their clock keeps running. |
| An export was ready when the organization was deleted | It cannot be read while deleted. After a restore it can be downloaded if its 7 days are not over. | Exports are kept, and their clock keeps running. |
| An export was being built when the organization was deleted | It becomes `failed`. No archive is kept and nobody is emailed. Start a new one after a restore. | Nobody can open an export of a deleted organization. |
| An admin tries to restore | `404 NOT_FOUND`, the same answer as when they read it. | Only owners restore, and for everyone else the deleted organization does not exist. |
| A member tries to restore | `404 NOT_FOUND`. | Same rule. |
| Someone outside tries to restore | `404 NOT_FOUND`. | Outsiders cannot tell it exists. |
| A live organization is "restored" | `404 NOT_FOUND`. | Only a deleted organization can be restored. |
| A restore is attempted after the deadline | `404 NOT_FOUND`. The app says "This organization can no longer be restored." | The window is over, even if removal has not happened yet. |
| Two owners restore at the same moment | One gets `200`. The other gets `404 NOT_FOUND`. | The second finds it already live. |
| A different owner restores than the one who deleted | It works. | Any owner may restore. |
| The organization is restored and deleted again | A new 30 days start at the second deletion. | The deadline is set at each deletion. |
| The only owner of the deleted organization deletes their account | It is allowed, on purpose. Nobody can restore the organization any more. It is removed for good at its deadline. | The rule that keeps an owner applies to live organizations only. |
| One of two owners of the deleted organization deletes their account | The other owner can still restore it. | An owner remains. |
| An admin's account is deleted while the organization is deleted | After a restore they are no longer a member. | Account deletion removes every membership. |
| A workspace was deleted 10 days before the organization | The workspace's 30 days keep counting from its own deletion. Restoring the organization does not bring it back; restore it separately afterwards, in time. | The two deletions are separate. |
| That workspace's deadline passes while the organization is still deleted | The workspace is removed for good. A later restore of the organization comes back without it. | A workspace's deadline does not wait for its organization. |
| The organization is restored on day 29 | Everything is back. The deadline is cleared. | A restore before the deadline is complete. |
| A file was in the trash when the organization was deleted, and its trash period ended during the 30 days | The file was deleted for good. A restore of the organization comes back without it. | Deleting an organization does not pause the trash. |
| A status came to allow public use while the organization was deleted | Nothing became public then. At the restore, files that are now public get their links. | Nothing of a deleted organization is public. |
| An owner has only this organization | Home shows "Set up your organization" with a link to restore it. They can also create a new organization. | A deleted organization gives no workspace to open. |
| The owner creates a new organization with the same name while the old one is deleted | It works. Both exist, with different IDs. | Organization names are not unique. |
| After removal for good, a former member signs in | Their account works. The organization is gone from it. | Removal does not touch accounts. |
| After removal for good, someone opens an old public link | It does not work. | The files no longer exist. |
| A credential calls delete or restore | `403 FORBIDDEN`, reason `SESSION_REQUIRED`. | Deleting and restoring need a person in a browser. |

## Errors

| Code | Status | When | What to do |
| --- | --- | --- | --- |
| `UNAUTHENTICATED` | 401 | Not signed in. For a credential: its organization is deleted (`details.reason` `INVALID_TOKEN`). | Sign in; or have an owner restore the organization. |
| `FORBIDDEN` | 403 | An admin or member deletes the organization; a member deletes a workspace they can open. | Ask an owner (organization) or an owner or admin (workspace). |
| `FORBIDDEN`, reason `SESSION_REQUIRED` | 403 | A credential calls delete or restore. | A person does this in a browser. |
| `EMAIL_NOT_VERIFIED` | 403 | Deleting with an unverified email. Message: "Verify your email address first". | Open the verification link, or ask for a new one. |
| `NOT_FOUND` | 404 | Deleting something unknown, not yours or already deleted. Restoring something unknown, not yours, not deleted or past its deadline, or without the role that restores it. Anything else about a deleted organization or workspace. | Check the ID; restore first if it is deleted. |
| `CONFLICT`, reason `LAST_WORKSPACE` | 409 | Deleting an organization's only live workspace. | Create another workspace first, or delete the organization. |
| `CONFLICT`, reason `NAME_TAKEN` | 409 | Restoring a workspace while a live workspace has its name. | Rename the live workspace, then restore. |
| `VALIDATION_FAILED` | 422 | `confirmName` is missing or is not the exact current name. Messages: "confirmName must be the organization's name", "confirmName must be the workspace's name". | Type the current name exactly. |

See [Errors](../reference/errors.md) for the shape of every error.

## Limits

| What | Value |
| --- | --- |
| Restore window of a deleted organization | 30 days from the deletion |
| Restore window of a deleted workspace | 30 days from the deletion |
| Shortest possible window | 30 days. It cannot be shortened or skipped |
| Longest possible window | 30 days. It cannot be extended, only restarted by restoring and deleting again |
| Live workspaces an organization must keep | 1 |
| Owners who must confirm a deletion | 1 |

## Questions and answers

**Who can delete an organization?**
Its owners, with a verified email address.

**Can an admin delete the organization?**
No. An admin can delete workspaces, not the organization.

**Why do I have to type the name?**
So that nothing is deleted by a slip. The name must match exactly, including
upper and lower case.

**What happens the moment I delete?**
Everyone loses access to the organization and all its workspaces. Public
links, API keys and connected apps stop working. Nothing is thrown away yet.

**Are the other members told?**
No. No email is sent. The organization simply disappears for them.

**Can I undo it?**
Yes, for 30 days. Any owner can restore it, and everything comes back as it
was.

**What exactly comes back?**
Workspaces, files with their versions, folders, tags, members and roles,
statuses and fields, public links at the same addresses, API keys and
connected apps, and invitations and exports that have not expired meanwhile.

**Do I have to set up members and keys again after a restore?**
No. They are as they were, except for credentials or invitations whose own
expiry date passed during the deletion.

**What happens after 30 days?**
The organization and everything in it is permanently deleted: workspaces,
files, members' roles, invitations, exports and credentials.

**Can I get it back after the 30 days?**
No.

**Can I delete it for good right now?**
No. The 30 days cannot be skipped.

**Can I still export a deleted organization?**
No. Export before deleting, or restore it, export, and delete again.

**Do public links keep working during the 30 days?**
No. They stop at once. They work again after a restore.

**Does deleting the organization delete the members' accounts?**
No. Accounts are separate. Each member keeps their account and their other
organizations.

**Does it sign people out?**
No.

**I want to delete my account but it says I am the only owner. What do I
do?**
Make another member an owner, or delete the organization. Then delete your
account. See [Deleting an account](../accounts/delete-account.md).

**What if the only owner deletes their account while the organization is
deleted?**
Then nobody can restore it, and it is removed for good at its deadline. This
is allowed on purpose: it is how a sole owner leaves for good.

**I deleted a workspace earlier. Does restoring the organization bring it
back?**
No. Restore that workspace separately, within its own 30 days.

**What is the difference between deleting a workspace and deleting the
organization?**
A workspace deletion hides one workspace and its files; owners and admins
can do and undo it. An organization deletion hides everything; only owners
can do and undo it.

**How is this different from the trash for files?**
The trash holds single files and folders inside a live workspace. See
[Trash and restore](../files/trash.md). Deleting a workspace or an
organization hides everything in it at once, trash included.

**Can an agent delete or restore anything here?**
No. Deleting and restoring need a person signed in with a browser.

**My API key suddenly answers 401. Was the organization deleted?**
Possibly. A deleted organization, a revoked key and an expired key all
answer the same. Ask an owner.

**Can I reuse the organization's name for a new one?**
Yes, at any time. Organization names are not unique.

**Is anything kept after removal for good?**
The members' accounts, and the audit trail entries about the organization.
No file of the organization is kept. See
[Audit trail](../reference/audit-trail.md).

## Related pages

- [Organizations](organizations.md)
- [Workspaces](workspaces.md)
- [Members and roles](members-and-roles.md)
- [Invitations](invitations.md)
- [Export](export.md)
- [Trash and restore](../files/trash.md)
- [Sharing and public links](../files/sharing.md)
- [Credentials and scopes](../agents/credentials.md)
- [Deleting an account](../accounts/delete-account.md)
- [Sign-up and email verification](../accounts/sign-up.md)
- [Audit trail](../reference/audit-trail.md)
- [Limits](../reference/limits.md) and [Errors](../reference/errors.md)

