Zum Hauptinhalt springen

Deals

Ein Deal ist eine Verkaufschance in einer Pipeline. Er gehört zu einem Kontakt, befindet sich in einer bestimmten Stage und trägt einen Status (open, won, lost).

Ressourcenstruktur

AttributTypPflichtBeispielHinweise
namestringNeinDeal mit JohnDeal-Titel.
statusstringNeinopenDefault open. Übliche Werte: open, won, lost.
stage_idintegerJa3Stage des Deals.
pipeline_idintegerNein1Muss zur Pipeline der stage_id passen.
contact_idintegerJa42Mit dem Deal verknüpfter Kontakt.
positionintegerNein2Position innerhalb der Stage (Kanban-Reihenfolge).
lost_reasonstringNeinPreis zu hochGrund, wenn status = lost.
lost_atdatetime (UTC)Nein2025-01-15T10:30:00ZMuss UTC sein.
won_atdatetime (UTC)Nein2025-01-20T14:00:00ZMuss UTC sein.
custom_attributesobjectNein{ "source": "Website" }Freie Custom Fields.
contact_attributesobjectNein{ "id": 42, "full_name": "John" }Bei upsert: findet einen passenden Kontakt oder legt einen neuen an und verknüpft ihn mit dem Deal.

Alle nachfolgenden Endpoints gehen aus von:

{base_url} = https://app.woofedcrm.com
{account_id} = 1

Deal erstellen

POST /api/v1/accounts/{account_id}/deals

Erstellt einen neuen Deal im Account.

Body

{
"name": "Lead site: Rubel",
"status": "open",
"stage_id": 1,
"contact_id": 1,
"custom_attributes": {
"source": "Website",
"campaign": "Google Ads",
"utm_medium": "cpc",
"utm_source": "google",
"priority": "high",
"estimated_budget": 15000
}
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"name": "Lead site: Rubel",
"status": "open",
"stage_id": 1,
"contact_id": 1,
"custom_attributes": {
"source": "Website",
"campaign": "Google Ads"
}
}'

Beispiel-Antwort — 201 Created

{
"id": 27,
"name": "Lead site: Rubel",
"status": "open",
"stage_id": 1,
"pipeline_id": 1,
"contact_id": 1,
"position": 1,
"created_by_id": 5,
"total_deal_products_amount_in_cents": 0,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1,
"custom_attributes": {
"source": "Website",
"campaign": "Google Ads"
},
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}

Antwortfelder

FeldBeschreibung
idNumerische Deal-ID.
pipeline_idWird aus stage_id abgeleitet, wenn weggelassen.
positionReihenfolge in der Stage (Kanban).
custom_attributesWird wie übermittelt zurückgegeben.

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
422stage_id oder contact_id fehlt/ungültig, oder Pipeline-Mismatch.

Deals suchen

POST /api/v1/accounts/{account_id}/deals/search

Sucht Deals mit einem query-Objekt im Ransack-Stil. Die vollständige Prädikatsliste finden Sie in API-Struktur → Suche.

Body

{
"query": {
"name_cont": "Rubel",
"status_eq": "open",
"stage_id_eq": 1,
"pipeline_id_eq": 1,
"contact_id_eq": 42,
"created_at_gteq": "2025-01-01T00:00:00Z",
"updated_at_lteq": "2025-01-31T23:59:59Z",
"id_eq": 27
}
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"query": {
"name_cont": "Rubel",
"status_eq": "open"
}
}'

Beispiel-Antwort — 200 OK

{
"data": [
{
"id": 27,
"name": "Lead site: Rubel",
"status": "open",
"stage_id": 1,
"contact_id": 1,
"custom_attributes": { "source": "Website" },
"created_at": "2025-01-12T18:21:03Z",
"updated_at": "2025-01-12T18:21:03Z",
"pipeline_id": 1,
"position": 1,
"created_by_id": null,
"total_deal_products_amount_in_cents": 0,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1
}
],
"pagination": {
"page": 1,
"items": 1,
"count": 1,
"pages": 1,
"from": 1,
"last": 1,
"to": 1,
"prev": null,
"next": null
}
}

Mögliche Fehler

StatusWann
400JSON-Body ungültig.
401Token fehlt oder ungültig.
422Unbekanntes Prädikat oder nicht durchsuchbares Feld.

Deal abrufen

GET /api/v1/accounts/{account_id}/deals/{id}

Liest einen einzelnen Deal per ID.

Beispiel-Request

curl -X GET "https://app.woofedcrm.com/api/v1/accounts/1/deals/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER"

Beispiel-Antwort — 200 OK

Die Antwort enthält außerdem den zum Deal gehörenden Contact, Stage, Pipeline, die deal_assignees und deal_products.

{
"id": 1,
"name": "Lead site: Rubel",
"status": "open",
"stage_id": 1,
"contact_id": 1,
"custom_attributes": { "source": "Website" },
"created_at": "2025-01-12T18:21:03Z",
"updated_at": "2025-01-12T18:21:03Z",
"pipeline_id": 1,
"position": 1,
"created_by_id": null,
"total_deal_products_amount_in_cents": 0,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1,
"contact": {
"id": 1,
"full_name": "Tim Maia",
"phone": "+555678606681",
"email": "sabina.lockman@robel.example",
"custom_attributes": {},
"additional_attributes": {},
"app_type": null,
"app_id": null,
"created_at": "2025-01-12T18:21:00Z",
"updated_at": "2025-01-12T18:21:00Z",
"account_id": 1,
"label_list": [],
"chatwoot_conversations_label_list": []
},
"stage": {
"id": 1,
"name": "Stage 1",
"pipeline_id": 1,
"position": 1,
"created_at": "2025-01-12T18:20:50Z",
"updated_at": "2025-01-12T18:20:50Z",
"account_id": 1
},
"pipeline": {
"id": 1,
"name": "sales",
"created_at": "2025-01-12T18:20:45Z",
"updated_at": "2025-01-12T18:20:46Z",
"account_id": 1
},
"deal_assignees": [
{
"id": 2,
"deal_id": 1,
"user_id": 9,
"created_at": "2025-01-12T18:21:05Z",
"updated_at": "2025-01-12T18:21:05Z",
"account_id": 1
}
],
"deal_products": [
{
"id": 1,
"product_id": 4,
"deal_id": 1,
"created_at": "2025-01-12T18:21:06Z",
"updated_at": "2025-01-12T18:21:06Z",
"unit_amount_in_cents": 0,
"product_identifier": "",
"product_name": "",
"total_amount_in_cents": 0,
"quantity": 1,
"account_id": 1
}
]
}

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
404Deal in diesem Account nicht gefunden.

Deal aktualisieren

PUT /api/v1/accounts/{account_id}/deals/{id}

Aktualisiert einen bestehenden Deal. Sie können beliebige Teilmengen von Feldern ändern; weggelassene Felder bleiben unverändert.

Body

{
"name": "Lead site: Rubel (Lost)",
"status": "lost",
"stage_id": 2,
"lost_reason": "Preis zu hoch",
"lost_at": "2025-01-18T16:45:00Z",
"custom_attributes": {
"source": "Website",
"competitor": "Wettbewerber X",
"final_offer_value": 12000
}
}

Beispiel-Request

curl -X PUT "https://app.woofedcrm.com/api/v1/accounts/1/deals/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"status": "lost",
"lost_reason": "Preis zu hoch",
"lost_at": "2025-01-18T16:45:00Z"
}'

Beispiel-Antwort — 200 OK

{
"id": 1,
"name": "Lead site: Rubel (Lost)",
"status": "lost",
"stage_id": 2,
"pipeline_id": 1,
"contact_id": 1,
"position": 1,
"created_by_id": 5,
"total_deal_products_amount_in_cents": 0,
"lost_at": "2025-01-18T16:45:00Z",
"won_at": null,
"lost_reason": "Preis zu hoch",
"account_id": 1,
"updated_at": "2025-01-18T16:45:00Z"
}

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
404Deal nicht gefunden.
422Validierungsfehler (z. B. ungültiger status, Mismatch zwischen stage_id und pipeline_id, lost_at ungültig).

Deal-Upsert

POST /api/v1/accounts/{account_id}/deals/upsert

Erstellt den Deal, falls kein Match existiert, sonst aktualisiert den vorhandenen. Praktisch für die Synchronisation aus Fremdsystemen.

Wird contact_attributes mitgegeben, sucht die API einen passenden Kontakt; existiert keiner, wird ein neuer angelegt und verknüpft.

Body

{
"stage_id": 1,
"pipeline_id": 1,
"name": "Lead site: Rubel",
"contact_id": 1,
"status": "open",
"custom_attributes": { "CPF": "123456789-87" }
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/upsert" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"stage_id": 1,
"pipeline_id": 1,
"name": "Lead site: Rubel",
"contact_id": 1,
"status": "open",
"custom_attributes": { "CPF": "123456789-87" }
}'

Beispiel-Antwort — 200 OK (aktualisiert) oder 201 Created (neu)

{
"id": 27,
"stage_id": 1,
"pipeline_id": 1,
"name": "Lead site: Rubel",
"contact_id": 1,
"status": "open",
"position": 1,
"created_by_id": 5,
"total_deal_products_amount_in_cents": 0,
"lost_at": null,
"won_at": null,
"lost_reason": "",
"account_id": 1,
"custom_attributes": { "CPF": "123456789-87" },
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-20T11:42:18Z"
}

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
422Pipeline-/Stage-Mismatch oder Pflichtfeld fehlt.

Verwandte Endpoints

  • Deal-Events — Notizen, Aktivitäten und geplante WhatsApp-/Chatwoot-Nachrichten an einen Deal anhängen.
  • Deal-Produkte — Produkte an einen Deal hängen.
  • Deal-Zuweisungen — Deals an Benutzer zuweisen.