Skip to main content

key_metadata

Creates, updates, deletes, gets or lists a key_metadata resource.

Overview

Namekey_metadata
TypeResource
Idcloudflare.kv.key_metadata

Fields

The following fields are returned by SELECT queries:

Read the metadata for a key response.

NameDatatypeDescription
errorsarray
messagesarray
resultArbitrary JSON that is associated with a key.
successbooleanWhether the API call was successful. (true)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectkey_name, namespace_id, account_idReturns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, :, !, %) in the key name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
key_namestring
namespace_idstringThe Workers KV namespace ID.

SELECT examples

Returns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, :, !, %) in the key name.

SELECT
errors,
messages,
result,
success
FROM cloudflare.kv.key_metadata
WHERE key_name = '{{ key_name }}' -- required
AND namespace_id = '{{ namespace_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;