Zum Inhalt springen

CRM-Referenz

Referenz aller CRM-Endpunkte der API v1. Alle Pfade beginnen mit https://<ihre-instanz>/api/v1. Jede Anfrage trägt Authorization: Bearer hek_…. Formate, Blättern, Löschlisten und Fehlercodes stehen unter Konventionen.

Lesen braucht Leserechte auf dem Modul CRM, jede schreibende Anfrage Schreibrechte (sonst 403 mit no_write_permission). Listen antworten mit {"data": [...], "next_cursor": ...}. Die Beispiele zeigen eine Seite mit einem Eintrag.

Weitere Fehlercodes im CRM: 409 mit company_archived (Änderung an einer archivierten Firma) und 409 mit tag_name_taken (Tag-Name ist schon vergeben).

Firmen

Firmen auflisten

GET /api/v1/crm/companies

Listet Firmen, neueste Änderungen zuletzt. Archivierte Firmen bleiben in der Liste, wenn du archived weglässt.

Parameter / Felder: archived (true nur archivierte, false nur aktive), tag_id, limit, cursor, updated_since.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/companies?tag_id=e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04&limit=50" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"name": "Muster AG",
"email": "[email protected]",
"invoicing_email": "[email protected]",
"phone": "+41 44 000 00 00",
"website": "https://muster.example",
"industry": "Gastronomie",
"notes": null,
"email_language": "de",
"custom_fields": {
"Kundennummer": "K-1042"
},
"addresses": [
{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "8001",
"city": "Zürich",
"country": "CH"
}
],
"tag_ids": [
"e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04"
],
"archived_at": null,
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}
],
"next_cursor": null
}

Firma anlegen

POST /api/v1/crm/companies

Legt eine Firma an. Pflichtfeld ist name.

Parameter / Felder: name, email, invoicing_email, phone, website, industry, notes, email_language (de oder en), custom_fields.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/companies" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"name": "Muster AG", "email": "[email protected]", "industry": "Gastronomie", "email_language": "de"}'

Antwort 201 Created:

{
"id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"name": "Muster AG",
"email": "[email protected]",
"invoicing_email": "[email protected]",
"phone": "+41 44 000 00 00",
"website": "https://muster.example",
"industry": "Gastronomie",
"notes": null,
"email_language": "de",
"custom_fields": {
"Kundennummer": "K-1042"
},
"addresses": [
{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "8001",
"city": "Zürich",
"country": "CH"
}
],
"tag_ids": [
"e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04"
],
"archived_at": null,
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Firma abrufen

GET /api/v1/crm/companies/{company_id}

Liefert eine Firma mit Adressen und Tag-IDs.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"name": "Muster AG",
"email": "[email protected]",
"invoicing_email": "[email protected]",
"phone": "+41 44 000 00 00",
"website": "https://muster.example",
"industry": "Gastronomie",
"notes": null,
"email_language": "de",
"custom_fields": {
"Kundennummer": "K-1042"
},
"addresses": [
{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "8001",
"city": "Zürich",
"country": "CH"
}
],
"tag_ids": [
"e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04"
],
"archived_at": null,
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Firma ändern

PATCH /api/v1/crm/companies/{company_id}

Ändert die mitgesendeten Felder. Auf einer archivierten Firma antwortet die API mit 409 und company_archived.

Parameter / Felder: Dieselben Felder wie beim Anlegen, alle optional.

Terminal-Fenster
curl -X PATCH "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"phone": "+41 44 111 11 11"}'

Antwort 200 OK:

{
"id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"name": "Muster AG",
"email": "[email protected]",
"invoicing_email": "[email protected]",
"phone": "+41 44 111 11 11",
"website": "https://muster.example",
"industry": "Gastronomie",
"notes": null,
"email_language": "de",
"custom_fields": {
"Kundennummer": "K-1042"
},
"addresses": [
{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "8001",
"city": "Zürich",
"country": "CH"
}
],
"tag_ids": [
"e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04"
],
"archived_at": null,
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Firma archivieren

DELETE /api/v1/crm/companies/{company_id}

Archiviert die Firma (sie wird nicht gelöscht). Sie bleibt in der Liste mit gesetztem archived_at.

Terminal-Fenster
curl -X DELETE "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01" \
-H "Authorization: Bearer hek_…"

Antwort: 204 No Content, ohne Inhalt.

Adresse zur Firma hinzufügen

POST /api/v1/crm/companies/{company_id}/addresses

Fügt eine Adresse hinzu. 409 mit company_archived, wenn die Firma archiviert ist.

Parameter / Felder: type (billing, shipping, other; Standard billing), street, street2, addition, zip, city, country.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01/addresses" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"type": "billing", "street": "Bahnhofstrasse 1", "zip": "8001", "city": "Zürich", "country": "CH"}'

Antwort 201 Created:

{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "8001",
"city": "Zürich",
"country": "CH"
}

Adresse der Firma ändern

PATCH /api/v1/crm/companies/{company_id}/addresses/{address_id}

Ändert die mitgesendeten Felder der Adresse.

Parameter / Felder: Wie beim Hinzufügen, alle optional.

Terminal-Fenster
curl -X PATCH "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01/addresses/c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"city": "Winterthur", "zip": "8400"}'

Antwort 200 OK:

{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "8400",
"city": "Winterthur",
"country": "CH"
}

Adresse der Firma löschen

DELETE /api/v1/crm/companies/{company_id}/addresses/{address_id}

Löscht die Adresse.

Terminal-Fenster
curl -X DELETE "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01/addresses/c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03" \
-H "Authorization: Bearer hek_…"

Antwort: 204 No Content, ohne Inhalt.

Tag einer Firma zuweisen

POST /api/v1/crm/companies/{company_id}/tags

Weist der Firma einen Tag zu.

Parameter / Felder: tag_id.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01/tags" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"tag_id": "e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04"}'

Antwort: 204 No Content, ohne Inhalt.

Tag von einer Firma entfernen

DELETE /api/v1/crm/companies/{company_id}/tags/{tag_id}

Entfernt die Zuweisung. Der Tag selbst bleibt bestehen.

Terminal-Fenster
curl -X DELETE "https://<ihre-instanz>/api/v1/crm/companies/3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01/tags/e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04" \
-H "Authorization: Bearer hek_…"

Antwort: 204 No Content, ohne Inhalt.

Kontakte

Kontakte auflisten

GET /api/v1/crm/contacts

Listet Kontakte.

Parameter / Felder: company_id, tag_id, segment_id, email, limit, cursor, updated_since.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/contacts?company_id=3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"first_name": "Anna",
"last_name": "Beispiel",
"email": "[email protected]",
"phone": null,
"position": "Einkauf",
"notes": null,
"custom_fields": {},
"addresses": [],
"tag_ids": [],
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}
],
"next_cursor": null
}

Kontakt anlegen

POST /api/v1/crm/contacts

Legt einen Kontakt an, optional bei einer Firma.

Parameter / Felder: first_name, last_name, email, phone, position, notes, company_id, custom_fields.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/contacts" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01", "first_name": "Anna", "last_name": "Beispiel", "email": "[email protected]", "position": "Einkauf"}'

Antwort 201 Created:

{
"id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"first_name": "Anna",
"last_name": "Beispiel",
"email": "[email protected]",
"phone": null,
"position": "Einkauf",
"notes": null,
"custom_fields": {},
"addresses": [],
"tag_ids": [],
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Gelöschte Kontakte auflisten

GET /api/v1/crm/contacts/deleted

Löschliste: Kontakte, die seit since gelöscht wurden. Wird 90 Tage geführt.

Parameter / Felder: since (Pflicht).

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/contacts/deleted?since=2026-11-01T00:00:00%2B00:00" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"deleted_at": "2026-11-04T10:00:00+00:00"
}
]
}

Kontakt abrufen

GET /api/v1/crm/contacts/{contact_id}

Liefert einen Kontakt mit Adressen und Tag-IDs.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"first_name": "Anna",
"last_name": "Beispiel",
"email": "[email protected]",
"phone": null,
"position": "Einkauf",
"notes": null,
"custom_fields": {},
"addresses": [],
"tag_ids": [],
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Kontakt ändern

PATCH /api/v1/crm/contacts/{contact_id}

Ändert die mitgesendeten Felder.

Parameter / Felder: Dieselben Felder wie beim Anlegen, alle optional.

Terminal-Fenster
curl -X PATCH "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"position": "Geschäftsleitung"}'

Antwort 200 OK:

{
"id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"first_name": "Anna",
"last_name": "Beispiel",
"email": "[email protected]",
"phone": null,
"position": "Geschäftsleitung",
"notes": null,
"custom_fields": {},
"addresses": [],
"tag_ids": [],
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Kontakt löschen

DELETE /api/v1/crm/contacts/{contact_id}

Löscht den Kontakt. Er erscheint danach in der Löschliste.

Terminal-Fenster
curl -X DELETE "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302" \
-H "Authorization: Bearer hek_…"

Antwort: 204 No Content, ohne Inhalt.

Adresse zum Kontakt hinzufügen

POST /api/v1/crm/contacts/{contact_id}/addresses

Fügt eine Adresse hinzu.

Parameter / Felder: Wie bei Firmen-Adressen.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302/addresses" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"type": "shipping", "street": "Hauptstrasse 5", "zip": "3000", "city": "Bern", "country": "CH"}'

Antwort 201 Created:

{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "shipping",
"addition": null,
"street": "Hauptstrasse 5",
"street2": null,
"zip": "3000",
"city": "Bern",
"country": "CH"
}

Adresse des Kontakts ändern

PATCH /api/v1/crm/contacts/{contact_id}/addresses/{address_id}

Ändert die mitgesendeten Felder der Adresse.

Parameter / Felder: Wie beim Hinzufügen, alle optional.

Terminal-Fenster
curl -X PATCH "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302/addresses/c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"zip": "3001"}'

Antwort 200 OK:

{
"id": "c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03",
"type": "billing",
"addition": null,
"street": "Bahnhofstrasse 1",
"street2": null,
"zip": "3001",
"city": "Zürich",
"country": "CH"
}

Adresse des Kontakts löschen

DELETE /api/v1/crm/contacts/{contact_id}/addresses/{address_id}

Löscht die Adresse.

Terminal-Fenster
curl -X DELETE "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302/addresses/c5e8a0b2-91d4-4a37-8f20-6e7b3d1a9c03" \
-H "Authorization: Bearer hek_…"

Antwort: 204 No Content, ohne Inhalt.

Tag einem Kontakt zuweisen

POST /api/v1/crm/contacts/{contact_id}/tags

Weist dem Kontakt einen Tag zu.

Parameter / Felder: tag_id.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302/tags" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"tag_id": "e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04"}'

Antwort: 204 No Content, ohne Inhalt.

Tag von einem Kontakt entfernen

DELETE /api/v1/crm/contacts/{contact_id}/tags/{tag_id}

Entfernt die Zuweisung.

Terminal-Fenster
curl -X DELETE "https://<ihre-instanz>/api/v1/crm/contacts/7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302/tags/e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04" \
-H "Authorization: Bearer hek_…"

Antwort: 204 No Content, ohne Inhalt.

Verkaufschancen und Aktivitäten

Verkaufschancen auflisten

GET /api/v1/crm/opportunities

Listet Verkaufschancen.

Parameter / Felder: company_id, contact_id, stage (lead, qualified, proposal_sent, negotiation, won, lost), limit, cursor, updated_since.

Eine unbekannte company_id oder contact_id ergibt 404 mit not_found.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/opportunities?stage=proposal_sent" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"contact_id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"title": "Jahresvertrag 2027",
"stage": "proposal_sent",
"value": "12500.00",
"currency": "CHF",
"probability": 60,
"expected_close_date": "2027-01-31",
"description": null,
"custom_fields": {},
"last_activity_at": "2026-11-04T10:00:00+00:00",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}
],
"next_cursor": null
}

Verkaufschance anlegen

POST /api/v1/crm/opportunities

Legt eine Verkaufschance an. Ohne currency gilt die Standardwährung aus /crm/settings.

Parameter / Felder: company_id und title (Pflicht), contact_id, stage (Standard lead), value (Text, z. B. "12500.00"), currency, probability (ganze Zahl), expected_close_date, description, custom_fields.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/opportunities" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01", "contact_id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302", "title": "Jahresvertrag 2027", "stage": "lead", "value": "12500.00", "expected_close_date": "2027-01-31"}'

Antwort 201 Created:

{
"id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"contact_id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"title": "Jahresvertrag 2027",
"stage": "lead",
"value": "12500.00",
"currency": "CHF",
"probability": null,
"expected_close_date": "2027-01-31",
"description": null,
"custom_fields": {},
"last_activity_at": "2026-11-04T10:00:00+00:00",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Gelöschte Verkaufschancen auflisten

GET /api/v1/crm/opportunities/deleted

Löschliste: Verkaufschancen, die seit since gelöscht wurden. Wird 90 Tage geführt.

Parameter / Felder: since (Pflicht).

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/opportunities/deleted?since=2026-11-01T00:00:00%2B00:00" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"deleted_at": "2026-11-04T10:00:00+00:00"
}
]
}

Verkaufschance abrufen

GET /api/v1/crm/opportunities/{opportunity_id}

Liefert eine Verkaufschance.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/opportunities/91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"contact_id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"title": "Jahresvertrag 2027",
"stage": "proposal_sent",
"value": "12500.00",
"currency": "CHF",
"probability": 60,
"expected_close_date": "2027-01-31",
"description": null,
"custom_fields": {},
"last_activity_at": "2026-11-04T10:00:00+00:00",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Verkaufschance ändern (auch Stufenwechsel)

PATCH /api/v1/crm/opportunities/{opportunity_id}

Ändert die mitgesendeten Felder. Mit stage verschiebst du die Chance in der Pipeline.

Parameter / Felder: Dieselben Felder wie beim Anlegen, alle optional.

Terminal-Fenster
curl -X PATCH "https://<ihre-instanz>/api/v1/crm/opportunities/91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"stage": "won"}'

Antwort 200 OK:

{
"id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"company_id": "3f2b8c1e-5a7d-4e90-8b11-0c6d2a9f4e01",
"contact_id": "7a1d9e44-2c3b-4f58-9a66-b1e0d5c8f302",
"title": "Jahresvertrag 2027",
"stage": "won",
"value": "12500.00",
"currency": "CHF",
"probability": 60,
"expected_close_date": "2027-01-31",
"description": null,
"custom_fields": {},
"last_activity_at": "2026-11-04T10:00:00+00:00",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Aktivitäten einer Verkaufschance auflisten

GET /api/v1/crm/opportunities/{opportunity_id}/activities

Listet die Aktivitäten (Anruf, E-Mail, Termin, Notiz).

Parameter / Felder: limit, cursor, updated_since.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/opportunities/91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05/activities" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "d4f6a8c0-2e4b-4d6f-8a1c-5e7b9d1f3a08",
"opportunity_id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"type": "call",
"content": "Offerte besprochen",
"created_by": "Anna Admin",
"created_at": "2026-11-04T10:00:00+00:00"
}
],
"next_cursor": null
}

Aktivität hinzufügen

POST /api/v1/crm/opportunities/{opportunity_id}/activities

Fügt eine Aktivität hinzu.

Parameter / Felder: type (call, email, meeting, note; Pflicht), content.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/opportunities/91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05/activities" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"type": "call", "content": "Offerte besprochen"}'

Antwort 201 Created:

{
"id": "d4f6a8c0-2e4b-4d6f-8a1c-5e7b9d1f3a08",
"opportunity_id": "91c3e5a7-b9d1-4f3a-8c5e-7a9b1d3f5e05",
"type": "call",
"content": "Offerte besprochen",
"created_by": "Anna Admin",
"created_at": "2026-11-04T10:00:00+00:00"
}

Tags und Segmente

Tags auflisten

GET /api/v1/crm/tags

Listet Tags. source ist crm oder shopify.

Parameter / Felder: limit, cursor, updated_since.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/tags" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04",
"name": "VIP",
"color": "#f59e0b",
"source": "crm",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}
],
"next_cursor": null
}

Tag anlegen

POST /api/v1/crm/tags

Legt einen Tag an. Existiert der Name schon, antwortet die API mit 409 und tag_name_taken.

Parameter / Felder: name (Pflicht), color.

Terminal-Fenster
curl -X POST "https://<ihre-instanz>/api/v1/crm/tags" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6b1f2c3d-…" \
-d '{"name": "VIP", "color": "#f59e0b"}'

Antwort 201 Created:

{
"id": "e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04",
"name": "VIP",
"color": "#f59e0b",
"source": "crm",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Gelöschte Tags auflisten

GET /api/v1/crm/tags/deleted

Löschliste: Tags, die seit since gelöscht wurden. Wird 90 Tage geführt.

Parameter / Felder: since (Pflicht).

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/tags/deleted?since=2026-11-01T00:00:00%2B00:00" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04",
"deleted_at": "2026-11-04T10:00:00+00:00"
}
]
}

Tag umbenennen oder umfärben

PATCH /api/v1/crm/tags/{tag_id}

Ändert Name oder Farbe. Auch Tags, die aus Shopify stammen, lassen sich umbenennen; ein späterer Shopify-Abgleich kann den alten Namen wieder anlegen. Vergebener Name: 409 mit tag_name_taken.

Parameter / Felder: name, color.

Terminal-Fenster
curl -X PATCH "https://<ihre-instanz>/api/v1/crm/tags/e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"name": "Stammkunde"}'

Antwort 200 OK:

{
"id": "e2b4f6a8-0c1d-4e3f-a5b7-9d8c7e6f5a04",
"name": "Stammkunde",
"color": "#f59e0b",
"source": "crm",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Segmente auflisten

GET /api/v1/crm/segments

Listet Segmente (nur lesen). type ist shopify oder crm_native.

Parameter / Felder: limit, cursor, updated_since.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/segments" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "5d7f9b1c-3e5a-4c7e-9a1b-3c5e7a9b1d06",
"name": "Newsletter",
"type": "crm_native",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}
],
"next_cursor": null
}

Gelöschte Segmente auflisten

GET /api/v1/crm/segments/deleted

Löschliste: Segmente, die seit since gelöscht wurden. Wird 90 Tage geführt.

Parameter / Felder: since (Pflicht).

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/segments/deleted?since=2026-11-01T00:00:00%2B00:00" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "5d7f9b1c-3e5a-4c7e-9a1b-3c5e7a9b1d06",
"deleted_at": "2026-11-04T10:00:00+00:00"
}
]
}

Segment abrufen

GET /api/v1/crm/segments/{segment_id}

Liefert ein Segment.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/segments/5d7f9b1c-3e5a-4c7e-9a1b-3c5e7a9b1d06" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"id": "5d7f9b1c-3e5a-4c7e-9a1b-3c5e7a9b1d06",
"name": "Newsletter",
"type": "crm_native",
"created_at": "2026-11-04T10:00:00+00:00",
"updated_at": "2026-11-04T10:00:00+00:00"
}

Stammdaten und Einstellungen

Benutzerdefinierte Felder auflisten

GET /api/v1/crm/custom-fields

Listet die Felddefinitionen für Firmen, Kontakte und Verkaufschancen. Die Werte stehen in custom_fields der jeweiligen Ressource.

Parameter / Felder: Keine.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/custom-fields" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "a1b2c3d4-0000-4000-8000-000000000009",
"entity_type": "company",
"name": "Kundennummer",
"field_type": "text",
"options": null
}
]
}

Branchen auflisten

GET /api/v1/crm/industry-values

Listet die Branchen, die für industry zur Auswahl stehen.

Parameter / Felder: Keine.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/industry-values" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
{
"id": "a1b2c3d4-0000-4000-8000-000000000010",
"name": "Gastronomie"
}
]
}

Pipeline-Stufen auflisten

GET /api/v1/crm/opportunity-stages

Listet die Stufen der Verkaufspipeline.

Parameter / Felder: Keine.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/opportunity-stages" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"data": [
"lead",
"qualified",
"proposal_sent",
"negotiation",
"won",
"lost"
]
}

CRM-Einstellungen lesen

GET /api/v1/crm/settings

Liefert die Standardwährung des CRM.

Parameter / Felder: Keine.

Terminal-Fenster
curl "https://<ihre-instanz>/api/v1/crm/settings" \
-H "Authorization: Bearer hek_…"

Antwort 200 OK:

{
"default_currency": "CHF"
}

Wie geht es weiter