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

ผู้ติดต่อ: รายชื่อ

# แสดงรายการรายชื่อ

ทุกรายชื่อของบัญชี เก่าสุดก่อน เลือกแสดงจำนวนสมาชิกได้

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

ต้องมีขอบเขต `contact:read` บน API key ของคุณ

## อาร์กิวเมนต์

- `with_stats` boolean ไม่บังคับ
เพิ่ม `stats` (สมาชิก ส่งได้ เปิด คลิก) ให้แต่ละรายชื่อ
- `include_deleting` boolean ไม่บังคับ
ส่งรายชื่อที่ถูกลบแต่ยังล้างไม่เสร็จด้วย

## เริ่มต้นอย่างรวดเร็ว

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "list_lists",
        args: {
          with_stats: true
        }
      }
    ]
  },
  { 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);
```

## การตอบกลับ

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "list_lists",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "lists": [
          {
            "list_id": "customers",
            "name": "Customers",
            "description": "Everyone who bought at least once",
            "source": "checkout",
            "status": "ready",
            "custom": {
              "origin": "checkout",
              "year": 2026
            },
            "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
            }
          }
        ]
      }
    }
  ]
}
```

### ฟิลด์การตอบกลับ

- `lists[].list_id`
id ที่ใช้ในทุกคำสั่งรายชื่อ
- `lists[].name / description / source`
แอตทริบิวต์ที่ตั้งตอนสร้างหรืออัปเดตรายชื่อ
- `lists[].status`
`ready` หรือ `deleting` ระหว่างล้างรายชื่อที่ลบแล้ว
- `lists[].custom`
ข้อมูลของคุณเอง ไม่เกิน 50 คีย์
- `lists[].stats`
เฉพาะเมื่อใช้ `with_stats` สมาชิก `total` สมาชิกที่ส่งได้ `ok` และสมาชิกที่เคย `opened` หรือ `clicked`

## ข้อผิดพลาด

ข้อผิดพลาดระดับ HTTP ส่งกลับ `type`, `code` และ `message` ข้อผิดพลาดที่มีเครื่องหมาย CMD จะกลับมาในผลลัพธ์ของคำสั่ง พร้อม HTTP 200

- 401`INVALID_API_KEY`
API key ไม่มีอยู่ ถูกเพิกถอน หรือถูกปิดในแดชบอร์ด
- 429`RATE_LIMITED`
เกิน 15 คำขอ/วินาที หรือ 15 คำขอพร้อมกันสำหรับ IP + API key เดียวกัน รอจำนวนวินาทีใน Retry-After
- CMD`MISSING_SCOPE`
API key ไม่มีขอบเขตที่คำสั่งนี้ต้องการ คำสั่งอื่นในคำขอยังทำงาน
- CMD`INVALID_ARGS`
อาร์กิวเมนต์ที่จำเป็นหายไปหรือไม่ถูกต้อง: อีเมล ค่าฟิลด์ ตัวเลือก enum คีย์ where id รายชื่อ…
- CMD`INTERNAL`
ข้อผิดพลาดของเซิร์ฟเวอร์ รายละเอียดเขียนเฉพาะในล็อกเซิร์ฟเวอร์
