> ## 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.

# Delete resource

> Permanently remove an unused watch, target or project after preview_resource_deletion.

`delete_resource`

Permanently remove an unused watch, target or project after preview\_resource\_deletion. Supply its exact confirmation. Execution history and retained shared evidence block deletion. Completed deletion receipts support safe retries.

<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` | Writes or admits work; can change or remove existing state |

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": "delete_resource",
      "arguments": {
        "resourceType": "watch",
        "resourceId": "resource_example",
        "confirmation": "delete watch resource_example"
      }
    }
  }
  ```

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

  ```bash HTTP theme={null}
  curl "$LINKTRAIL_API_URL/v1/commands/delete_resource" \
    -H "Authorization: Bearer $LINKTRAIL_API_KEY" \
    -H 'Content-Type: application/json' \
    --data '{"resourceType":"watch","resourceId":"resource_example","confirmation":"delete watch 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}
{
  "id": "rdel_example",
  "workspace_id": "ws_example",
  "project_id": "pr_example",
  "resource_type": "watch",
  "resource_id": "resource_example",
  "requested_at": "2026-09-13T12:00:00.000Z",
  "requested_by": "user_example",
  "state": "completed",
  "replayed": false
}
```

## 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                     |
| `confirmation` | string | Required | The confirmation value; allowed values and bounds are specified in this schema. minLength: 1; maxLength: 240          |

### Validation and omitted values

Copy the exact confirmation returned for the same resource by preview\_resource\_deletion. Revalidate eligibility; history or retained shared evidence can block removal.

Completed receipts allow replay. Historical erasure is outside this operation; pausing a watch or destination preserves its evidence.

## 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                                                                          |
| --------------- | ------- | -------- | ------------------------------------------------------------------------------------------------ |
| `id`            | string  | Required | Resource identifier returned by the operation.                                                   |
| `workspace_id`  | string  | Required | Workspace that owns this record.                                                                 |
| `project_id`    | string  | Required | Project that owns this record.                                                                   |
| `resource_type` | string  | Required | resource type recorded for this result. values: "watch", "target", "project"                     |
| `resource_id`   | string  | Required | resource id recorded for this result.                                                            |
| `requested_at`  | string  | Required | requested at recorded for this result.                                                           |
| `requested_by`  | string  | Required | requested by recorded for this result.                                                           |
| `state`         | string  | Required | Saved lifecycle or evidence state, as enumerated for this record. values: "pending", "completed" |
| `replayed`      | boolean | Optional | True when the response reuses an earlier request with the same idempotency value.                |

[Download input schema](/schemas/delete_resource.input.json) · [Download output schema](/schemas/delete_resource.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

[preview\_resource\_deletion](/reference/commands/preview_resource_deletion)

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