GoliathDevelopersGet an API key
Reference/Pipeline Itemsgenerated from the gateway manifest

getDeletionImpact

Preview what deleting an org-owned record affects, for every delete op that takes a dependencyResolution.

POST/api/v1/callREADreadruns as the key's owner
View as Markdown

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.

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>"
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

// Enum values as strings: the SDK's enum types aren't exported yet, so assert to the method's variables type.
const variables = {
  targetKind: 'PIPELINE_ITEM',
  targetId: '<targetId>'
} as Parameters<typeof goliath.pipelineItems.getDeletionImpact>[0]

const result = await goliath.pipelineItems.getDeletionImpact(variables)
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    operationId: 'getDeletionImpact',
    variables: {
      targetKind: 'PIPELINE_ITEM',
      targetId: '<targetId>'
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

targetKindDependencyTargetKind!required
PIPELINE_ITEMDEALPIPELINE_STAGE_PIPELINE_ITEMSDEAL_STAGE_DEALSPIPELINE_ITEM_CUSTOM_FIELDDEAL_CUSTOM_FIELDPIPELINE_ITEM_CUSTOM_FIELD_OPTIONDEAL_CUSTOM_FIELD_OPTIONPROPERTY_TAGPROPERTY_LISTCONTACT_TAGCONTACT_LISTCONTACT_CUSTOM_FIELDCONTACT_CUSTOM_FIELD_OPTIONPIPELINEDEAL_PIPELINEPIPELINE_STAGEDEAL_STAGETWILIO_PHONE_NUMBEREMAIL_IDENTITYLIBRARY_FOLDERUSERUSER_GROUPWORKFLOW_GROUPWORKFLOW_AUTOMATIONCONTENT_TEMPLATEAGENTMARKETING_CAMPAIGNUPLOADED_FILEWORKFLOW_WEBHOOK_CREDENTIALSCRAPER_PIPELINEFILTEREMBED_FORMWORKFLOW_TABLEWORKFLOW_TABLE_COLUMNCONTACTPROPERTYORGANIZATIONSLACK_CHANNELSLACK_USERMACHINE_GROUPMACHINE_HOST
targetIdID!required

Response

What comes back under data: a list shows as one entry, and a value as its type.

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

Errors

Behaviour

A read. It rejects an Idempotency-Key header with 400 bad_request.