---
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/vi/api-reference/contacts/lists/update-list

Liên hệ: danh sách

# Cập nhật danh sách

Đổi tên, mô tả, nguồn hoặc dữ liệu tùy chỉnh của danh sách. Chỉ thay đổi những gì bạn gửi.

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

Cần phạm vi `contact:update` trên API key của bạn.

## Tham số

- `list_id` string bắt buộc
Danh sách cần đổi. Không đổi được bản thân id.
ví dụ `"customers"`
- `name` string không bắt buộc
Tên mới. `null` để xóa.
- `description` string không bắt buộc
Mô tả mới. `null` để xóa.
- `source` string không bắt buộc
Nguồn mới. `null` để xóa.
- `custom` object không bắt buộc
Gộp vào dữ liệu tùy chỉnh hiện có. Khóa gửi là `null` sẽ bị xóa.
ví dụ `{ "year": null, "owner": "sales" }`

## Bắt đầu nhanh

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

## Phản hồi

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

### Trường phản hồi

- `(list)`
Danh sách sau khi đổi, kèm `stats`.

## Lỗi

Lỗi ở mức HTTP trả về `type`, `code` và `message`. Lỗi đánh dấu CMD được trả về trong kết quả lệnh, với HTTP 200.

- 401`INVALID_API_KEY`
API key không tồn tại, đã bị thu hồi hoặc bị tắt trong dashboard.
- 429`RATE_LIMITED`
Hơn 15 yêu cầu/giây hoặc 15 yêu cầu đồng thời cho cùng IP + API key. Chờ số giây trong Retry-After.
- CMD`MISSING_SCOPE`
API key không có phạm vi lệnh này cần. Các lệnh khác trong yêu cầu vẫn chạy.
- CMD`INVALID_ARGS`
Thiếu hoặc sai tham số bắt buộc: email, giá trị trường, tùy chọn enum, khóa where, id danh sách…
- CMD`NOT_FOUND`
Liên hệ, danh sách, trường hoặc phân khúc không tồn tại.
- CMD`INTERNAL`
Lỗi máy chủ. Chi tiết chỉ được ghi vào log máy chủ.
