# POST /negocios/{id}/notas — Anotar no negócio

- URL: `POST https://chat.forsi.com.br/api/v1/negocios/{id}/notas`
- Acesso: escopo `funil:escrever` · módulos do plano: API + Funil · aceita `Idempotency-Key`
- Sucesso: `201`, `{"dados": ...}` com `NotaNegocio`
- Página: https://docs.forsi.com.br/api/funil/criar-nota-negocio (Markdown: https://docs.forsi.com.br/api/funil/criar-nota-negocio.md)

Até 500 notas por negócio. Mande `Idempotency-Key` para poder repetir com segurança.

**Parâmetros no caminho**

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

**Corpo (JSON)**

| Campo | Tipo | Obrigatório | Notas |
| --- | --- | --- | --- |
| `texto` | string | sim | até 4000 caracteres |

**Exemplo (curl)**

```bash
curl -X POST "https://chat.forsi.com.br/api/v1/negocios/b04efa09-d26e-496a-a843-fb12f9be4d4d/notas" \
  -H "Authorization: Bearer $FORSI_CHAVE" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: pedido-4821" \
  -d '{"texto":"Pediu para ligar depois das 18h."}'
```

**JavaScript (fetch)**

```js
const resposta = await fetch('https://chat.forsi.com.br/api/v1/negocios/b04efa09-d26e-496a-a843-fb12f9be4d4d/notas', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.FORSI_CHAVE}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': 'pedido-4821',
  },
  body: JSON.stringify({"texto":"Pediu para ligar depois das 18h."}),
});
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.post(
    "https://chat.forsi.com.br/api/v1/negocios/b04efa09-d26e-496a-a843-fb12f9be4d4d/notas",
    headers={
        "Authorization": f"Bearer {os.environ['FORSI_CHAVE']}",
        "Idempotency-Key": "pedido-4821",
    },
    json={
        "texto": "Pediu para ligar depois das 18h.",
    },
    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 `201` (exemplo)**

```json
{
  "dados": {
    "id": "68375c45-c8b3-4632-9968-1bd256569205",
    "negocio_id": "b04efa09-d26e-496a-a843-fb12f9be4d4d",
    "texto": "Pediu para ligar depois das 18h.",
    "autor_id": "7aded196-b699-4ef0-b171-2a17b934d051",
    "autor": "Ana Lima",
    "criado_em": "2026-10-04T13:05:12.481Z"
  }
}
```

**Campos de `NotaNegocio`**

| Campo | Tipo | Obrigatório | Notas |
| --- | --- | --- | --- |
| `id` | uuid | não |  |
| `negocio_id` | uuid | não |  |
| `texto` | string | não |  |
| `autor_id` | uuid ou null | não |  |
| `autor` | string ou null | não |  |
| `criado_em` | data e hora ISO 8601 | 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/criar-nota-negocio · Índice: https://docs.forsi.com.br/llms.txt · Tudo num arquivo: https://docs.forsi.com.br/llms-full.txt
