Skip to main content

创建企业成员

调用条件、请求参数、响应示例与错误处理。

请求方法:POST
https://openapi.qwenwork.cn/v1/biz/members
创建授权企业内的普通成员。邮箱须符合已验证的企业域名且不能重复(包含已移除成员),原始邮箱不可包含大写字母。team_id 缺省或 null 时使用默认启用团队。仅创建无席位成员,成功返回 frozen 状态的成员资料;分配席位须另行调用分配成员席位接口。 交互类型:json
鉴权、必填项及字段间约束以本页说明为准。

接入要求

请求鉴权

使用 HTTP Bearer,在请求头中传入访问令牌:
Authorization: Bearer <access_token>
企业授权应用访问令牌;Scope 不代替操作者权限与资源隔离

所需权限

支持的授权方式:组织授权 (organization) biz.member.write — 在授权企业内创建普通成员
  • 权限级别:敏感权限 (sensitive)

请求参数

本接口未声明请求参数。

请求体

请求体必填。 application/json
  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。
字段类型必填说明
emailstring是Lowercase email; Unicode and Punycode domains are accepted and normalized by the service.
first_namestring是最短长度:1
最长长度:128
last_namestring否最长长度:128
team_idstring | null否—
请求体示例 · application/json
{
  "email": "member@example.com",
  "first_name": "示例成员",
  "last_name": "",
  "team_id": null
}

成功响应

HTTP 201

创建企业成员成功 响应类型:application/json 响应示例
{
  "biz_org_id": "00000000-0000-4000-8000-000000000002",
  "biz_team_id": "00000000-0000-4000-8000-000000000003",
  "blocked": false,
  "dingtalk_uid": null,
  "email": "member@example.com",
  "first_name": "示例成员",
  "last_name": "",
  "phone_number": null,
  "status": "frozen",
  "user_id": "00000000-0000-4000-8000-000000000001",
  "username": "example-member"
}

响应字段说明

  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。 响应表中的“必填”表示该字段必须出现在响应对象中。
字段类型必填说明
biz_org_idstring是—
biz_team_idstring是—
blockedboolean是—
dingtalk_uidstring | null是—
emailstring | null是—
first_namestring是—
last_namestring是—
phone_numberstring | null是—
statusstring是—
user_idstring是—
usernamestring是—

错误响应

HTTP含义与处理说明
400请求或操作者身份资料不满足业务要求;primary_contact_phone_required / primary_contact_email_required 表示手机号与邮箱均缺失,补齐资料后重试。
401令牌缺失或无效;检查企业授权访问令牌。
403Scope、操作者权限、企业/团队准入或邮箱域名检查失败;核对企业授权、目标团队及已验证邮箱域名。
404成员或企业不存在;核对目标标识。
405Method Not Allowed
409org_managed_auth_email_exists 表示邮箱已存在;enterprise_seat_lock_busy 表示成员创建所需的企业容量锁繁忙。先核对成员创建结果再重试。
413Request Entity Too Large
415Unsupported Media Type
422参数类型、UUID、必填性或长度不合法;按 detail 中的位置修正请求。
429Too Many Requests
500业务处理失败;保留 request_id/trace_id 联系维护方,写请求先核对实际结果再重试。
502Biz 服务调用失败;保留 request_id/trace_id 联系维护方,写请求先核对实际结果再重试。
503Biz 服务暂不可用;写请求先核对实际结果再重试。 seat_projection_refresh_busy 表示过期容量刷新锁忙,本次不新增分配,可重试。
504Biz 服务调用超时;写请求结果可能不确定,先核对实际结果再重试。

错误响应字段说明

适用状态:HTTP 400, 401, 403, 404, 409, 500, 502, 503, 504 · application/json
BizDomainErrorResponse
  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。 响应表中的“必填”表示该字段必须出现在响应对象中。
字段类型必填说明
codestring否—
detailstring是—
errorstring是—
org_status_reason未限定类型(详见约束)否企业状态原因的原始 JSON 值,可为 null
request_idstring是—
seat_countinteger否领域错误提供时返回的企业配置席位数
格式:int64
seat_usedinteger否领域错误提供时返回的企业已用席位数
格式:int64
trace_idstring | null是—
BizGatewayErrorResponse
  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。 响应表中的“必填”表示该字段必须出现在响应对象中。
字段类型必填说明
codeinteger是—
datanull是—
error_codestring是—
msgstring是—
request_idstring否—
trace_idstring否—
适用状态:HTTP 405, 413, 415, 429 · application/json
  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。 响应表中的“必填”表示该字段必须出现在响应对象中。
字段类型必填说明
codeinteger是—
datanull是—
error_codestring是—
msgstring是—
request_idstring否—
trace_idstring否—
适用状态:HTTP 422 · application/json
ValidationErrorResponse
  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。 响应表中的“必填”表示该字段必须出现在响应对象中。
字段类型必填说明
detailarray | null是—
detail[].ctxobject否额外属性:未限定类型
detail[].input任意 JSON 值是—
detail[].locarray | null是—
detail[].msgstring是—
detail[].typestring是—
errorstring是—
request_idstring是—
trace_idstring | null是—
BizGatewayErrorResponse
  • 额外属性:false
点号表示嵌套字段,[] 表示数组元素;子字段的必填要求在所属对象存在时生效。是否允许 null 以字段类型为准。 响应表中的“必填”表示该字段必须出现在响应对象中。
字段类型必填说明
codeinteger是—
datanull是—
error_codestring是—
msgstring是—
request_idstring否—
trace_idstring否—

响应头

以下按响应头合并说明,适用状态以各字段列出的范围为准。除非契约明确要求,不应假定所有响应都携带该头。
响应头类型适用 HTTP 状态说明
X-Request-IDstring201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 429, 500, 502, 503, 504开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。
匹配规则:^[0-9a-f]{32}$
X-Trace-IDstring201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 429, 500, 502, 503, 504开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。
匹配规则:^[0-9a-f]{32}$
WWW-Authenticatestring401—
Retry-Afterstring429Seconds to wait before retrying.