Pular para conteúdo

ZENDESK ORGANIZATION DELETE - Deletar Organização

O que é este Node?

O ZENDESK ORGANIZATION DELETE é o node responsável por remover permanentemente organizações do Zendesk.

Por que este Node existe?

Para deletar organizações/empresas que não são mais necessárias.

Como funciona internamente?

Código interno (zendesk.executor.ts:211-214):

case 'delete':
  const deleteOrgId = this.replaceVariables(data.organizationId, context.variables);
  await client.delete(`/organizations/${deleteOrgId}.json`);
  return { deleted: true };

⚠️ ATENÇÃO: Operação irreversível!

Parâmetros

Campo Tipo Obrigatório Descrição
config object Sim Credenciais Zendesk
organizationId string Sim ID da organização (suporta {{variáveis}})
responseVariable string Não Variável para armazenar resposta

Exemplo: Deletar Organização com Confirmação

{
  "name": "Deletar Organização",
  "nodes": [
    {
      "id": "start_1",
      "type": "start",
      "position": { "x": 100, "y": 100 },
      "data": { "label": "Início" }
    },
    {
      "id": "input_1",
      "type": "input",
      "position": { "x": 250, "y": 100 },
      "data": {
        "label": "ID",
        "parameters": {
          "message": "Digite o ID da organização:",
          "variable": "org_id"
        }
      }
    },
    {
      "id": "message_warning",
      "type": "message",
      "position": { "x": 400, "y": 100 },
      "data": {
        "label": "Aviso",
        "parameters": {
          "message": "⚠️ ATENÇÃO: Operação IRREVERSÍVEL!\nDigite CONFIRMAR:"
        }
      }
    },
    {
      "id": "input_2",
      "type": "input",
      "position": { "x": 550, "y": 100 },
      "data": {
        "label": "Confirmação",
        "parameters": {
          "message": "Digite CONFIRMAR:",
          "variable": "conf"
        }
      }
    },
    {
      "id": "condition_1",
      "type": "condition",
      "position": { "x": 700, "y": 50 },
      "data": {
        "label": "Verificar",
        "parameters": {
          "conditions": [
            {
              "variable": "conf",
              "operator": "equals",
              "value": "CONFIRMAR"
            }
          ]
        }
      }
    },
    {
      "id": "zendesk_delete",
      "type": "zendesk",
      "position": { "x": 850, "y": 50 },
      "data": {
        "label": "Deletar",
        "resource": "organization",
        "operation": "delete",
        "config": {
          "subdomain": "sua-empresa",
          "email": "admin@empresa.com",
          "apiToken": "seu_token_api"
        },
        "organizationId": "{{org_id}}",
        "responseVariable": "resultado"
      }
    },
    {
      "id": "message_success",
      "type": "message",
      "position": { "x": 1000, "y": 50 },
      "data": {
        "label": "Sucesso",
        "parameters": {
          "message": "✅ Organização deletada"
        }
      }
    },
    {
      "id": "message_cancel",
      "type": "message",
      "position": { "x": 850, "y": 150 },
      "data": {
        "label": "Cancelado",
        "parameters": {
          "message": "❌ Operação cancelada"
        }
      }
    },
    {
      "id": "end_1",
      "type": "end",
      "position": { "x": 1150, "y": 100 },
      "data": { "label": "Fim" }
    }
  ],
  "edges": [
    { "source": "start_1", "target": "input_1" },
    { "source": "input_1", "target": "message_warning" },
    { "source": "message_warning", "target": "input_2" },
    { "source": "input_2", "target": "condition_1" },
    { "source": "condition_1", "target": "zendesk_delete", "label": "true" },
    { "source": "condition_1", "target": "message_cancel", "label": "false" },
    { "source": "zendesk_delete", "target": "message_success" },
    { "source": "message_success", "target": "end_1" },
    { "source": "message_cancel", "target": "end_1" }
  ]
}

Resposta do Node

{
  "deleted": true
}

Boas Práticas

SIM: - Sempre confirme antes de deletar - Use apenas para testes ou limpeza

NÃO: - Não delete organizações com usuários ativos