---
slug: vta/contexts/preview-delete
version: "2.0"
title: VTA Contexts — Preview Delete
summary: An administrator asks what deleting a context would destroy, and is told, without anything being destroyed.
status: draft
targetFrameworkVersion: "0.6.0"
category: did-management
keywords:
  - vta
  - context
  - delete
  - preview
  - dry-run
authors:
  - Glenn Gore (https://github.com/stormer78)
parties:
  - role: Administrator
    requirement: REQUIRED
    member: issuer
  - role: VTA
    requirement: REQUIRED
    member: recipient
proofRequirement:
  requirement: OPTIONAL
  rationale: The task changes nothing. It does enumerate what a context holds, so a maintainer whose audit retains the response MAY require a proof.
sideEffects:
  level: none
  rationale: "Computes what a deletion would affect; nothing is written."
subjectPath: /id
exposure:
  discloses: metadata
  actsAsSubject: false
errorCodes:
  - code: vta/contexts/preview-delete:notFound
    meaning: No context with this id is reachable by the caller.
    retryable: false
related:
  - vta/contexts/delete
  - vta/dids/list
  - vta/contexts/get
  - vta/contexts/list
---

## Abstract

**VTA Contexts — Preview Delete** answers the question
[`vta/contexts/delete`](../../delete/1.2/spec.md) does not give you a second
chance to ask: what would be destroyed.

It returns the keys, DIDs — of every method — and DID templates the context
holds, and the ACL entries that would be removed or narrowed as a consequence.
Nothing is written, and the caller may decide not to proceed.

Deleting a context deletes its **whole subtree**, so the preview covers the
whole subtree: `subContexts` names the sub-contexts that would go, and every
other array is the union over them and the context itself.

### Changes from 1.0

1.0 reported DIDs in `webvhDids`, defined as the `did:webvh` DIDs that would
stop being served, and a VTA answered exactly that: a context holding `did:webs`
DIDs previewed as holding none, while the deletion removed them. The confirmation
an operator was shown was missing the identities it destroyed.

2.0 replaces `webvhDids` with **`dids`**: every identity the deletion would
delete, of every method, as [`vta/dids/list`](../../../dids/list/0.1/spec.md)
summarises them ([CONVENTIONS.md §20.1](../../../dids/_shared/0.2/CONVENTIONS.md#201-which-identities-are-summarised)).
Removing a required member is not additive, so this is a new `MAJOR`.

## Status of this Document

This is a **draft** *Trust Task specification* per [SPEC.md §5.3](/SPEC.md#53-maturity-levels); the schema **MAY** change without notice.

## Conformance

[[RFC2119]](https://www.rfc-editor.org/rfc/rfc2119) and [[RFC8174]](https://www.rfc-editor.org/rfc/rfc8174) apply.

A conforming **consumer** (the VTA) **MUST NOT** modify any state in the course
of answering, including reservations, locks or tombstones. A caller may call
this repeatedly, and a caller that never follows through leaves no trace.

The response is a snapshot and **MUST NOT** be treated as a guarantee: the
context can change between the preview and the deletion. A consumer **MAY**
re-derive the effects at deletion time and act on those instead.

A conforming **consumer** **MUST** report the effects on the **entire subtree**
rooted at the named context, not only on that context: `subContexts` names
every sub-context that the corresponding deletion would remove, and `keys`,
`dids`, `aclEntriesRemoved`, `aclEntriesUpdated` and `didTemplates` are the
union across all of them.

`dids` **MUST** name every identity the corresponding deletion would delete,
whatever its method, deactivated ones included — the same set
[`vta/contexts/delete/1.2`](../../delete/1.2/spec.md) acts on. A consumer
**MUST NOT** leave out a method it holds identities of.

This is stated because the narrower reading is the natural one and is
dangerous. A preview scoped to the named context alone reports "holds nothing"
for a context whose children hold a great deal, and a caller acting on that
answer — including one deciding whether the deletion needs the explicit `force`
that `vta/contexts/delete/1.2` requires — is deciding about the wrong thing. A
preview that under-reports is worse than no preview, because it is a promise
the operator acted on.

A conforming **consumer** **MUST** distinguish `aclEntriesRemoved` from
`aclEntriesUpdated`: the first names subjects whose ACL entry disappears
entirely because this context was its only scope, and the second names subjects
who keep an entry with this scope removed. Collapsing the two hides the fact
that a subject is about to lose all of its authority.

## Authorization

Authority is the **administrator role over the context** — the same as the
deletion it previews. The preview is not a lesser capability granted more
widely: it enumerates a context's contents, and a caller who may not delete a
context may not inventory it either.

## Request

```json
{
  "id": "708192a3-b4c5-4d6e-f708-192a3b4c5d6e",
  "type": "https://trusttasks.org/spec/vta/contexts/preview-delete/2.0",
  "issuer": "did:key:z6MkAdmin",
  "recipient": "did:web:vta.example",
  "issuedAt": "2026-08-19T09:50:00Z",
  "payload": { "id": "personal/banking" }
}
```

## Response

```json
{
  "id": "8192a3b4-c5d6-4e7f-0819-2a3b4c5d6e7f",
  "type": "https://trusttasks.org/spec/vta/contexts/preview-delete/2.0#response",
  "issuer": "did:web:vta.example",
  "recipient": "did:key:z6MkAdmin",
  "issuedAt": "2026-08-19T09:50:01Z",
  "threadId": "708192a3-b4c5-4d6e-f708-192a3b4c5d6e",
  "payload": {
    "id": "personal/banking",
    "subContexts": ["personal/banking/cards"],
    "keys": ["signing-1", "agreement-1"],
    "dids": [
      "did:webvh:QmScid:example.com",
      "did:webs:example.com:banking:ENro7uf0ePmiK3jdTo2YCdXLqW7z7xoP6qhhBou6gBLe"
    ],
    "aclEntriesRemoved": ["did:key:z6MkBankBot"],
    "aclEntriesUpdated": ["did:key:z6MkOperator"],
    "didTemplates": ["bank-persona"]
  }
}
```

Read as: deleting this context also deletes `personal/banking/cards`, and
between them they destroy two keys and end two DIDs — a did:webvh whose log stops
being served and a did:webs whose key event log is ended;
`did:key:z6MkBankBot` loses its ACL entry outright, and `did:key:z6MkOperator`
keeps its entry with this scope removed.

The resource arrays do not say which context each entry belongs to, and
deliberately: the question the preview answers is what the deletion destroys,
and every one of them is destroyed either way. A consumer that wants the
per-context breakdown previews each sub-context in turn.

## Security & Privacy

This task is an inventory of a context, which is why its authorization is the
same as the deletion's rather than the read's. A caller who may
[list](../../list/1.0/spec.md) contexts learns that this one exists; only an
administrator learns what is inside it.

The response says nothing about *recoverability*, and a consumer rendering it
for a human should not imply any. A key derived from the VTA's seed can be
re-derived; an internally generated one cannot be recovered by any means, and
`keys` does not distinguish them — resolve each key before presenting the
choice.

### Data carried

The request carries a context id. The response carries identifiers: sub-context
ids, key ids, DIDs, ACL subjects and template names — the inventory of the
subtree. No key material.

### Correlation

`dids` lists together identities of every method held in the subtree, which no
resolver can join. It is returned only to an administrator of the context, who
may already list them with [`vta/dids/list`](../../../dids/list/0.1/spec.md).

### Retention

A preview. The caller needs it for as long as it takes a human to decide, and a
maintainer whose audit keeps it **SHOULD** keep it with the deletion it preceded.

### Consent/purpose

The inventory is returned so that an administrator can decide whether to delete,
and is not used for any other purpose.
