> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 转让所有权

> 将此组织团队的所有权转让给另一名活跃的真人成员（不能是 API Key，也不能是虚拟成员）

```
POST /openapi/memorylake/admin/v1/team/transfer-ownership
```

将此组织团队的所有权转让给另一名活跃的真人成员（不能是 API Key，也不能是虚拟成员）。转让后，调用方成为管理员，不能再执行仅限所有者的操作，包括本操作。用同一个 `Idempotency-Key` 重试只会向同一调用方重放首次结果，其他人会被拒绝。同一团队已有转让正在进行时返回 409，请重试。

<Warning>
  **高风险操作。** 调用后立即生效。调用前请先读完上面说明的影响。
</Warning>

<Note>
  **所需权限：** 仅团队所有者
</Note>

### 请求头

<ParamField header="Idempotency-Key" type="string">
  可选。同一调用方使用相同值重试会重放首次结果。
</ParamField>

### 请求体

<ParamField body="new_owner_principal_id" type="string" required>
  将成为团队所有者的有效真人成员的 `principal_id`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/admin/v1/team/transfer-ownership' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Idempotency-Key: 7c1d2e3f-0a9b-4c8d-b7e6-f5a4d3c2b1a0' \
    -H 'Content-Type: application/json' \
    -d '{
      "new_owner_principal_id": "670048c3ad268485e39c944bbf532eb8"
    }'
  ```
</RequestExample>

### 响应

<ResponseField name="data" type="object">
  <Expandable title="Transfer Team Ownership 对象">
    <ResponseField name="new_owner_principal_id" type="string">新所有者的 `principal_id`</ResponseField>
    <ResponseField name="previous_owner_principal_id" type="string">原所有者的 `principal_id`</ResponseField>
    <ResponseField name="tenant_id" type="string">团队 ID</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Operation completed successfully",
    "data": {
      "new_owner_principal_id": "a98ea7f681cc99557e9ff07a98bdfd93",
      "previous_owner_principal_id": "4b00105cd113649644fb6ca4b1b43592",
      "tenant_id": "0b27c6f12b96b127b1157e40a00b0b79"
    }
  }
  ```
</ResponseExample>

### 错误

出错时返回 `success: false`、`message` 和 `error_code`。全部错误码见[错误码](/zh/features/memorylake/api-reference/errors)。

| 状态码 | 含义 |
| - | - |
| `400` | 参数或请求体无效 |
| `401` | API Key 缺失、无效、已停用或已过期 |
| `403` | 该 Key 无权执行此操作 |
| `409` | 请求与当前状态冲突，例如重复或已达上限 |
| `422` | 请求体或参数未通过校验 |
| `429` | 请求过多，请按 `Retry-After` 等待后重试 |
| `500` | 服务端错误 |
| `503` | 暂时不可用，请稍后重试 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.