# getDeletionImpact

Preview what deleting an org-owned record affects, for every delete op that takes a dependencyResolution. Pass targetKind + targetId; returns impactVersion (hand it back to the matching delete op), requiresReplacement, the dependent records grouped, and replacementRequirements (what needs a new home, with its valid options). Supported targetKinds: DEAL (deletePipelineItem), DEAL_PIPELINE / DEAL_STAGE (deletePipeline / deletePipelineStage), CONTACT_CUSTOM_FIELD (deleteContactCustomField), CONTACT_CUSTOM_FIELD_OPTION / DEAL_CUSTOM_FIELD_OPTION (a dropdown option dropped by updateContactCustomField / updatePipelineItemCustomField's optionDependencyResolutions), CONTACT_TAG (deleteContactTags), CONTACT_LIST (deleteContactLists), and CONTENT_TEMPLATE (deleteContentTemplate). WORKFLOW_GROUP (a workflow's or appointment reminder's group id): deleteAppointmentReminder takes the result as its dependencyResolution; for a workflow it is read-only (deleteWorkflow takes no impactVersion). isBlocking=false items (e.g. pending AI suggestions) never block and retire automatically. Never delete a saved filter to free an option: re-point or trim it. Always call this first; impactVersion goes stale when anything changes, so re-read rather than reuse it.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getDeletionImpact", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `targetKind`: `DependencyTargetKind!` (required, one of `PIPELINE_ITEM`, `DEAL`, `PIPELINE_STAGE_PIPELINE_ITEMS`, `DEAL_STAGE_DEALS`, `PIPELINE_ITEM_CUSTOM_FIELD`, `DEAL_CUSTOM_FIELD`, `PIPELINE_ITEM_CUSTOM_FIELD_OPTION`, `DEAL_CUSTOM_FIELD_OPTION`, `PROPERTY_TAG`, `PROPERTY_LIST`, `CONTACT_TAG`, `CONTACT_LIST`, `CONTACT_CUSTOM_FIELD`, `CONTACT_CUSTOM_FIELD_OPTION`, `PIPELINE`, `DEAL_PIPELINE`, `PIPELINE_STAGE`, `DEAL_STAGE`, `TWILIO_PHONE_NUMBER`, `EMAIL_IDENTITY`, `LIBRARY_FOLDER`, `USER`, `USER_GROUP`, `WORKFLOW_GROUP`, `WORKFLOW_AUTOMATION`, `CONTENT_TEMPLATE`, `AGENT`, `MARKETING_CAMPAIGN`, `UPLOADED_FILE`, `WORKFLOW_WEBHOOK_CREDENTIAL`, `SCRAPER_PIPELINE`, `FILTER`, `EMBED_FORM`, `WORKFLOW_TABLE`, `WORKFLOW_TABLE_COLUMN`, `CONTACT`, `PROPERTY`, `ORGANIZATION`, `SLACK_CHANNEL`, `SLACK_USER`, `MACHINE_GROUP`, `MACHINE_HOST`)
- `targetId`: `ID!` (required)

## Response (data, an example)

```json
{
  "dependencyQuery": {
    "getDeletionImpact": {
      "impactVersion": "…",
      "requiresReplacement": true,
      "warnings": [
        "…"
      ],
      "groups": [
        {
          "groupKind": "FILTER",
          "title": "…",
          "count": 0
        }
      ],
      "replacementRequirements": [
        {
          "targetKind": "PIPELINE_ITEM",
          "targetId": "<ID>",
          "title": "…",
          "options": [
            {
              "id": "<ID>",
              "label": "…",
              "subtitle": "…"
            }
          ]
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getDeletionImpact",
    "variables": {
      "targetKind": "PIPELINE_ITEM",
      "targetId": "<targetId>"
    }
  }'
```
