---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/pl/api-reference/contacts/lists/update-list

Kontakty: listy

# Zaktualizuj listę

Zmień nazwę, opis, źródło lub własne dane listy. Zmienia się tylko to, co wysyłasz.

POST `https://g.sendcorex.com/v1/contacts` command: update_list

Wymaga zakresu `contact:update` w Twoim API key.

## Argumenty

- `list_id` string wymagane
Lista do zmiany. Samego id nie można zmienić.
np. `"customers"`
- `name` string opcjonalne
Nowa nazwa. `null` ją czyści.
- `description` string opcjonalne
Nowy opis. `null` go czyści.
- `source` string opcjonalne
Nowe źródło. `null` je czyści.
- `custom` object opcjonalne
Scalane z obecnymi własnymi danymi. Klucz wysłany jako `null` jest usuwany.
np. `{ "year": null, "owner": "sales" }`

## Szybki start

```
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);
```

## Odpowiedź

```
{
  "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
        }
      }
    }
  ]
}
```

### Pola odpowiedzi

- `(list)`
Lista po zmianie, ze `stats`.

## Błędy

Błędy na poziomie HTTP zwracają `type`, `code` i `message`. Błędy oznaczone CMD wracają w wyniku polecenia, z HTTP 200.

- 401`INVALID_API_KEY`
API key nie istnieje, został unieważniony lub wyłączony w panelu.
- 429`RATE_LIMITED`
Ponad 15 zapytań/s lub 15 jednocześnie dla tego samego IP + API key. Odczekaj liczbę sekund z Retry-After.
- CMD`MISSING_SCOPE`
API key nie ma zakresu wymaganego przez to polecenie. Pozostałe polecenia w zapytaniu i tak się wykonują.
- CMD`INVALID_ARGS`
Brakuje wymaganego argumentu lub jest nieprawidłowy: e-mail, wartość pola, opcja enum, klucz where, id listy…
- CMD`NOT_FOUND`
Kontakt, lista, pole lub segment nie istnieje.
- CMD`INTERNAL`
Błąd serwera. Szczegóły trafiają tylko do logu serwera.
