Ticket
WARNING
Ticket-Endpunkte hängen von den Gruppenberechtigungen ab und ob der Benutzer, den Sie verwenden, ein Agent ist. Aus diesem Grund können Tickets unter Umständen nicht verfügbar sein.
TIP
Benachrichtigungen unterdrücken: Um ein Ticket zu erstellen oder eine Aktualisierung durchzuführen, ohne Benachrichtigungen an Agenten (per E-Mail und in der App) auszulösen, fügen Sie Ihrer Anfrage den folgenden HTTP-Header hinzu:
plain
X-Zammad-Suppress-Notifications: trueDies ist nützlich für automatisierte Integrationen, die Tickets über Webhooks oder Trigger verwalten, um Benachrichtigungsschleifen zu vermeiden. Der Header wirkt sich nur auf Administrator- und Agenten-Konten aus und wird für Kunden ignoriert.
Auflisten
Erforderliche Berechtigung: ticket.agent oder ticket.customer
GET-Anfrage gesendet: /api/v1/tickets
Details
json
// HTTP-Code 200 OK
[
{
"id": 1,
"group_id": 1,
"priority_id": 2,
"state_id": 1,
"organization_id": 1,
"number": "69001",
"title": "Welcome to Zammad!",
"owner_id": 1,
"customer_id": 2,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-07-03T08:52:34.556Z",
"last_contact_agent_at": null,
"last_contact_customer_at": "2025-07-03T08:52:34.556Z",
"last_owner_update_at": null,
"create_article_type_id": 5,
"create_article_sender_id": 2,
"article_count": 1,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 2,
"created_by_id": 2,
"created_at": "2025-07-03T08:52:34.343Z",
"updated_at": "2025-07-03T08:52:34.661Z",
"checklist_id": null
},
{
"id": 2,
"group_id": 3,
"priority_id": 2,
"state_id": 4,
"organization_id": null,
"number": "69002",
"title": "Refund for order 4388019",
"owner_id": 7,
"customer_id": 15,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-01-04T13:54:28.811Z",
"last_contact_agent_at": "2025-01-03T07:54:28.787Z",
"last_contact_customer_at": "2025-01-04T13:54:28.811Z",
"last_owner_update_at": null,
"create_article_type_id": 1,
"create_article_sender_id": 2,
"article_count": 3,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 15,
"created_by_id": 15,
"created_at": "2025-01-03T06:54:28.656Z",
"updated_at": "2025-07-03T08:54:28.821Z",
"checklist_id": null
},
{
"id": 3,
"group_id": 5,
"priority_id": 2,
"state_id": 2,
"organization_id": 3,
"number": "69003",
"title": "Order of 10 laptops XYX3000",
"owner_id": 14,
"customer_id": 18,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-07-03T08:17:28.879Z",
"last_contact_agent_at": "2025-07-03T08:17:28.879Z",
"last_contact_customer_at": "2025-07-03T07:14:28.831Z",
"last_owner_update_at": null,
"create_article_type_id": 1,
"create_article_sender_id": 2,
"article_count": 3,
"escalation_at": "2025-07-03T08:14:28.832Z",
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 14,
"created_by_id": 18,
"created_at": "2025-07-03T07:14:28.831Z",
"updated_at": "2025-07-03T08:54:28.938Z",
"checklist_id": null
},
{
"id": 4,
"group_id": 9,
"priority_id": 3,
"state_id": 2,
"organization_id": 2,
"number": "69004",
"title": "Onboarding new colleague",
"owner_id": 3,
"customer_id": 10,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-07-01T08:54:28.948Z",
"last_contact_agent_at": null,
"last_contact_customer_at": "2025-07-01T08:54:28.948Z",
"last_owner_update_at": null,
"create_article_type_id": 11,
"create_article_sender_id": 2,
"article_count": 1,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 10,
"created_by_id": 10,
"created_at": "2025-07-01T08:54:28.948Z",
"updated_at": "2025-07-03T08:54:29.488Z",
"checklist_id": 1
},
{
"id": 5,
"group_id": 9,
"priority_id": 3,
"state_id": 2,
"organization_id": 2,
"number": "69005",
"title": "IT | Onboarding new colleague",
"owner_id": 3,
"customer_id": 10,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-07-01T08:59:29.238Z",
"last_contact_agent_at": null,
"last_contact_customer_at": "2025-07-01T08:59:29.238Z",
"last_owner_update_at": null,
"create_article_type_id": 11,
"create_article_sender_id": 2,
"article_count": 1,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 10,
"created_by_id": 10,
"created_at": "2025-07-01T08:59:29.238Z",
"updated_at": "2025-07-03T08:54:29.495Z",
"checklist_id": 2
},
{
"id": 6,
"group_id": 4,
"priority_id": 2,
"state_id": 2,
"organization_id": null,
"number": "69006",
"title": "Laptop not working [Order 931529477]",
"owner_id": 6,
"customer_id": 16,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-07-03T08:43:29.827Z",
"last_contact_agent_at": "2025-07-03T08:43:29.827Z",
"last_contact_customer_at": "2025-07-03T08:34:29.703Z",
"last_owner_update_at": null,
"create_article_type_id": 1,
"create_article_sender_id": 2,
"article_count": 5,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 8,
"created_by_id": 16,
"created_at": "2025-07-03T08:07:29.526Z",
"updated_at": "2025-07-03T08:54:29.870Z",
"checklist_id": null
},
{
"id": 7,
"group_id": 2,
"priority_id": 1,
"state_id": 2,
"organization_id": null,
"number": "69007",
"title": "My battery is dead / order 110572",
"owner_id": 13,
"customer_id": 17,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_close_at": null,
"last_contact_at": "2025-07-03T07:54:29.904Z",
"last_contact_agent_at": null,
"last_contact_customer_at": "2025-07-03T07:54:29.904Z",
"last_owner_update_at": null,
"create_article_type_id": 1,
"create_article_sender_id": 2,
"article_count": 1,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 17,
"created_by_id": 17,
"created_at": "2025-07-03T07:54:29.904Z",
"updated_at": "2025-07-03T08:54:29.958Z",
"checklist_id": null
}
]Anzeigen
Erforderliche Berechtigung: ticket.agent oder ticket.customer
GET-Anfrage gesendet: /api/v1/tickets/{ticket id}
Details
json
// HTTP-Code 200 OK
{
"id": 3,
"group_id": 1,
"priority_id": 2,
"state_id": 4,
"organization_id": 3,
"number": "22003",
"title": "Order 787556",
"owner_id": 3,
"customer_id": 7,
"note": null,
"first_response_at": null,
"first_response_escalation_at": null,
"first_response_in_min": null,
"first_response_diff_in_min": null,
"close_at": null,
"close_escalation_at": null,
"close_in_min": null,
"close_diff_in_min": null,
"update_escalation_at": null,
"update_in_min": null,
"update_diff_in_min": null,
"last_contact_at": "2021-06-03T09:57:17.987Z",
"last_contact_agent_at": "2021-06-03T09:57:17.987Z",
"last_contact_customer_at": "2021-06-01T11:57:17.935Z",
"last_owner_update_at": null,
"create_article_type_id": 1,
"create_article_sender_id": 2,
"article_count": 2,
"escalation_at": null,
"pending_time": null,
"type": null,
"time_unit": null,
"preferences": {},
"updated_by_id": 4,
"created_by_id": 7,
"created_at": "2021-06-01T11:57:17.935Z",
"updated_at": "2021-11-03T11:57:17.997Z"
}Erstellen
Erforderliche Berechtigung: ticket.agent oder ticket.customer
POST-Anfrage gesendet: /api/v1/tickets
TIP
Im Namen von Benutzern
Wenn Sie Tickets im Namen anderer Benutzer erstellen möchten, verwenden Sie das Attribut customer_id. Hierfür ist die Berechtigung ticket.agent erforderlich. Ohne diese Berechtigung wird customer_id ignoriert und das Feld Kunde des Tickets auf den aktuellen Benutzer gesetzt. Verwenden Sie guess:{E-Mail-Adresse}, um einen API-Aufruf zu sparen, falls Sie die Benutzer-ID nicht kennen oder den betreffenden Benutzer anlegen möchten ("customer_id": "guess:jane@doe.com").
Wenn Sie im Auftrag eines Kunden ein Ticket mit einem ersten Artikel erstellen, müssen Sie article.sender explizit auf "Customer" setzen. Ohne diese Angabe wird der Absender standardmäßig auf "Agent" gesetzt (basierend auf den Berechtigungen des aktuellen Benutzers). Dies wirkt sich auf die create_article_sender_id des Tickets und die Berechnungen des Zeitstempels für den Kontakt aus.
Das Gleiche gilt für Artikel, die später per PUT hinzugefügt werden: Legen Sie den Absender auch dort explizit fest, wenn Sie im Auftrag eines Kunden handeln. Da der Absender eines Artikels nach der Erstellung nicht mehr geändert werden kann, ist es wichtig, dies bei der Artikelerstellung korrekt mitzugeben.
Weitere Einzelheiten zum Attribut "sender" finden Sie unter Artikel.
TIP
Fügen Sie das Benachrichtigungs-Abonnement gleich hinzu:
Fügen Sie das Attribut mentions zu Ihrer Ticket-Nutzlast hinzu und geben Sie ein Array mit Benutzer-IDs an, um für diese direkt bei der Ticket-Erstellung ein Benachrichtigungs-Abonnement zu erstellen.
Beispiel: mentions: [1, 5, 7, 8],
Details
json
{
"title": "Help me!",
"group": "2nd Level",
"customer": "david@example.com",
"article": {
"subject": "My subject",
"body": "I am a message!",
"type": "note",
"sender": "Customer",
"internal": false
}
}TIP
Das Attribut sender des ursprünglichen Artikels bestimmt die create_article_sender_id und Kontakt-Zeitstempel des Tickets. Eine vollständige Liste der Artikelattribute und deren Funktionsweise finden Sie unter Artikel.
Aktualisierung
Erforderliche Berechtigung: ticket.agent oder ticket.customer
PUT-Anfrage gesendet: /api/v1/tickets/{ticket id}
Details
json
{
"title": "No help for you",
"group": "Sales",
"state": "open",
"priority": "3 high",
"article": {
"subject": "Update via API",
"body": "Here's my reason for updating this ticket...",
"internal": true
}
}INFO
Das obige Beispiel liefert einen Artikel. Dieser Artikel ist ein neuer Artikel und hat keine Auswirkungen auf bestehende Artikel.
TIP
Anhänge hinzufügen
Die Nutzlast von Anhängen ist identisch mit dem POST-Request, es wird stattdessen lediglich PUT verwendet.
Löschen
Erforderliche Berechtigung: admin
DELETE-Anfrage gesendet: /api/v1/tickets/{ticket id}
DANGER
Dies ist eine dauerhafte Entfernung
Bitte beachten Sie, dass das Entfernen von Tickets nicht rückgängig gemacht werden kann. Alle Daten (z.B. Artikel & Anhänge) gehen dabei verloren.
Details
Response:
json
// HTTP-Code 200 OK
{}