← Alle Themen · API
In diesem Artikel 8 Kapitel
Tickets Public API
Base URL: https://{domain}/public_api/{api_token}/tickets
Header: Authorization: {api_token}
Tickets auflisten
GET /tickets
| Parameter | Typ | Beschreibung |
|---|---|---|
| status | string | Statusname: open, pending, waiting, closed |
| statusId | int | Status-ID |
| mailboxId | int | Postfach-ID |
| assignedUserId | int | Zugewiesener Benutzer |
| fromEmail | string | Absender-E-Mail (exakt) |
| search | string | Suche in Betreff, E-Mail, Ticket-Nr. |
| page | int | Seite (default: 1) |
| perPage | int | Pro Seite (default: 30, max: 100) |
Response:
{
"valid": true,
"data": [{
"id": 1,
"ticketNumber": "T-20260418-00001",
"subject": "Betreff",
"fromEmail": "kunde@example.com",
"fromName": "Max Mustermann",
"statusId": 1,
"statusName": "open",
"statusLabel": "Offen",
"priorityId": 2,
"priorityName": "normal",
"priorityLabel": "Normal",
"mailboxId": 1,
"assignedUserId": 0,
"orderId": 0,
"messageCount": 3,
"lastMessageAt": 1776500000,
"createdAt": 1776400000
}],
"total": 42,
"page": 1,
"perPage": 30
}
Ticket laden (mit Nachrichten)
GET /tickets/{id}
Response:
{
"valid": true,
"data": {
"id": 1,
"ticketNumber": "T-20260418-00001",
"subject": "Betreff",
"messages": [{
"id": 1,
"type": "email_in",
"fromEmail": "kunde@example.com",
"fromName": "Max Mustermann",
"toEmail": "support@example.com",
"subject": "Betreff",
"bodyText": "Nachricht...",
"isInternal": 0,
"createdAt": 1776400000
}],
"tags": ["Reklamation", "Amazon"]
}
}
Ticket aktualisieren
PUT /tickets/{id}
| Parameter | Typ | Beschreibung |
|---|---|---|
| status | string | Statusname: open, pending, waiting, closed |
| statusId | int | Status-ID |
| priorityId | int | Priorität-ID |
| assignedUserId | int | Zuweisen (0 = niemand) |
| orderId | int | Auftrag verknüpfen (0 = entfernen) |
| tags | string[] | Tag-Namen setzen (ersetzt bestehende) |
Beispiel: Ticket schließen
curl -X PUT \
https://example.com/public_api/{token}/tickets/1 \
-H "Authorization: {token}" \
-d '{"status": "closed"}'
Beispiel: Status + Tags setzen
curl -X PUT \
https://example.com/public_api/{token}/tickets/1 \
-H "Authorization: {token}" \
-d '{"status": "pending", "tags": ["Wartend", "Rückfrage"]}'
Antwort senden
POST /tickets/{id}/reply
| Parameter | Typ | Beschreibung |
|---|---|---|
| bodyHtml | string | HTML-Inhalt (oder bodyText) |
| bodyText | string | Plaintext-Inhalt |
| toEmail | string | Empfänger (optional, default: Ticket-Absender) |
E-Mail wird asynchron über die Send-Queue versendet.
Notiz hinzufügen
POST /tickets/{id}/note
| Parameter | Typ | Beschreibung |
|---|---|---|
| note | string | Notiz-Text |
| bodyHtml | string | Alternativ: HTML |
| bodyText | string | Alternativ: Plaintext |
Interne Notiz, wird nicht per E-Mail gesendet.
Status-Liste
GET /tickets/statuses
Response:
{
"valid": true,
"data": [
{"id": 1, "name": "open", "label": "Offen", "isClosed": 0},
{"id": 2, "name": "pending", "label": "Wartend", "isClosed": 0},
{"id": 3, "name": "waiting", "label": "Warten auf Kunde", "isClosed": 0},
{"id": 4, "name": "closed", "label": "Geschlossen", "isClosed": 1}
]
}
Postfach-Liste
GET /tickets/mailboxes
Beispiele
Alle offenen Tickets eines Postfachs:
curl "https://example.com/public_api/{token}/tickets?status=open&mailboxId=1" \
-H "Authorization: {token}"
Alle Tickets mit Absender @amazon schließen:
# 1. Tickets finden
curl "https://example.com/public_api/{token}/tickets?search=@amazon.de&status=open" \
-H "Authorization: {token}"
# 2. Einzeln schließen
curl -X PUT "https://example.com/public_api/{token}/tickets/123" \
-H "Authorization: {token}" \
-d '{"status": "closed"}'
Automatische Antwort senden:
curl -X POST "https://example.com/public_api/{token}/tickets/123/reply" \
-H "Authorization: {token}" \
-d '{"bodyHtml": "<p>Vielen Dank, wir melden uns.</p>"}'