> ## 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.

# 绑定 Actor 到工作空间

> 将现有 Actor 绑定到工作空间

```
POST /openapi/memorylake/api/v3/workspaces/{workspaceId}/actors
```

将现有 Actor 绑定到工作空间。绑定后，Actor 可以参与该工作空间项目中的会话。一个 Actor 可以绑定到多个工作空间。

<Note>
  **所需权限：** `workspace:actor_bind`
</Note>

### 路径参数

<ParamField path="workspaceId" type="string" required>
  工作空间 ID
</ParamField>

### 请求体

<ParamField body="actor_id" type="string" required>
  要绑定的 Actor ID。Actor 必须已存在（参见[创建 Actor](/zh/features/memorylake/api-reference/actors/create-actor)）。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v3/workspaces/ws-7k8m9n0p1q2r/actors' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "actor_id": "act-a1b2c3d4e5f6"
    }'
  ```
</RequestExample>

### 响应

<ResponseField name="data" type="object">
  <Expandable title="Actor 绑定">
    <ResponseField name="actor_id" type="string">Actor ID</ResponseField>
    <ResponseField name="custom_id" type="string">调用方定义的外部标识符</ResponseField>
    <ResponseField name="actor_type" type="string">Actor 类型：`HUMAN` 或 `ASSISTANT`</ResponseField>
    <ResponseField name="display_name" type="string">人类可读的显示名称</ResponseField>
    <ResponseField name="bound_at" type="string">Actor 绑定到此工作空间的时间戳</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "actor_id": "act-a1b2c3d4e5f6",
      "custom_id": "user-ext-001",
      "actor_type": "HUMAN",
      "display_name": "Alice Chen",
      "bound_at": "2025-03-15T09:00:00Z"
    }
  }
  ```
</ResponseExample>
