Workers KV Namespace

List a Namespace's Keys

Changed on

Lists a namespace's keys.

get/storage/kv/namespaces/{namespace_id}/keys

Request

  • Base URL: /cdn-cgi/local/explorer/api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /cdn-cgi/local/explorer/api/storage/kv/namespaces/{namespace_id}/keys
  • Auth: none declared

Path parameters

namespace_idstring required

Namespace identifier tag.

Example:0f2ac74b498b48028cb68387c421e279

Query parameters

limitnumber

Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit.

prefixstring

Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned.

Example:My-Prefix
cursorstring

Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the cursors object in the result_info structure.

Example:6Ck1la0VxJ0djhidm1MdX2FyDGxLKVeeHZZmORS_8XeSuhz9SjIJRaSa2lnsF01tQOHrfTGAP3R5X1Kv5iVUuMbNKhWNAXHOl6ePB0TUL8nw

Response

List a Namespace's Keys response.

successtrue required

Whether the API call was successful.

Example response

{
  "errors": [],
  "messages": [],
  "success": true,
  "result": [
    {
      "expiration": 1577836800,
      "metadata": {
        "someMetadataKey": "someMetadataValue"
      },
      "name": "My-Key"
    }
  ],
  "result_info": {
    "count": 1,
    "cursor": "6Ck1la0VxJ0djhidm1MdX2FyDGxLKVeeHZZmORS_8XeSuhz9SjIJRaSa2lnsF01tQOHrfTGAP3R5X1Kv5iVUuMbNKhWNAXHOl6ePB0TUL8nw"
  }
}

Changes