跳转到内容
搜索文档

更新日志

Cloudflare 的最新更新与改进。

Back to all posts

已弃用旧版 Workers KV 命名空间 API 路由

截至 2026 年 7 月 15 日,/accounts/{account_id}/workers/namespaces/* 下的旧版 Workers KV API 路由已弃用,并将于 2026 年 10 月 15 日停止工作。请在此日期之前迁移到文档化的 Workers KV API 路由 /accounts/{account_id}/storage/kv/namespaces/*

旧版路由和替换后的路由是可互换的。它们接受相同的请求参数并返回相同的响应负载。要进行迁移,请将 URL 路径从 /workers/namespaces/ 更新为 /storage/kv/namespaces/

您需要做什么

更新任何调用 /accounts/{account_id}/workers/namespaces/ 下路由的集成,以使用 /accounts/{account_id}/storage/kv/namespaces/ 下的等效路由。此迁移是直接的 URL 路径替换 —— 请求参数和响应负载完全相同:

  • GETPOST /accounts/{account_id}/workers/namespacesGETPOST /accounts/{account_id}/storage/kv/namespaces
  • GETPUTDELETE /accounts/{account_id}/workers/namespaces/{namespace_id}GETPUTDELETE /accounts/{account_id}/storage/kv/namespaces/{namespace_id}
  • GET /accounts/{account_id}/workers/namespaces/{namespace_id}/keysGET /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys
  • GET /accounts/{account_id}/workers/namespaces/{namespace_id}/metadata/{key_name}GET /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/metadata/{key_name}
  • GETPUTDELETE /accounts/{account_id}/workers/namespaces/{namespace_id}/values/{key_name}GETPUTDELETE /accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}

有关弃用时间线的更多信息,请参阅 API 弃用