---
id: "zh/api-post-nd-api-enterprise-broadcast"
title: "发布公告"
language: "zh"
description: "POST /nd/api/enterprise/broadcast：发布公告 接口说明，包含路径、方法、参数和返回信息。"
canonical_url: "https://www.babel.cc/public/babelwiki/zh/api-post-nd-api-enterprise-broadcast.html"
markdown_url: "https://www.babel.cc/public/babelwiki/ai/zh/api-post-nd-api-enterprise-broadcast.md"
alternates: {"en": "https://www.babel.cc/public/babelwiki/ai/en/api-post-nd-api-enterprise-broadcast.md", "zh": "https://www.babel.cc/public/babelwiki/ai/zh/api-post-nd-api-enterprise-broadcast.md"}
reading_note: "文档记录不等于当前部署能力；以实际版本、授权模块与配置为准。保留原文的可选、限制及待确认说明，勿补猜接口。 / Documentation is not a guarantee for every deployment. Preserve optional-module requirements, limitations and unresolved API contracts."
---

# 发布公告

| 属性 | 值 |
| --- | --- |
| HTTP 方法 | `POST` |
| 接口路径 | `/nd/api/enterprise/broadcast` |
| 所属分类 | 企业 API |

## 接口说明




#### POST 请求体参数

| 参数 | 类型 | 说明（保留原资料的必填、默认值及范围） |
| --- | --- | --- |
| `title` | `string` | 公告内容字符串（必填） |
| `content` | `string` | 内容（必填） |
| `target_users` | `string[]` | 指定接收用户的 ID，使用 JSON 数组；不指定用户时传 `[]`。 |
| `target_deps` | `string[]` | 目标部门 ID，使用 JSON 数组；接收范围包含这些部门及其子部门的成员。不指定部门时传 `[]`。 |

`target_users` 与 `target_deps` 都为空数组时，不发送公告。至少一个数组非空时，将指定用户与目标部门中的用户合并后发送。请显式传入这两个 JSON 数组，参数名不带 `[]`，也不要将整个数组编码成字符串。

两者都为空，不发送：

```json
{
  "title": "示例公告",
  "content": "示例内容",
  "target_users": [],
  "target_deps": []
}
```

合并指定用户和部门成员后发送（ID 为示例值）：

```json
{
  "title": "示例公告",
  "content": "示例内容",
  "target_users": ["2001"],
  "target_deps": ["3001"]
}
```

#### 返回字段说明

```json
{"code":0,"success":true}
```

## 调用说明

- 调用前需完成 [获取 token](https://www.babel.cc/public/babelwiki/zh/api-post-api-token-do.html) 或相应免登录认证，并在请求 Header 中携带 `Authorization: Bearer <access_token>`。
- 参数和返回字段如因部署版本存在差异，应以实际私有云 API 文档和联调结果为准。
- 所属分类：企业 API。

## 收件范围确认

空数组不代表全员。仅 `target_users` 非空时发送给指定用户；仅 `target_deps` 非空时发送给目标部门及其子部门中的用户；两者非空时合并接收范围；两者都为空时不发送。这里说明的是显式传入数组时的行为，不将省略参数等同于空数组。
