delete_custom_variable
Remove a custom variable from the workspace registry. Values already stored on leads are NOT deleted, so re-creating the same token restores full personalization. Call get_custom_variable_usage first to see which campaigns reference it. Refused with 409 variable_in_use while an active (non-draft) campaign's sequence still references the token, because deleting it would quietly strip a phrase from messages already going out. The intended way past that is replace_with: it repoints every reference in every campaign sequence at another variable and then deletes this one, in a single transaction, and the response reports campaignsUpdated. Prefer that over hand-editing sequences. If the user actually wants a different NAME rather than a different variable, use rename_custom_variable, not delete-and-recreate.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"custom_variable_id": "<custom_variable_id>"
},
"name": "delete_custom_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| replace_with | No | Token (NAME, not id) of the variable every sequence should reference instead, applied before the delete. It must already exist (a built-in counts); anything else returns 400 replacement_unknown, since pointing sequences at something that also resolves to nothing would just move the breakage. | |
| custom_variable_id | Yes | Id of the custom variable (from list_custom_variables). |