key_metadata
Creates, updates, deletes, gets or lists a key_metadata resource.
Overview
| Name | key_metadata |
| Type | Resource |
| Id | cloudflare.kv.key_metadata |
Fields
The following fields are returned by SELECT queries:
- get
Read the metadata for a key response.
| Name | Datatype | Description |
|---|---|---|
errors | array | |
messages | array | |
result | | Arbitrary JSON that is associated with a key. |
success | boolean | Whether the API call was successful. (true) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | key_name, namespace_id, account_id | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
key_name | string | |
namespace_id | string | The Workers KV namespace ID. |
SELECT examples
- get
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
;