GET /api/v1/cloud/memory_stores
获取当前账户下的 Memory Store 列表。默认不返回已归档的 Store。
请求头
| 头部 | 必选 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <PAT> |
查询参数
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
limit | integer | 否 | 每页返回数量上限。默认 20,范围 1-100。超过 100 返回 400 invalid_request_error |
page | string | 否 | 上一页响应返回的不透明游标 next_page。与 after_id/before_id 互斥 |
after_id | string | 否 | 游标分页:返回此 ID 之后的记录。不能与 before_id 同时传入 |
before_id | string | 否 | 游标分页:返回此 ID 之前的记录。不能与 after_id 同时传入 |
include_archived | boolean | 否 | 设为 true 时包含已归档 Memory Store |
name | string | 否 | 按 Store 名称前缀搜索,不区分大小写 |
created_at[gte] | string | 否 | 仅返回创建时间大于等于此 RFC 3339 时间的记录 |
created_at[lte] | string | 否 | 仅返回创建时间小于等于此 RFC 3339 时间的记录 |
示例请求
示例响应
HTTP 200 OK响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
data | array | Memory Store 对象数组 |
has_more | boolean | 是否还有更多记录 |
first_id | string | null | 当前页第一条记录 ID;data 为空时为 null |
last_id | string | null | 当前页最后一条记录 ID;data 为空时为 null |
next_page | string | null | 下一页的不透明游标;没有更多记录时为 null |
分页说明
Memory Store 列表按资源 ID 倒序返回。遍历列表:- 首次请求设置
limit获取第一页 - 如果
has_more为true,将next_page作为page参数获取下一页 - 也可使用
after_id=<last_id>/before_id=<first_id>做基于 ID 的翻页
错误码
| HTTP | type | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | limit 非法、时间格式非法,或同时传入 before_id 与 after_id |
| 401 | authentication_error | 缺少或无效的认证令牌 |