List and Delete API Methods, Bindings, and REST Verbs
When to use list versus get and delete in REST and worker bindings, what delete returns, and how provider docs name these operations.
Most of this page follows Cloudflare’s API and Workers documentation, which repeats the same list and delete patterns across KV, Images, AI Search bindings, DNS views, and platform changelogs. A smaller set of examples comes from Chrome platform and extension APIs, where list can mean “enumerate resources” or a constraint field, and delete sometimes removes metadata only—not the underlying bytes.
REST verbs: list and delete in HTTP APIs
Section titled “REST verbs: list and delete in HTTP APIs”HTTP APIs usually expose list as a GET that returns a collection, and delete as a DELETE that removes one resource. Cloudflare’s editorial guide maps method types to everyday verbs so titles and descriptions stay consistent across products.
The verb examples are a small handful of commonly used verbs associated with a method, but you should not feel limited and only use the verbs in the examples.
— Cloudflare, Method types & common verbs
| Method | Purpose | Verb examples (including list/delete) |
|---|---|---|
GET |
Retrieves a resource | Gets, Lists, Returns, Downloads |
DELETE |
Removes the resource | Deletes, Removes, Cancels |
For endpoint titles, Cloudflare uses the root form of the verb (“Create a namespace.”). For descriptions, it uses present tense (“Creates a namespace under the given title.”). Using the method name in prose is acceptable—for example, describing a GET as “Gets embed code.”
Concrete list/delete pairs appear on resource-oriented pages. Manage DNS views lists List DNS views (GET) beside get and patch actions. Create scheduled events documents List scheduled events (GET) and Delete event (DELETE) in the same “Other API commands” table. Manage hosted images groups Delete images with edit and export operations.
A successful create often precedes later list/delete work: 2xx Success notes that 2xx commonly means a new resource was created in response to POST (for example a user or record)—after which clients list collections or delete individual ids.
list (GET) versus get (GET): naming in docs
Section titled “list (GET) versus get (GET): naming in docs”People often conflate “list everything” with “get one.” In Cloudflare’s verb table, Lists sits under GET alongside Gets—both are retrieval, but list implies a collection endpoint or a binding method that returns many items, while get targets a single resource (or key). DNS List DNS views and Waiting Room List scheduled events are explicit GET list operations; binding APIs spell the operation list() even when the HTTP equivalent would be GET.
Workers bindings: list() and delete() on the edge
Section titled “Workers bindings: list() and delete() on the edge”Inside Workers, many products expose JavaScript methods rather than raw HTTP. The Workers Binding API overview for KV names four core capabilities: read, write, delete key-value pairs, and list keys.
KV: delete() and listing keys
Section titled “KV: delete() and listing keys”Delete key-value pairs states plainly:
The following method is provided to delete from KV:
delete()— Cloudflare, Delete key-value pairs
So for KV namespaces bound to a Worker, removal is the delete() binding method; listing keys is a separate binding concern documented alongside read/write on the same Workers Binding API page.
AI Search: Instances bindings with full lifecycle
Section titled “AI Search: Instances bindings with full lifecycle”AI Search agent SDK docs treat Instances as a Workers binding with a full reference for create, update, list, and delete—see AI SDK — Instances Workers binding and Agents SDK — Instances Workers binding. Platform changelogs (for example Cloudflare Typescript SDK v6.0.0-beta.1) expand client.aisearch with Instances: create, update, list, delete, read, stats; plus Items list, get; Jobs and Tokens with their own list operations. That split mirrors REST design: list enumerates; get/read fetch one entity.
Images, Durable Objects, Agents, Realtime
Section titled “Images, Durable Objects, Agents, Realtime”Several bindings document delete with a boolean return—whether something existed—not merely “request accepted”:
| API | Delete behavior (from docs) |
|---|---|
| Hosted Images binding | .image(imageId).delete() — “Returns true if the image was deleted or false if no image with the given ID existed.” |
| Durable Object SQLite KV | ctx.storage.kv.delete(key) — “Returns true if the key existed or false if it did not.” |
| Agents workflows | deleteWorkflow(instanceId) — “Returns true if deleted, false if not found.” |
RealtimeKit RTKStore |
store.delete(key, [sync], [emit]) — removes a key-value pair; returns Promise.<void> (existence not described as a boolean). |
When migrating from HTTP to bindings, check whether delete is idempotent (delete missing key → false) or void-returning, so your Worker logic does not assume exceptions on “not found.”
Chrome platform: list constraints and delete semantics
Section titled “Chrome platform: list constraints and delete semantics”Chrome documentation uses list and delete in different layers—extension API schemas, Origin Private File System-style storage, and offline PWA indexing.
list as a property (not always “list resources”)
Section titled “list as a property (not always “list resources”)”documentScan defines a optional list property (string[] | number[]) alongside max, min, quant, and type (ConstraintType)—here list is a constraint value, not an RPC named list(). The MV2 documentScan reference repeats the same property shape. Do not assume every list in Chrome docs means enumeration; read the surrounding API (properties table vs methods).
Storage Foundation: getAll() then delete()
Section titled “Storage Foundation: getAll() then delete()”Storage Foundation API shows listing via getAll() and removing one entry with delete(name):
await storageFoundation.getAll();await storageFoundation.delete('noon');That pattern matches Cloudflare’s mental model—enumerate, then delete by id—though the method names differ from list().
Content Indexing API: delete() only drops the index entry
Section titled “Content Indexing API: delete() only drops the index entry”For offline-capable pages, Indexing your offline-capable pages with the Content Indexing API warns that index removal is not cache removal:
To remove an item from the index, call delete() with the id of the item to remove:
await registration.index.delete('article-123');Calling delete() only affects the index. It does not delete anything from the cache.
— Chrome, Content Indexing API
The same page notes that indexed entries do not auto-expire; apps must expose UI or periodically delete stale ids. That is a common cross-platform mistake: treating “delete from catalog/index” as “purge stored content.”
Platform SDK changelogs: what list() and delete() refer to
Section titled “Platform SDK changelogs: what list() and delete() refer to”Cloudflare’s SDK changelogs (product SDK, changelog 35, Python SDK v5.0.0-beta.1, and related product-group pages) repeatedly announce list() on subclients such as queues.consumers, intel.indicatorfeeds, cloudforceone.threatevents, and delete() on resources such as workers.subdomains. Those entries are not a tutorial; they signal that the generated SDK now mirrors REST collections (list) and destructive operations (delete). If your code calls an older SDK without list(), the HTTP GET collection route may still exist—compare the changelog entry with the REST doc’s “Other API commands” table.
edit() vs update() also appear (for example acm.totaltls, zerotrust.networks), aligning with Cloudflare’s PATCH-style partial updates versus PUT-style full updates described in Method types & common verbs.
Documentation lists versus API list()
Section titled “Documentation lists versus API list()”Cloudflare’s Lists style page describes bulleted, numbered, and embedded lists in prose—not HTTP listing. Prerequisites points authors to that guide for formatting. When you see “list” in style docs, it is editorial structure; when you see list() in a binding or SDK changelog, it is an operation. Keeping that distinction clear prevents mixing “how to write a bulleted list” with “how to call List DNS views.”
Common mistakes
Section titled “Common mistakes”- Assuming
delete()wipes all storage layers — Chrome’s Content Indexingdelete()only updates the index; KV/Images/Durable Object deletes target their own store only. - Ignoring boolean delete results — Images and Durable Object KV deletes return
falsewhen the id/key was already absent; code that only checks for thrown errors will miss that contract. - Using
getwhen the docs saylist— Collection endpoints andclient.*.list()methods are for pagination and enumeration; single-resource reads useget,read, or keyed lookups. - Treating extension
listproperties as APIs — In documentScan,listis part of scan constraints, not a directory listing call. - Skipping periodic cleanup after list — Content Indexing docs require explicit removal of stale index ids; listing offline content without a delete policy leaves orphan index entries.
How to check this on your site
Section titled “How to check this on your site”-
Open the product’s REST reference (for example Manage DNS views or Create scheduled events) and confirm whether collection reads are documented as List (
GET) and removals as Delete (DELETE). -
For Workers, cross-check the binding overview (KV Workers Binding API) and the specific delete page (Delete key-value pairs) so your script calls
delete()and, if needed, the documented list-keys API—not raw cache APIs by guesswork. -
After a delete in the browser, verify side effects separately: for PWAs using the Content Indexing API, confirm both the index (
registration.index) and the offline cache still hold (or lack) the assets you expect. -
If you use the Cloudflare SDK, scan the relevant changelog section for
list()/delete()on your subclient and match method names to your installed package version. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact sentence you are asking about, and we will correct or clarify it.