# DELETE /negocios/{id} — Apagar negócio

- URL: `DELETE https://chat.forsi.com.br/api/v1/negocios/{id}`
- Acesso: escopo `funil:apagar` · módulos do plano: API + Funil
- Sucesso: `200`, `{"dados": ...}` com `ApagadoFunil`
- Página: https://docs.forsi.com.br/api/funil/apagar-negocio (Markdown: https://docs.forsi.com.br/api/funil/apagar-negocio.md)

Apaga o negócio e as notas dele. Não tem volta. Escopo próprio, separado de `funil:escrever`.

**Parâmetros no caminho**

| Campo | Tipo | Obrigatório | Notas |
| --- | --- | --- | --- |
| `id` | uuid | sim | No caminho da URL. |

**Exemplo (curl)**

```bash
curl -X DELETE "https://chat.forsi.com.br/api/v1/negocios/b04efa09-d26e-496a-a843-fb12f9be4d4d" \
  -H "Authorization: Bearer $FORSI_CHAVE"
```

**JavaScript (fetch)**

```js
const resposta = await fetch('https://chat.forsi.com.br/api/v1/negocios/b04efa09-d26e-496a-a843-fb12f9be4d4d', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.FORSI_CHAVE}`,
  },
});
const json = await resposta.json();
if (!resposta.ok) throw new Error(`${resposta.status} ${json.erro.codigo}: ${json.erro.mensagem}`);
console.log(json.dados);
```

**Python (requests)**

```python
import os
import requests

resposta = requests.delete(
    "https://chat.forsi.com.br/api/v1/negocios/b04efa09-d26e-496a-a843-fb12f9be4d4d",
    headers={
        "Authorization": f"Bearer {os.environ['FORSI_CHAVE']}",
    },
    timeout=30,
)
corpo = resposta.json()
if not resposta.ok:
    raise RuntimeError(f"{resposta.status_code} {corpo['erro']['codigo']}: {corpo['erro']['mensagem']}")
print(corpo["dados"])
```

**Resposta `200` (exemplo)**

```json
{"dados":{"apagado":false,"negocios_apagados":0,"negocios_movidos":3}}
```

**Campos de `ApagadoFunil`**

| Campo | Tipo | Obrigatório | Notas |
| --- | --- | --- | --- |
| `apagado` | boolean | não |  |
| `negocios_apagados` | integer | não |  |
| `negocios_movidos` | integer | não |  |

**Erros**

- `401`: Chave ausente ou inválida (resposta igual para qualquer motivo).
- `403`: Plano sem API, escopo insuficiente ou https/origem recusados.
- `404`: Não existe nesta organização.
- `409`: Conflito (repetido, Idempotency-Key com outro corpo).
- `422`: Dados inválidos ou regra de negócio (ex.: janela_fechada; conta_restrita = a Meta restringiu a conta por spam: erro traz os campos de RestricaoMeta, como ate, escopo, motivo e retry_after_s).
- `429`: Limite de requisições. Veja Retry-After.
- Códigos comuns aqui: `funil_inexistente`, `etapa_inexistente`, `negocio_inexistente`, `nota_inexistente`, `etapa_fora_do_funil`, `etapa_ganha_e_perdida`, `estado_invalido`, `valor_invalido`, `limite_de_funis`, `limite_de_etapas`, `limite_de_notas`, `contato_inexistente`, `conversa_inexistente`.

---

Página: https://docs.forsi.com.br/api/funil/apagar-negocio · Índice: https://docs.forsi.com.br/llms.txt · Tudo num arquivo: https://docs.forsi.com.br/llms-full.txt
