---
title: "开启账号的关联账号列表提醒"
canonical_url: "https://tweetstream.io/zh-cn/docs/api/enable-affiliate-alerts"
last_updated: 2026-11-05
---

# 开启账号的关联账号列表提醒

POST /api/affiliate-alerts 为一个监控账号开启关联账号列表提醒：每当该账号的关联列表新增或移除成员，都会推送一条事件。成功时返回该账号和新的设置；账号不在监控列表中时返回 404。要关闭提醒，对同一路径发送 DELETE 请求。

Canonical URL: https://tweetstream.io/zh-cn/docs/api/enable-affiliate-alerts

## `POST /api/affiliate-alerts`

`https://api.tweetstream.io/api/affiliate-alerts`

## 授权

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `Authorization` | `string`, 必填 | 使用 TweetStream API 密钥进行 Bearer 认证：`Bearer <key>`。 |

## 请求体

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `account` | `string`, 必填 |  |

### 请求体示例

```json
{
  "account": "marketdesk"
}
```

## 响应字段

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `account` | `string`, 必填 |  |
| `affiliateAlertsEnabled` | `boolean`, 必填 |  |

## 响应

| 状态 | 说明 | 请求头 |
| --- | --- | --- |
| `200` | 成功 |  |
| `400` | 请求无效 |  |
| `401` | API key 缺失或无效 |  |
| `403` | 已认证的账号无法使用此功能 |  |
| `404` | 找不到请求的资源 |  |
| `500` | 请求未能完成 |  |

### 200

```json
{
  "account": "<string>",
  "affiliateAlertsEnabled": true
}
```

### 400

```json
{
  "error": "<string>"
}
```

### 401

```json
{
  "error": "<string>"
}
```

### 403

```json
{
  "error": "<string>"
}
```

### 404

```json
{
  "error": "<string>"
}
```

### 500

```json
{
  "error": "<string>"
}
```

## 代码示例

### cURL

```bash
curl --request POST \
  --url https://api.tweetstream.io/api/affiliate-alerts \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "account": "marketdesk"
}'
```

### JavaScript

```javascript
const response = await fetch("https://api.tweetstream.io/api/affiliate-alerts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "account": "marketdesk"
  }),
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.post(
    "https://api.tweetstream.io/api/affiliate-alerts",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
    json={
        "account": "marketdesk",
    },
)

print(response.status_code, response.json())
```
