> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentlinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview resource deletion

> Preview permanent removal of an unused watch, target or project.

`preview_resource_deletion`

Preview permanent removal of an unused watch, target or project. Returns exact confirmation and blockers. Resources with execution history require historical erasure; pause watches and targets or retire competitor sets to stop future scheduling while preserving evidence.

<Note>Development preview. This command is absent from the hosted MCP readback. Generic CLI/HTTP calls require a matching development server. Configure LINKTRAIL\_API\_URL; production does not expose these command routes.</Note>

| Access                            | Behavior         |
| --------------------------------- | ---------------- |
| `projects:write`, `watches:write` | Reads saved data |

Reading saved data does not start a verification job. Mutations can change saved records or access; the effects below apply.

## Example request

Connect through [MCP](/guides/connect-mcp), [CLI](/guides/connect-cli), or [HTTP](/guides/connect-http). Replace example identifiers with records from your workspace.

<CodeGroup>
  ```json MCP theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "preview_resource_deletion",
      "arguments": {
        "resourceType": "watch",
        "resourceId": "resource_example"
      }
    }
  }
  ```

  ```bash CLI theme={null}
  linktrail call preview_resource_deletion --args '{"resourceType":"watch","resourceId":"resource_example"}'
  ```

  ```bash HTTP theme={null}
  curl "$LINKTRAIL_API_URL/v1/commands/preview_resource_deletion" \
    -H "Authorization: Bearer $LINKTRAIL_API_KEY" \
    -H 'Content-Type: application/json' \
    --data '{"resourceType":"watch","resourceId":"resource_example"}'
  ```
</CodeGroup>

## Returned result

Illustrative data validated against the documented response schema. IDs and dates are examples, not a live account capture. MCP returns this data in `structuredContent` and in a text content block; generic HTTP and CLI return the JSON result directly.

```json theme={null}
{
  "resource_type": "watch",
  "resource_id": "resource_example",
  "project_id": "pr_example",
  "counts": {
    "watches": 1,
    "targets": 0,
    "jobs": 0,
    "target_jobs": 0,
    "observations": 0,
    "target_observations": 0,
    "events": 0,
    "target_events": 0
  },
  "blockers": [],
  "eligible": true,
  "confirmation": "delete watch resource_example",
  "state": "preview",
  "receipt": null,
  "scope": "Never-executed scratch resources only. Historical resource erasure is not available through this tool yet."
}
```

## Input fields

Omit optional fields when you do not want to supply them. Null is accepted only where listed. Unknown input properties are rejected.

| Field          | Type   | Presence | Meaning and constraints                                                                                               |
| -------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `resourceType` | string | Required | The resource type value; allowed values and bounds are specified in this schema. values: "watch", "target", "project" |
| `resourceId`   | string | Required | Identifier of the resource returned by its create or list operation. minLength: 1; maxLength: 200                     |

### Validation and omitted values

Only unused resources without execution or retained shared history qualify. Inspect eligible, blockers and the exact returned confirmation before requesting deletion.

## Output fields

Fields inside optional or nullable parents apply only when that parent exists. [Common schema conventions](/reference/schemas) explain evidence states, empty lists and extensions.

| Field                        | Type          | Presence | Meaning and constraints                                                                          |
| ---------------------------- | ------------- | -------- | ------------------------------------------------------------------------------------------------ |
| `resource_type`              | string        | Required | resource type recorded for this result. values: "watch", "target", "project"                     |
| `resource_id`                | string        | Required | resource id recorded for this result.                                                            |
| `project_id`                 | string        | Required | Project that owns this record.                                                                   |
| `counts`                     | object        | Required | counts recorded for this result.                                                                 |
| `counts.watches`             | number        | Optional | watches recorded for this result.                                                                |
| `counts.targets`             | number        | Optional | targets recorded for this result.                                                                |
| `counts.jobs`                | number        | Optional | jobs recorded for this result.                                                                   |
| `counts.target_jobs`         | number        | Optional | target jobs recorded for this result.                                                            |
| `counts.observations`        | number        | Optional | observations recorded for this result.                                                           |
| `counts.target_observations` | number        | Optional | target observations recorded for this result.                                                    |
| `counts.events`              | number        | Optional | events recorded for this result.                                                                 |
| `counts.target_events`       | number        | Optional | target events recorded for this result.                                                          |
| `blockers`                   | array         | Required | blockers recorded for this result.                                                               |
| `blockers[].code`            | string        | Required | code recorded for this result.                                                                   |
| `blockers[].message`         | string        | Required | message recorded for this result.                                                                |
| `eligible`                   | boolean       | Required | eligible recorded for this result.                                                               |
| `confirmation`               | string        | Required | confirmation recorded for this result.                                                           |
| `state`                      | string        | Required | Saved lifecycle or evidence state, as enumerated for this record.                                |
| `receipt`                    | object / null | Required | receipt recorded for this result.                                                                |
| `receipt.id`                 | string        | Required | Resource identifier returned by the operation.                                                   |
| `receipt.workspace_id`       | string        | Required | Workspace that owns this record.                                                                 |
| `receipt.project_id`         | string        | Required | Project that owns this record.                                                                   |
| `receipt.resource_type`      | string        | Required | resource type recorded for this result. values: "watch", "target", "project"                     |
| `receipt.resource_id`        | string        | Required | resource id recorded for this result.                                                            |
| `receipt.requested_at`       | string        | Required | requested at recorded for this result.                                                           |
| `receipt.requested_by`       | string        | Required | requested by recorded for this result.                                                           |
| `receipt.state`              | string        | Required | Saved lifecycle or evidence state, as enumerated for this record. values: "pending", "completed" |
| `receipt.replayed`           | boolean       | Optional | True when the response reuses an earlier request with the same idempotency value.                |
| `scope`                      | string        | Required | scope recorded for this result.                                                                  |

[Download input schema](/schemas/preview_resource_deletion.input.json) · [Download output schema](/schemas/preview_resource_deletion.output.json)

## Errors and retries

The command is annotated idempotent. Reuse an accepted idempotency key when the input provides one; changing the payload under a reused key can conflict.

See [error recovery](/reference/errors) for status, scope, cooldown, cursor and retry handling. Unknown observations are result data and do not establish loss.

## HTTP resource routes

This operation has no separate resource alias. Use its generic command route in a matching environment.

## Continue

[delete\_resource](/reference/commands/delete_resource)

Follow the [related workflow](/guides/connect-http), inspect [capability status](/capability-status), or return to the [command index](/reference/index).
