---
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/activity/list-events

Liên hệ: hoạt động

# Liệt kê sự kiện

Lịch sử của một liên hệ, mới nhất trước: lượt gửi, mở, nhấp, bounce, khiếu nại và hủy đăng ký.

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

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

Sự kiện được ghi lại bởi việc gửi và theo dõi. API chỉ đọc chúng.

## Tham số

- `email` string bắt buộc
Liên hệ.
ví dụ `"ana@acme.com"`
- `types` string[] không bắt buộc
Chỉ các loại: `sent`, `open`, `click`, `bounce`, `complaint`, `unsubscribe`.
ví dụ `["open", "click"]`
- `limit` number không bắt buộc
Kích thước trang, từ 1 đến 1000. Mặc định 50.
- `cursor` string không bắt buộc
`next_cursor` của trang trước.

## Bắt đầu nhanh

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "list_events",
        args: {
          email: "ana@acme.com",
          types: [
            "open",
            "click"
          ],
          limit: 50
        }
      }
    ]
  },
  { 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": "list_events",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "events": [
          {
            "event_id": "ev_7c1d02",
            "type": "click",
            "at": "2026-10-14T21:04:10.000Z",
            "campaign_id": "cmp_october",
            "list_id": "customers",
            "url": "https://acme.com/offer",
            "ip": "203.0.113.24",
            "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)",
            "reason": null,
            "by_proxy": false,
            "hard": null,
            "meta": null
          },
          {
            "event_id": "ev_7c1cf9",
            "type": "open",
            "at": "2026-10-14T21:03:55.000Z",
            "campaign_id": "cmp_october",
            "list_id": "customers",
            "url": null,
            "ip": "203.0.113.24",
            "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)",
            "reason": null,
            "by_proxy": false,
            "hard": null,
            "meta": null
          }
        ],
        "has_more": true,
        "next_cursor": "eyJ0IjoxNzYwNDc1ODM1fQ"
      }
    }
  ]
}
```

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

- `events[].type`
`sent`, `open`, `click`, `bounce`, `complaint` hoặc `unsubscribe`.
- `events[].at`
Thời điểm xảy ra.
- `events[].campaign_id / list_id`
Chiến dịch và danh sách email thuộc về, nếu biết.
- `events[].url`
Link, ở sự kiện `click`.
- `events[].ip / user_agent`
Nguồn của lượt mở hoặc nhấp.
- `events[].by_proxy`
`true` khi lượt mở đến từ proxy bảo mật thư chứ không phải người nhận.
- `events[].reason / hard`
Với `bounce`: lý do, và có phải hard bounce không.
- `has_more / next_cursor`
Phân trang. Gửi `next_cursor` làm `cursor` để lấy sự kiện cũ hơn.

## 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`INVALID_CURSOR`
Cursor sai định dạng hoặc thuộc truy vấn hay tài khoản khác.
- CMD`INTERNAL`
Lỗi máy chủ. Chi tiết chỉ được ghi vào log máy chủ.
