获取 /api/v1/用户/我

从数据库中返回当前用户的资料信息。需要有效的 Bearer token。

响应

  • 不支持或格式错误的 API 版本、所选已发布合同中不可用的操作,或不可接受的表示形式(包括不支持的媒体类型参数或排除的 SSE)。现有的身份验证、授权和速率限制失败具有优先权。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      由标准错误模式定义的可选验证详细信息;API 协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        字段验证失败。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      可读的错误详情。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误码。

    • 参数 array[string]

      与错误相关的请求参数名称;当无相关参数时省略。

    • 原因 字符串 必需

      HTTP 状态原因语句。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      由标准错误模式定义的可选验证详细信息;API 协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        字段验证失败。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      可读的错误详情。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误码。

    • 参数 array[string]

      与错误相关的请求参数名称;当无相关参数时省略。

    • 原因 字符串 必需

      HTTP 状态原因语句。

  • 200

    正常

    隐藏响应属性 显示响应属性 对象
    • atlas_connection_required 布尔

      当 Atlas IAM 委托开启且没有可用的 Atlas OAuth 授权可用时,AtlasConnectionRequired 为 true — 包括记录的认证失败或电路开启令牌。联合登录可以实现嵌套的 Atlas 授权;密码登录仍可自动启动 GET /api/v1/oauth/atlas/initiate。

    • atlas_iam_enabled 布尔

      AtlasIAMEnabled 为 true,同时 Atlas IAM 授权对用户处于活动状态,与 Atlas 连接状态无关(一旦授权存在,AtlasConnectionRequired 就会变为 false)。用户界面使用它来隐藏 Gateway 在委托下拒绝的创建操作,例如创建代理引擎组织。

    • 电子邮件 字符串
    • last_selected_org_id 字符串

      LastSelectedOrgID 是用户在用户界面中最近选择的组织ID。仅供参考;调用方根据当前成员资格重新验证。未设置时省略。

    • last_selected_project_id 字符串

      LastSelectedProjectID 是用户在用户界面中最近选择的项目ID。仅供参考;调用方根据当前成员资格重新验证。未设置时省略。

    • 名称 字符串
    • org_ids array[string]
    • role_assignments 大量[对象]
      隐藏 role_assignments 属性 显示 role_assignments 属性 对象
      • org_id 字符串
      • PROJECT_ID 字符串
      • 角色 字符串
    • user_id 字符串
    隐藏响应属性 显示响应属性 对象
    • atlas_connection_required 布尔

      当 Atlas IAM 委托开启且没有可用的 Atlas OAuth 授权可用时,AtlasConnectionRequired 为 true — 包括记录的认证失败或电路开启令牌。联合登录可以实现嵌套的 Atlas 授权;密码登录仍可自动启动 GET /api/v1/oauth/atlas/initiate。

    • atlas_iam_enabled 布尔

      AtlasIAMEnabled 为 true,同时 Atlas IAM 授权对用户处于活动状态,与 Atlas 连接状态无关(一旦授权存在,AtlasConnectionRequired 就会变为 false)。用户界面使用它来隐藏 Gateway 在委托下拒绝的创建操作,例如创建代理引擎组织。

    • 电子邮件 字符串
    • last_selected_org_id 字符串

      LastSelectedOrgID 是用户在用户界面中最近选择的组织ID。仅供参考;调用方根据当前成员资格重新验证。未设置时省略。

    • last_selected_project_id 字符串

      LastSelectedProjectID 是用户在用户界面中最近选择的项目ID。仅供参考;调用方根据当前成员资格重新验证。未设置时省略。

    • 名称 字符串
    • org_ids array[string]
    • role_assignments 大量[对象]
      隐藏 role_assignments 属性 显示 role_assignments 属性 对象
      • org_id 字符串
      • PROJECT_ID 字符串
      • 角色 字符串
    • user_id 字符串
  • Unauthorized

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 内部服务器错误

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
GET /api/v1/users/me
curl \
 --request GET 'https://agentengine.mongodb.com/api/v1/users/me' \
 --header "Authorization: $API_KEY"
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (200)
{
  "atlas_connection_required": true,
  "atlas_iam_enabled": true,
  "email": "string",
  "last_selected_org_id": "string",
  "last_selected_project_id": "string",
  "name": "string",
  "org_ids": [
    "string"
  ],
  "role_assignments": [
    {
      "org_id": "string",
      "project_id": "string",
      "role": "string"
    }
  ],
  "user_id": "string"
}
响应示例 (200)
{
  "atlas_connection_required": true,
  "atlas_iam_enabled": true,
  "email": "string",
  "last_selected_org_id": "string",
  "last_selected_project_id": "string",
  "name": "string",
  "org_ids": [
    "string"
  ],
  "role_assignments": [
    {
      "org_id": "string",
      "project_id": "string",
      "role": "string"
    }
  ],
  "user_id": "string"
}
响应示例 (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (401)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}