Kontakte: Listen

Liste aktualisieren

Ändern Sie Name, Beschreibung, Quelle oder benutzerdefinierte Daten einer Liste. Nur das Gesendete ändert sich.

POSThttps://g.sendcorex.com/v1/contactscommand: update_list
i

Erfordert den Scope contact:update auf Ihrem API Key.

Argumente

  • list_idstringerforderlich

    Die zu ändernde Liste. Die ID selbst kann sich nicht ändern.

    z. B. "customers"

  • namestringoptional

    Neuer Name. null löscht ihn.

  • descriptionstringoptional

    Neue Beschreibung. null löscht sie.

  • sourcestringoptional

    Neue Quelle. null löscht sie.

  • customobjectoptional

    Wird mit den aktuellen benutzerdefinierten Daten zusammengeführt. Ein als null gesendeter Schlüssel wird entfernt.

    z. B. { "year": null, "owner": "sales" }

Schnellstart

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "update_list",
        args: {
          list_id: "customers",
          name: "Customers (VIP)",
          custom: {
            year: null,
            owner: "sales"
          }
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Antwort

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "update_list",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "list_id": "customers",
        "name": "Customers (VIP)",
        "description": "Everyone who bought at least once",
        "source": "checkout",
        "status": "ready",
        "custom": {
          "origin": "checkout",
          "owner": "sales"
        },
        "created_at": "2026-10-01T10:00:00.000Z",
        "updated_at": "2026-10-12T15:22:41.000Z",
        "stats": {
          "total": 1834,
          "ok": 1790,
          "opened": 912,
          "clicked": 233
        }
      }
    }
  ]
}

Antwortfelder

  • (list)

    Die Liste nach der Änderung, mit stats.

Fehler

Fehler auf HTTP-Ebene liefern type, code und message. Mit CMD markierte Fehler kommen im Befehlsergebnis zurück, mit HTTP 200.

  • 401INVALID_API_KEY

    Der API Key existiert nicht, wurde widerrufen oder im Dashboard deaktiviert.

  • 429RATE_LIMITED

    Mehr als 15 Requests/s oder 15 gleichzeitig für dieselbe IP + API Key. Warten Sie die Sekunden aus Retry-After ab.

  • CMDMISSING_SCOPE

    Dem API Key fehlt der Scope, den dieser Befehl braucht. Die anderen Befehle im Request laufen trotzdem.

  • CMDINVALID_ARGS

    Ein Pflichtargument fehlt oder ist ungültig: E-Mail, Feldwert, Enum-Option, where-Schlüssel, Listen-ID …

  • CMDNOT_FOUND

    Der Kontakt, die Liste, das Feld oder das Segment existiert nicht.

  • CMDINTERNAL

    Serverfehler. Details werden nur ins Server-Log geschrieben.