Skip to main content

分配成员席位

调用条件、权限、请求字段、响应字段与错误处理。

请求与权限

POST https://openapi.qwenwork.ai/v1/biz/members/{user_id}:assign-seat 鉴权:Authorization: Bearer <access_token>;使用用户 OAuth 授权获得的访问令牌。 所需业务 Scope:biz.seat.manage 契约声明的授权方式:组织授权(organization) Scope 需由平台为应用开通;用户须有相应业务权限,目标资源须在其可访问范围内。个人/组织方式是否为该应用开放,以控制台实际配置为准。

功能与限制

为一名 frozen 状态的企业成员分配席位,使其变为 active。user_id 为成员 UUID,调用时无需请求体。 应用需要 biz.seat.manage 授权,操作者需要席位管理权限,成员须在其管理范围内。企业席位不足时返回业务冲突。pending、removed 状态成员以及无需席位的数字员工会返回相应错误。 成功返回更新后的成员资料。成员已经为 active 时,重复调用返回当前资料。

路径参数

参数类型必填说明及约束
user_idstring是目标成员 UUID
格式:"uuid"

请求体

公开契约未声明请求体。不要自行添加身份字段或未经声明的业务字段。

成功响应

保持各业务接口原始响应结构,不统一添加 code/msg/data 包装。

HTTP 200

分配成员席位成功 响应类型: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": "active",
  "user_id": "00000000-0000-4000-8000-000000000001",
  "username": "example-member"
}
字段类型必含说明及约束
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_seat_count_reached 表示容量不足;member_seat_exempt 表示数字员工不占席位;seat_request_member_not_frozen 表示成员状态不支持操作;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 服务调用超时;写请求结果可能不确定,先核对实际结果再重试。
保留响应中的请求 ID 和错误字段用于排查。写操作超时或断线后可能已经生效,不能仅凭没有收到成功响应就自动重试。

完整字段契约

下方 JSON 包含本接口完整请求、响应、错误 Schema、嵌套约束和公开扩展定义,可复制用于核对。未声明的成功示例不作推测。
{
  "components": {
    "schemas": {
      "BizDomainErrorResponse": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "org_status_reason": {
            "description": "企业状态原因的原始 JSON 值,可为 null"
          },
          "request_id": {
            "type": "string"
          },
          "seat_count": {
            "description": "领域错误提供时返回的企业配置席位数",
            "format": "int64",
            "type": "integer"
          },
          "seat_used": {
            "description": "领域错误提供时返回的企业已用席位数",
            "format": "int64",
            "type": "integer"
          },
          "trace_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "error",
          "detail",
          "request_id",
          "trace_id"
        ],
        "type": "object"
      },
      "BizGatewayErrorResponse": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "integer"
          },
          "data": {
            "type": "null"
          },
          "error_code": {
            "type": "string"
          },
          "msg": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "trace_id": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "msg",
          "data",
          "error_code"
        ],
        "type": "object"
      },
      "MemberLookupRead": {
        "additionalProperties": false,
        "properties": {
          "biz_org_id": {
            "type": "string"
          },
          "biz_team_id": {
            "type": "string"
          },
          "blocked": {
            "type": "boolean"
          },
          "dingtalk_uid": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "username",
          "first_name",
          "last_name",
          "email",
          "phone_number",
          "dingtalk_uid",
          "biz_org_id",
          "biz_team_id",
          "status",
          "blocked"
        ],
        "type": "object"
      },
      "ValidationErrorResponse": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "error": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "trace_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "error",
          "detail",
          "request_id",
          "trace_id"
        ],
        "type": "object"
      },
      "ValidationIssue": {
        "additionalProperties": false,
        "properties": {
          "ctx": {
            "additionalProperties": {},
            "type": "object"
          },
          "input": {},
          "loc": {
            "items": {},
            "type": [
              "array",
              "null"
            ]
          },
          "msg": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "loc",
          "msg",
          "input"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "OpenPlatformBearer": {
        "description": "企业授权应用访问令牌;Scope 不代替操作者权限与资源隔离",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/biz/members/{user_id}:assign-seat": {
      "post": {
        "description": "为一名 frozen 状态的企业成员分配席位,使其变为 active。user_id 为成员 UUID,调用时无需请求体。\n\n应用需要 biz.seat.manage 授权,操作者需要席位管理权限,成员须在其管理范围内。企业席位不足时返回业务冲突。pending、removed 状态成员以及无需席位的数字员工会返回相应错误。\n\n成功返回更新后的成员资料。成员已经为 active 时,重复调用返回当前资料。",
        "operationId": "biz-assign-member-seat",
        "parameters": [
          {
            "description": "目标成员 UUID",
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "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": "active",
                  "user_id": "00000000-0000-4000-8000-000000000001",
                  "username": "example-member"
                },
                "schema": {
                  "$ref": "#/components/schemas/MemberLookupRead"
                }
              }
            },
            "description": "分配成员席位成功",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "请求或操作者身份资料不满足业务要求;primary_contact_phone_required / primary_contact_email_required 表示手机号与邮箱均缺失,补齐资料后重试。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "令牌缺失或无效;检查企业授权访问令牌。",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "Scope、操作者权限或企业/团队范围检查失败;核对目标成员范围及企业授权。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "目标成员不存在;核对成员标识及授权范围。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BizGatewayErrorResponse"
                }
              }
            },
            "description": "Method Not Allowed",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "org_seat_count_reached 表示容量不足;member_seat_exempt 表示数字员工不占席位;seat_request_member_not_frozen 表示成员状态不支持操作;enterprise_seat_lock_busy 表示席位操作繁忙。核对容量和状态后处理。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BizGatewayErrorResponse"
                }
              }
            },
            "description": "Request Entity Too Large",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BizGatewayErrorResponse"
                }
              }
            },
            "description": "Unsupported Media Type",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ValidationErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "参数类型、UUID、必填性或长度不合法;按 detail 中的位置修正请求。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BizGatewayErrorResponse"
                }
              }
            },
            "description": "Too Many Requests",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "业务处理失败;保留 request_id/trace_id 联系维护方,写请求先核对实际结果再重试。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "Biz 服务调用失败;保留 request_id/trace_id 联系维护方,写请求先核对实际结果再重试。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "Biz 服务暂不可用;写请求先核对实际结果再重试。 seat_projection_refresh_busy 表示过期容量刷新锁忙,本次不新增分配,可重试。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BizDomainErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/BizGatewayErrorResponse"
                    }
                  ]
                }
              }
            },
            "description": "Biz 服务调用超时;写请求结果可能不确定,先核对实际结果再重试。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "分配成员席位",
        "tags": [
          "席位"
        ]
      }
    }
  },
  "info": {
    "title": "分配成员席位",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
返回 OpenAPI 总览。