Skip to content

创建公共邮箱

创建一个公共邮箱。

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/mail/v1/public_mailboxes
HTTP MethodPOST
接口频率限制50 次/秒
支持的应用类型custom
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用mail:public_mailbox 查询、创建、修改公共邮箱
字段权限要求> Tip: 该接口返回体中存在下列敏感字段,仅当开启对应的权限后才会返回;如果无需获取这些字段,则不建议申请 mail:public_mailbox.public_mailbox_geo 查看公共邮箱数据驻留地

请求头

名称类型必填描述
Authorizationstringtenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token
Content-Typestring固定值:"application/json; charset=utf-8"

请求体

名称类型必填描述
emailstring公共邮箱地址
示例值:"test_public_mailbox@xxx.xx"
namestring公共邮箱名称
示例值:"test public mailbox"
geostring数据驻留地
示例值:"cn"

请求体示例

json
{
    "email": "test_public_mailbox@xxx.xx",
    "name": "test public mailbox",
    "geo": "cn"
}

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
datapublic_mailbox-
  └ public_mailbox_idstring公共邮箱唯一标识
  └ emailstring公共邮箱地址
  └ namestring公共邮箱名称
  └ geostring数据驻留地
字段权限要求mail:public_mailbox.public_mailbox_geo 查看公共邮箱数据驻留地

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {
        "public_mailbox_id": "xxxxxxxxxxxxxxx",
        "email": "test_public_mailbox@xxx.xx",
        "name": "test public mailbox",
        "geo": "cn"
    }
}

错误码

HTTP状态码错误码描述排查建议
4091234006email address has been used邮件地址已被占用,请使用其他邮件地址
4001234008email or name is invalid邮件地址或名称不合法,请修改后重试
4091234033email address has been used by another member as login account邮件地址已被他人用作登录邮箱,请使用其他邮件地址
2001234026The number of tenant public mailboxes has reached the limit and cannot be created公共邮箱创建数已达上限,请删除后重试
4001234040not set geo name auth没有设置geo的权限
4001234041tenant not open mg not set geo name租户没有开通MG,不能设置geo字段
4001234042req set geo not find in geo list您设置的 geo 不在系统支持的 geo 列表中

内容来源:飞书开放平台 · 自动爬取整理