> ## 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>Available in the deployed MCP and HTTP bundle. Confirm access and inputs with your connected catalog. Workspace scopes and enabled providers still apply.</Note>

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

This read does not start a verification job.

## 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}
  agentlinkops call preview_resource_deletion --args '{"resourceType":"watch","resourceId":"resource_example"}'
  ```

  ```bash HTTP theme={null}
  curl "$AGENTLINKOPS_API_URL/v1/commands/preview_resource_deletion" \
    -H "Authorization: Bearer $AGENTLINKOPS_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.

* **`resource_type`** (string, required): values: "watch", "target", "project"
* **`resource_id`** (string, required): Identifier returned by the related operation.
* **`project_id`** (string, required): Project that owns this record.
* **`counts`** (object, required).
* **`blockers`** (array, required).
* **`eligible`** (boolean, required).
* **`confirmation`** (string, required).
* **`state`** (string, required): Saved lifecycle or evidence state, as enumerated for this record.
* **`receipt`** (object / null, required).
* **`scope`** (string, required).

<Accordion title="All fields and nested objects">
  | Field                        | Type          | Presence | Meaning and constraints                                                                          |
  | ---------------------------- | ------------- | -------- | ------------------------------------------------------------------------------------------------ |
  | `resource_type`              | string        | Required | values: "watch", "target", "project"                                                             |
  | `resource_id`                | string        | Required | Identifier returned by the related operation.                                                    |
  | `project_id`                 | string        | Required | Project that owns this record.                                                                   |
  | `counts`                     | object        | Required |                                                                                                  |
  | `counts.watches`             | number        | Optional |                                                                                                  |
  | `counts.targets`             | number        | Optional |                                                                                                  |
  | `counts.jobs`                | number        | Optional |                                                                                                  |
  | `counts.target_jobs`         | number        | Optional |                                                                                                  |
  | `counts.observations`        | number        | Optional |                                                                                                  |
  | `counts.target_observations` | number        | Optional |                                                                                                  |
  | `counts.events`              | number        | Optional |                                                                                                  |
  | `counts.target_events`       | number        | Optional |                                                                                                  |
  | `blockers`                   | array         | Required |                                                                                                  |
  | `blockers[].code`            | string        | Required |                                                                                                  |
  | `blockers[].message`         | string        | Required |                                                                                                  |
  | `eligible`                   | boolean       | Required |                                                                                                  |
  | `confirmation`               | string        | Required |                                                                                                  |
  | `state`                      | string        | Required | Saved lifecycle or evidence state, as enumerated for this record.                                |
  | `receipt`                    | object / null | Required |                                                                                                  |
  | `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 | values: "watch", "target", "project"                                                             |
  | `receipt.resource_id`        | string        | Required | Identifier returned by the related operation.                                                    |
  | `receipt.requested_at`       | string        | Required |                                                                                                  |
  | `receipt.requested_by`       | string        | Required |                                                                                                  |
  | `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 |                                                                                                  |
</Accordion>

[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).
