---
title: "set_delivery"
canonical_url: "https://tweetstream.io/zh-cn/docs/api/agent-action-set-delivery"
last_updated: 2026-11-05
---

# set_delivery

修改实时流推送的内容：默认和单个账号的关键词过滤与 Discord webhook、事件类型、关联账号提醒、Binance Square、新闻来源、Instagram 的 Discord 推送目标，以及 Truth Social、Robinhood Social 和慈善项目信息流。read 级：只需 API key。同名 MCP 工具需要 tweetstream:watchlist 权限范围。

Canonical URL: https://tweetstream.io/zh-cn/docs/api/agent-action-set-delivery

## `POST /api/agent/actions/set_delivery`

`https://tweetstream.io/api/agent/actions/set_delivery`

## 授权

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

## 请求体

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `changes` | `object[]`, 必填 | an array of at most 20 item(s) |
| `changes.keywords` | `string[]`, 必填 | Keyword filters; an empty list delivers every post. |
| `changes.kind` | `enum<string>`, 必填 |  |

### 请求体示例

```json
{
  "changes": [
    {
      "keywords": [
        "solana",
        "etf"
      ],
      "kind": "global_keywords"
    }
  ]
}
```

## 响应字段

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `results` | `object[]`, 必填 |  |
| `results.kind` | `enum<string>`, 必填 |  |
| `results.outcome` | `enum<string>`, 必填 |  |

## 响应

| 状态 | 说明 | 请求头 |
| --- | --- | --- |
| `200` | 成功 |  |
| `400` | 输入不符合该操作的 schema（INVALID_REQUEST） |  |
| `401` | API key 缺失或无效 |  |
| `403` | 请求带有外部 Origin |  |
| `429` | 已达到速率限制（RATE_LIMITED），请在 retryAfterSeconds 秒后重试 |  |
| `503` | 暂时不可用，请稍后重试 |  |

### 200

```json
{
  "results": [
    {
      "kind": "global_keywords",
      "outcome": "applied"
    }
  ]
}
```

### 400

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 401

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 403

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 429

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

### 503

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "<string>",
    "reason": "not_offered",
    "retryAfterSeconds": 123
  },
  "next": {
    "message": "<string>",
    "action": "call_action",
    "method": "POST",
    "name": "<string>",
    "url": "<string>",
    "who": "agent"
  }
}
```

## 代码示例

### cURL

```bash
curl --request POST \
  --url https://tweetstream.io/api/agent/actions/set_delivery \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "changes": [
    {
      "keywords": [
        "solana",
        "etf"
      ],
      "kind": "global_keywords"
    }
  ]
}'
```

### JavaScript

```javascript
const response = await fetch("https://tweetstream.io/api/agent/actions/set_delivery", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "changes": [
      {
        "keywords": [
          "solana",
          "etf"
        ],
        "kind": "global_keywords"
      }
    ]
  }),
});

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

### Python

```python
import os
import requests

response = requests.post(
    "https://tweetstream.io/api/agent/actions/set_delivery",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
    json={
        "changes": [
            {
                "keywords": [
                    "solana",
                    "etf",
                ],
                "kind": "global_keywords",
            },
        ],
    },
)

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