# Save a conversation

`POST /api/v1/qe`

Saves the conversation and open blocks in one request: company (created if missing), contact(s), project / deal, stage, product, trial, quote, order, competitor, market share, fair lead and custom object records; selected open actions close and the next step opens (as a task when assigned to someone else). Use `undo_id` from the response within `undo_seconds` to **undo**. A similarly named company returns `409 similar` — pick the existing record or send `confirm_new: true`.

## Body

| Field | Type | Description |
|---|---|---|
| `customer` (required) | string | Company name. |
| `template_id` | integer | Template (for required-block checks). |
| `visit_type / visit_date / topic` | string | Conversation type (`F2F`, `Online`, `Call`, `Deneme`), date (`YYYY-MM-DD`), topic. |
| `contact / contacts` | string / array | Main contact; `contacts` extra participants (written to the note). New contact: `contact: "__new__"` + `contact_new`. |
| `opp_id / opp_name` | string | Project: id, `__new__` (new) or empty (default project). |
| `note / result` | string | Conversation note and result. |
| `next_action / action_date / assignee` | string | Next step, its date (natural language works) and assignee user. |
| `close_actions` | array<string> | Action keys to close (`/qe/context` → `open_actions[].key`). |
| `blocks` | array<string> | Open blocks (e.g. `firsat`, `teklif`, `co:uretim_hatti`); their fields go in the body under the keys in `/qe/config` → `blocks[].fields[].k` (`stage_label`, `offer_price` …). In a custom object block `co_<key>_id` picks an existing record; for a new one send `co_<key>_name` and `co_<key>_f<field id>`. |
| `confirm_new` | boolean | Create even if a similarly named company exists. |

## Response

```json 200
{
  "advice": null,
  "closed": [],
  "co": [
    {
      "id": 1,
      "key": "uretim_hatti",
      "name": "Hat 3 — şişirme",
      "url": "/o/uretim_hatti/1"
    }
  ],
  "created": false,
  "customer": {
    "active": true,
    "at_risk": false,
    "city": "İstanbul",
    "currency": "EUR",
    "currency_default": "",
    "id": 1,
    "initials": "AP",
    "last_visit": "2026-10-06",
    "main_contact": {
      "email": "selin.dogan@alizepaketleme.example",
      "name": "Selin Doğan",
      "phone": "0 (212) 000 55 24",
      "wa": "902120005524"
    },
    "name": "Alize Paketleme San. ve Tic. A.Ş.",
    "next_visit_due": "2027-01-04",
    "open_opps": 1,
    "owner": {
      "full_name": "Deniz Aksoy",
      "id": 1,
      "role": "admin",
      "role_label": "Yönetici",
      "username": "admin"
    },
    "pending_state": "soon",
    "period": 90,
    "phone": "0 (212) 000 15 65",
    "potential_kg": 8000.0,
    "rid": "001xiy2LDMX4EY0",
    "sector": "Gıda ambalajı",
    "status": "AC",
    "status_label": "Aktif Müşteri",
    "unit": "kg",
    "visit_overdue_days": -90,
    "visit_state": "ok"
  },
  "message": "Alize Paketleme San. ve Tic. A.Ş. kaydedildi: ziyaret, proje #31 Mevcut Müşteri — Yenileme · 2026, üretim hattı: Hat 3 — şişirme.",
  "next_step": "İhtiyaç, hat ve aylık miktar potansiyelini netleştir (Need)",
  "ok": true,
  "opp": {
    "bant": 1,
    "base_currency": "EUR",
    "close_date": "2027-02-09",
    "cur_sym": "€",
    "currency": "EUR",
    "customer": "Alize Paketleme San. ve Tic. A.Ş.",
    "customer_city": "İstanbul",
    "customer_id": 1,
    "days_in_stage": 11,
    "detail_status": "",
    "fc": "Pipeline",
    "health": {
      "grade": "success",
      "label": "sağlıklı",
      "score": 92
    },
    "health_color": "g",
    "health_manual": false,
    "health_note": "",
    "id": 31,
    "initials": "AP",
    "is_account": false,
    "is_open": true,
    "last_update": "2026-10-03",
    "lifetime_left": 169,
    "line": "",
    "name": "Mevcut Müşteri — Yenileme · 2026",
    "next_step": "İhtiyaç, hat ve aylık miktar potansiyelini netleştir (Need)",
    "offer_price": null,
    "owner": {
      "full_name": "Deniz Aksoy",
      "id": 1,
      "role": "admin",
      "role_label": "Yönetici",
      "username": "admin"
    },
    "payment_days": null,
    "potential_kg": 6000.0,
    "prob": 0.1,
    "probability": null,
    "product": "PU-SL 200 Solventsiz Laminasyon Yapıştırıcısı",
    "product_id": 1,
    "pu": "€/kg",
    "rid": "006yvlKAVcMKhPf",
    "sla_days": 30,
    "sla_left": 19,
    "source": "Bayi / distribütör",
    "stage": "Qualify",
    "stage_label": "Qualify",
    "start_date": "2026-09-25",
    "trend": "",
    "trend_label": "Otomatik",
    "type": "Mevcut Müşteri — Yenileme",
    "unit": "kg",
    "unit_code": "kg",
    "value": 302000.0,
    "value_base": 302000.0,
    "value_short": "302K"
  },
  "opp_new": false,
  "parts": [
    "ziyaret",
    "proje #31 Mevcut Müşteri — Yenileme · 2026"
  ],
  "task": null,
  "undo_id": 1,
  "undo_seconds": 600,
  "visit": {
    "action_date": "2026-10-08",
    "action_done": false,
    "action_state": "soon",
    "contact": "",
    "customer": "Alize Paketleme San. ve Tic. A.Ş.",
    "customer_id": 1,
    "date": "2026-10-06",
    "id": 107,
    "line": "",
    "next_action": "Numune gönder",
    "note": "Aylık 15 ton, 1,85 €/kg ve 60 gün vade konuşuldu. Hat 3'te deneme olumlu. Perşembe numune göndereceğiz.",
    "opp": "Mevcut Müşteri — Yenileme · 2026",
    "opp_id": 31,
    "product": "",
    "result": "",
    "rid": "00URZrmvSihtGjU",
    "topic": "Görüşme",
    "type": "F2F",
    "user": "Deniz Aksoy"
  },
  "warnings": []
}
```
