更新时间:2026-06-10 GMT+08:00
分享

重置 API Key - ResetCoreSpaceApiKey

功能介绍

异步重置指定 Space 的 API Key,旧 Key 立即失效。

调用方法

请参见如何调用API

URI

POST /v1/core/spaces/{space_id}/reset-key

表1 路径参数

参数

是否必选

参数类型

描述

space_id

String

参数解释:

记忆空间 ID,唯一标识一个记忆空间,可通过"创建Space"接口获取。

约束限制:

仅支持字母、数字和中划线。

取值范围:

长度1-48字符。

默认取值:

不涉及。

请求参数

响应参数

状态码:202

表2 响应Body参数

参数

参数类型

描述

id

String

参数解释:

异步任务 ID,唯一标识一个异步任务,可通过创建异步任务的接口返回获取。

取值范围:

不涉及。

job_name

String

参数解释:

异步任务名称,标识任务的类型。

取值范围:

  • create_space: 创建记忆空间

  • update_network: 更新网络配置

status

String

参数解释:

异步任务的当前执行状态。

取值范围:

  • running: 执行中

  • success: 成功

  • failed: 失败

key_id

String

参数解释:

API Key ID(与任务 ID 区分),可通过"创建 API Key"接口获取。

取值范围:

不涉及。

api_key

String

参数解释:

API Key 明文(仅创建时返回一次,请妥善保存)。

取值范围:

不涉及。

状态码:400

表3 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:401

表4 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:403

表5 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

encoded_authorization_message

String

参数解释:

编码后的授权失败信息。

取值范围:

不涉及。

details

Array of CoreSpaceCommonError objects

参数解释:

依赖的下游服务错误信息列表,包含导致当前请求失败的下游服务错误详情。

取值范围:

不涉及。

表6 CoreSpaceCommonError

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:404

表7 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:429

表8 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

状态码:500

表9 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码,标识错误类型,格式为 AgentArts.XXXXXXXX。

取值范围:

不涉及。

error_msg

String

参数解释:

错误信息,描述错误详情,供问题排查使用。

取值范围:

不涉及。

请求示例

/v1/core/spaces/123e4567-e89b-12d3-a456-426614174000/reset-key

响应示例

状态码:400

请求参数错误

{
  "error_code" : "AgentArts.01010001",
  "error_msg" : "Invalid request parameter format"
}

状态码:401

认证失败

{
  "error_code" : "AgentArts.01020002",
  "error_msg" : "Authentication failed"
}

状态码:403

权限不足

{
  "error_code" : "AgentArts.01010002",
  "error_msg" : "Insufficient permissions"
}

状态码:404

Space不存在

{
  "error_code" : "AgentArts.01010005",
  "error_msg" : "Specified space does not exist"
}

状态码:429

请求过于频繁

{
  "error_code" : "AgentArts.01020008",
  "error_msg" : "Too many requests"
}

状态码:500

内部服务错误

{
  "error_code" : "AgentArts.01010008",
  "error_msg" : "Internal service error"
}

状态码

状态码

描述

202

API Key 重置请求已接受

400

请求参数错误

401

认证失败

403

权限不足

404

Space不存在

429

请求过于频繁

500

内部服务错误

错误码

请参见错误码

相关文档