Zum Hauptinhalt springen

Deal-Events

Ein Deal-Event ist alles, was im Verlauf eines Deals erscheint: eine Notiz, eine geplante Aktivität, oder eine über Chatwoot bzw. Evolution API (WhatsApp) versendete Nachricht.

Es gibt nur einen Endpoint, aber er akzeptiert mehrere Event-Arten (kind). Das Feld kind bestimmt, welche Felder Pflicht sind und welche Side Effects das System ausführt.

Endpoint

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

Path-ParameterTypPflichtBeschreibung
account_idintegerJaAccount-Scope.
deal_idintegerJaDer Deal, der das Event erhält.

Headers

HeaderWert
Content-Typeapplication/json
AuthorizationBearer IHR_TOKEN_HIER

Gemeinsame Attribute

AttributTypPflichtBeispielHinweise
kindstringJanoteEines von note, activity, chatwoot_message, evolution_api_message.
titlestringNeinFollow-up-AnrufDefault leer.
contentstringMeist jaWie geht es?Inhalt der Notiz / Aktivität / Nachricht.
donebooleanNeintrueMarkiert das Event als erledigt.
auto_donebooleanNeinfalseFalls true, markiert das System das Event automatisch als erledigt (z. B. nach Versand einer Nachricht).
done_atdatetime (UTC)Nein2025-01-18T15:30:00ZWann erledigt.
scheduled_atdatetime (UTC)Manchmal2025-01-20T14:00:00ZPflicht für geplante Nachrichten.
send_nowbooleanManchmaltruePflicht für "Jetzt senden"-Nachrichten.
app_typestringManchmalApps::ChatwootEines von Apps::Chatwoot, Apps::EvolutionApi.
app_idintegerManchmal5ID der App-Integration.
additional_attributesobjectManchmal{ "chatwoot_inbox_id": "62483" }App-spezifische Zusatzfelder.
custom_attributesobjectNein{ "channel": "whatsapp" }Freie Custom Fields.

Die nächsten Abschnitte zeigen den exakten Body je kind.


1. Notiz erstellen (kind = note)

Eine Notiz ist freier Text auf der Deal-Timeline. Keine Side Effects.

Body

{
"kind": "note",
"content": "Textinhalt..."
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/1/events" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"kind": "note",
"content": "Kunden angerufen, um die nächsten Schritte zu besprechen."
}'

Beispiel-Antwort — 201 Created

{
"id": 88,
"deal_id": 1,
"contact_id": 1,
"app_type": null,
"app_id": null,
"kind": "note",
"scheduled_at": null,
"done_at": null,
"from_me": true,
"status": null,
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"title": "",
"auto_done": false,
"account_id": 1,
"done": false,
"send_now": null,
"files": [],
"files_events": [],
"invalid_files": null,
"content": "Kunden angerufen, um die nächsten Schritte zu besprechen."
}

2. Aktivität erstellen (kind = activity)

Eine Aktivität ist eine geplante Aufgabe auf der Timeline (Anruf, Termin, Follow-up).

Body

{
"title": "Activity example title",
"kind": "activity",
"content": "Textinhalt...",
"scheduled_at": "2025-01-20T14:00:00Z",
"done": false
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/1/events" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"title": "Follow-up-Anruf",
"kind": "activity",
"content": "Bestätigen, dass das Angebot eingegangen ist",
"scheduled_at": "2025-01-20T14:00:00Z",
"done": false
}'

Beispiel-Antwort — 201 Created

{
"id": 89,
"deal_id": 1,
"contact_id": 1,
"app_type": null,
"app_id": null,
"kind": "activity",
"scheduled_at": "2025-01-20T14:00:00Z",
"done_at": null,
"from_me": true,
"status": null,
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"title": "Follow-up-Anruf",
"auto_done": false,
"account_id": 1,
"done": false,
"send_now": null,
"files": [],
"files_events": [],
"invalid_files": null,
"content": "Bestätigen, dass das Angebot eingegangen ist"
}

3. Chatwoot-Nachricht planen (kind = chatwoot_message)

Plant eine Nachricht, die zum Zeitpunkt scheduled_at über eine Chatwoot-Inbox versendet wird.

Body

{
"title": "Chatwoot Message",
"content": "Wie geht es?",
"kind": "chatwoot_message",
"auto_done": false,
"scheduled_at": "2025-01-20T14:00:00Z",
"app_type": "Apps::Chatwoot",
"app_id": 6,
"additional_attributes": {
"chatwoot_inbox_id": "62483"
}
}

Pflichtfelder dieses kinds

AttributPflichtHinweise
kindJaMuss chatwoot_message sein.
contentJaNachrichtentext.
scheduled_atJaUTC.
app_typeJaApps::Chatwoot.
app_idJaID der Chatwoot-Integration.
additional_attributes.chatwoot_inbox_idJaZiel-Inbox.

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/1/events" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"title": "Chatwoot Message",
"content": "Wie geht es?",
"kind": "chatwoot_message",
"auto_done": false,
"scheduled_at": "2025-01-20T14:00:00Z",
"app_type": "Apps::Chatwoot",
"app_id": 6,
"additional_attributes": { "chatwoot_inbox_id": "62483" }
}'

Beispiel-Antwort — 201 Created

{
"id": 90,
"deal_id": 1,
"contact_id": 1,
"app_type": "Apps::Chatwoot",
"app_id": 6,
"kind": "chatwoot_message",
"scheduled_at": "2025-01-20T14:00:00Z",
"done_at": null,
"from_me": true,
"status": null,
"custom_attributes": {},
"additional_attributes": { "chatwoot_inbox_id": "62483" },
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"title": "Chatwoot Message",
"auto_done": false,
"account_id": 1,
"done": false,
"send_now": null,
"files": [],
"files_events": [],
"invalid_files": null,
"content": "Wie geht es?"
}

4. Chatwoot-Nachricht sofort senden

Selber kind, aber sofort gesendet mit send_now: true.

Body

{
"title": "Chatwoot Message",
"content": "Wie geht es?",
"kind": "chatwoot_message",
"send_now": true,
"app_type": "Apps::Chatwoot",
"app_id": 5,
"additional_attributes": {
"chatwoot_inbox_id": "62483"
}
}

Pflichtfelder dieses kinds

AttributPflichtHinweise
kindJachatwoot_message.
contentJaNachrichtentext.
send_nowJatrue.
app_typeJaApps::Chatwoot.
app_idJaID der Chatwoot-Integration.
additional_attributes.chatwoot_inbox_idJaZiel-Inbox.

Beispiel-Antwort — 201 Created

{
"id": 91,
"deal_id": 1,
"contact_id": 1,
"app_type": "Apps::Chatwoot",
"app_id": 5,
"kind": "chatwoot_message",
"scheduled_at": null,
"done_at": "2025-01-15T10:30:00Z",
"from_me": true,
"status": null,
"custom_attributes": {},
"additional_attributes": { "chatwoot_inbox_id": "62483" },
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"title": "Chatwoot Message",
"auto_done": true,
"account_id": 1,
"done": true,
"send_now": true,
"files": [],
"files_events": [],
"invalid_files": null,
"content": "Wie geht es?"
}

5. WhatsApp-Nachricht planen (kind = evolution_api_message)

Plant eine Evolution-API-(WhatsApp-)Nachricht für scheduled_at.

Body

{
"title": "Whatsapp Message",
"content": "Wie geht es?",
"kind": "evolution_api_message",
"auto_done": false,
"scheduled_at": "2025-01-20T14:00:00Z",
"app_type": "Apps::EvolutionApi",
"app_id": 5
}

Pflichtfelder dieses kinds

AttributPflichtHinweise
kindJaevolution_api_message.
contentJaNachrichtentext.
scheduled_atJaUTC.
app_typeJaApps::EvolutionApi.
app_idJaID der Evolution-API-Integration.

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/1/events" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"title": "Whatsapp Message",
"content": "Wie geht es?",
"kind": "evolution_api_message",
"scheduled_at": "2025-01-20T14:00:00Z",
"app_type": "Apps::EvolutionApi",
"app_id": 5
}'

Beispiel-Antwort — 201 Created

{
"id": 92,
"deal_id": 1,
"contact_id": 1,
"app_type": "Apps::EvolutionApi",
"app_id": 5,
"kind": "evolution_api_message",
"scheduled_at": "2025-01-20T14:00:00Z",
"done_at": null,
"from_me": true,
"status": null,
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"title": "Whatsapp Message",
"auto_done": false,
"account_id": 1,
"done": false,
"send_now": null,
"files": [],
"files_events": [],
"invalid_files": null,
"content": "Wie geht es?"
}

6. WhatsApp-Nachricht sofort senden

Selber kind wie zuvor, aber mit send_now: true.

Body

{
"title": "Whatsapp Message",
"content": "Wie geht es?",
"kind": "evolution_api_message",
"send_now": true,
"app_type": "Apps::EvolutionApi",
"app_id": 5
}

Beispiel-Request

curl -X POST "https://app.woofedcrm.com/api/v1/accounts/1/deals/1/events" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer IHR_TOKEN_HIER" \
-d '{
"title": "Whatsapp Message",
"content": "Wie geht es?",
"kind": "evolution_api_message",
"send_now": true,
"app_type": "Apps::EvolutionApi",
"app_id": 5
}'

Beispiel-Antwort — 201 Created

{
"id": 93,
"deal_id": 1,
"contact_id": 1,
"app_type": "Apps::EvolutionApi",
"app_id": 5,
"kind": "evolution_api_message",
"scheduled_at": null,
"done_at": "2025-01-15T10:30:00Z",
"from_me": true,
"status": null,
"custom_attributes": {},
"additional_attributes": {},
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z",
"title": "Whatsapp Message",
"auto_done": true,
"account_id": 1,
"done": true,
"send_now": true,
"files": [],
"files_events": [],
"invalid_files": null,
"content": "Wie geht es?"
}

Mögliche Fehler

StatusWann
401Token fehlt oder ungültig.
404Der Deal existiert in diesem Account nicht.
422Ungültiger kind, fehlendes Pflichtfeld für den gewählten Kind, ungültiger scheduled_at, oder unbekannte app_id / app_type.