api.md

Created about 12 hours ago

attributes
source_pathreferences/kv/api.md
source_sha256cf0443db52986571d27cb4de78fa2455d85736b953f472cde22b447741000b12
source_urlhttps://github.com/cloudflare/skills/blob/47dfc2ce969bf62acf8bc231198ade4bb02712e0/skills/cloudflare/references/kv/api.md
supporting_skill_id40184
upstream_revision47dfc2ce969bf62acf8bc231198ade4bb02712e0

KV API Reference

Read the relevant API page before implementing; it defines current options, result shapes, supported bulk operations, and constraints.

Task Documentation
Read one or several keys; choose text, JSON, binary, or stream results Read key-value pairs
Read metadata with values; tune read caching or coalesce related keys Read guidance
Write values and metadata; set absolute expiration or a relative lifetime Write key-value pairs
Delete a key Delete key-value pairs
Enumerate keys, filter by prefix, and paginate List keys
Access namespaces or perform bulk operations outside a Worker KV REST API and Wrangler KV commands

Handle missing values explicitly: JavaScript reads return null for absent keys; valid stored values can be falsy. Choose defaults separately from how you handle request failures.

For pagination, follow the returned cursor until list_complete is true, even if a page has no keys. Preserve the original prefix on subsequent calls. Listing returns key information, not stored values; use the listing guide to decide whether metadata avoids additional reads.

Use gotchas.md for consistency and contention decisions before adding retries or read-after-write verification.

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.