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

# 获取 Actor

> 通过 ID 或自定义 ID 检索单个 Actor

```
GET /openapi/memorylake/api/v3/actors/{id}
```

返回单个 Actor 的完整详情。默认情况下，`{id}` 被视为 MemoryLake Actor ID。设置 `by_custom_id=true` 可以改为通过 `custom_id` 查找 Actor。

<Note>
  **所需权限：** `actor:read`
</Note>

### 路径参数

<ParamField path="id" type="string" required>
  Actor ID，或当 `by_custom_id` 为 `true` 时为 Actor 的 `custom_id`。
</ParamField>

### 查询参数

<ParamField query="by_custom_id" type="boolean" default="false">
  当为 `true` 时，路径参数将被解释为 Actor 的 `custom_id` 而非 MemoryLake ID。
</ParamField>

<RequestExample>
  ```bash By actor ID theme={null}
  curl -X GET 'https://app.memorylake.cn/openapi/memorylake/api/v3/actors/act-a1b2c3d4e5f6' \
    -H 'Authorization: Bearer sk_xxxxxx'
  ```

  ```bash By custom ID theme={null}
  curl -X GET 'https://app.memorylake.cn/openapi/memorylake/api/v3/actors/user-ext-001?by_custom_id=true' \
    -H 'Authorization: Bearer sk_xxxxxx'
  ```
</RequestExample>

### 响应

<ResponseField name="data" type="object">
  <Expandable title="Actor">
    <ResponseField name="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="description" type="string">Actor 描述</ResponseField>
    <ResponseField name="metadata" type="object">调用方定义的元数据</ResponseField>
    <ResponseField name="created_at" type="string">创建时间戳</ResponseField>
    <ResponseField name="updated_at" type="string">最后更新时间戳</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "id": "act-a1b2c3d4e5f6",
      "custom_id": "user-ext-001",
      "actor_type": "HUMAN",
      "display_name": "Alice Chen",
      "description": "Primary end user for the mobile app",
      "metadata": {
        "tier": "premium",
        "region": "us-west"
      },
      "created_at": "2025-03-10T08:00:00Z",
      "updated_at": "2025-03-10T08:00:00Z"
    }
  }
  ```
</ResponseExample>
