LetsBot Menu
Zacznij teraz Polski Język

Meta Business Partner Spółka zarejestrowana w Wielkiej Brytanii

Język

CRM · endpoint API

POST /api/v1/crm/deals/{id}/lost Nowy

Mark a deal lost

Moves the deal to its pipeline's lost stage.

Moves the deal to its pipeline's lost stage. Scope: crm.

Required: lost_reason_id (see List lost reasons). Optional: note (up to 500 characters).

Treść JSON

{
  "lost_reason_id": 2,
  "note": "Chose a cheaper supplier."
}

Przykładowe żądanie

curl -X POST "https://your-workspace.letsbot.net/api/v1/crm/deals/15/lost" \
  -H "X-Zapier-Api-Key: YOUR_WORKSPACE_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "lost_reason_id": 2,
  "note": "Chose a cheaper supplier."
}'
const response = await fetch("https://your-workspace.letsbot.net/api/v1/crm/deals/15/lost", {
  method: "POST",
  headers: {
    "X-Zapier-Api-Key": "YOUR_WORKSPACE_API_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "lost_reason_id": 2,
    "note": "Chose a cheaper supplier."
  }),
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://your-workspace.letsbot.net/api/v1/crm/deals/15/lost');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-Zapier-Api-Key: YOUR_WORKSPACE_API_KEY',
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
        "lost_reason_id": 2,
        "note": "Chose a cheaper supplier."
    }
    JSON,
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://your-workspace.letsbot.net/api/v1/crm/deals/15/lost",
    headers={
        "X-Zapier-Api-Key": "YOUR_WORKSPACE_API_KEY",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "lost_reason_id": 2,
        "note": "Chose a cheaper supplier.",
    },
)

print(response.json())

Odpowiedzi

Lost200
{
  "success": true,
  "data": {
    "id": 15,
    "title": "Epoxy kit order — 40 units",
    "amount": 12000,
    "currency": "SAR",
    "pipeline_id": 1,
    "stage": {
      "id": 14,
      "name": "Lost"
    },
    "status": "lost",
    "expected_close_date": "2026-10-31",
    "contact": {
      "id": 42,
      "name": "Ahmed Ali",
      "phone": "966500000000"
    },
    "company_id": 7,
    "owner": {
      "id": 3,
      "name": "Sara Ahmed"
    },
    "lost_reason_id": 2,
    "lost_note": "Chose a cheaper supplier.",
    "won_at": null,
    "lost_at": "2026-10-08T09:30:00+03:00",
    "custom_fields": {},
    "created_at": "2026-10-02T10:00:00+03:00",
    "updated_at": "2026-10-08T09:30:00+03:00",
    "url": "https://your-workspace.letsbot.net/panel/v2/deals?deal=15&pipeline=1"
  }
}

Gotowi, kiedy Ty jesteś

Wypróbuj ten endpoint na własnym numerze

API działa w okresie bezpłatnego testu. Załóż konto, połącz swój numer WhatsApp i skopiuj klucz z API → Dane uwierzytelniania.