KV

KVNamespaces

List namespaces

GET/accounts/{account_id}/storage/kv/namespaces

Get a namespace

GET/accounts/{account_id}/storage/kv/namespaces/{namespace_id}

Create a namespace

POST/accounts/{account_id}/storage/kv/namespaces

Rename a namespace

PUT/accounts/{account_id}/storage/kv/namespaces/{namespace_id}

Delete a namespace

DELETE/accounts/{account_id}/storage/kv/namespaces/{namespace_id}

Write multiple key-value pairs

PUT/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk

Delete multiple key-value pairs

POST/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete

Get multiple key-value pairs

POST/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/get

ModelsExpand Collapse

<details>

<summary>

Namespace object {id, title, jurisdiction, 2 more }

</summary>

id: string

ID of the Workers KV namespace.

maxLength32

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

title: string

Human-readable string name for a Workers KV namespace.

maxLength512

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20title">Link to this property</a>

<details>

<summary>

jurisdiction: optional "eu"or "fedramp"or "us"

Specify the jurisdiction to restrict the KV namespace to durably store data within. Can only be set at namespace creation time.

</summary>

One of the following:

"eu"

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%200">Link to this property</a>

"fedramp"

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%201">Link to this property</a>

"us"

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20jurisdiction%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20jurisdiction">Link to this property</a>

mode: optional "instant"

The mode of the Workers KV namespace. Specify <code>instant</code> when creating a namespace to create a KV Instant namespace. Omit this field when creating a namespace to create a classic namespace. Currently, <code>instant</code> is the only supported explicit value.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

supports_url_encoding: optional boolean

True if keys written on the URL will be URL-decoded before storing. For example, if set to “true”, a key written on the URL as “%3F” will be stored as ”?”.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace%20%3E%20(schema)%20%3E%20(property)%20supports_url_encoding">Link to this property</a>

</details>

Link to this property

NamespaceDeleteResponse object {}

Link to this property

<details>

<summary>

NamespaceBulkUpdateResponse object {successful_key_count, unsuccessful_keys }

</summary>

successful_key_count: optional number

Number of keys successfully written or deleted by the bulk operation.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_update_response%20%3E%20(schema)%20%3E%20(property)%20successful_key_count">Link to this property</a>

unsuccessful_keys: optional array of string

Names of keys that failed to be written or deleted. Retry the operation for these keys.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_update_response%20%3E%20(schema)%20%3E%20(property)%20unsuccessful_keys">Link to this property</a>

</details>

Link to this property

<details>

<summary>

NamespaceBulkDeleteResponse object {successful_key_count, unsuccessful_keys }

</summary>

successful_key_count: optional number

Number of keys successfully written or deleted by the bulk operation.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_delete_response%20%3E%20(schema)%20%3E%20(property)%20successful_key_count">Link to this property</a>

unsuccessful_keys: optional array of string

Names of keys that failed to be written or deleted. Retry the operation for these keys.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_delete_response%20%3E%20(schema)%20%3E%20(property)%20unsuccessful_keys">Link to this property</a>

</details>

Link to this property

<details>

<summary>

NamespaceBulkGetResponse = object {values } or object {values }

</summary>

One of the following:

<details>

<summary>

WorkersKVBulkGetResult object {values }

</summary>

<details>

<summary>

values: optional map[stringor numberor booleanor map[unknown]]

Requested keys are paired with their values in an object.

</summary>

One of the following:

string

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%200">Link to this property</a>

number

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%201">Link to this property</a>

boolean

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%202">Link to this property</a>

map[unknown]

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%203">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

WorkersKVBulkGetResultWithMetadata object {values }

</summary>

<details>

<summary>

values: optional map[object {metadata, value, expiration } ]

Requested keys are paired with their values and metadata in an object.

</summary>

metadata: unknown

The metadata associated with the key.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(property)%20metadata">Link to this property</a>

value: unknown

The value associated with the key.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(property)%20value">Link to this property</a>

expiration: optional number

Expires the key at a certain time, measured in number of seconds since the UNIX epoch.

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(property)%20expiration">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces%20%3E%20(model)%20namespace_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201">Link to this property</a>

</details>

Link to this property

KVNamespacesKeys

List keys in a namespace

GET/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/keys

Write multiple key-value pairs

Deprecated

PUT/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk

Delete multiple key-value pairs

Deprecated

POST/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/delete

Get multiple key-value pairs

Deprecated

POST/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk/get

ModelsExpand Collapse

<details>

<summary>

Key object {name, expiration, metadata }

A name for a value. A value stored under a given key may be retrieved via the same key.

</summary>

name: string

A key’s name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.

maxLength512

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

expiration: optional number

The time, measured in number of seconds since the UNIX epoch, at which the key will expire. This property is omitted for keys that will not expire.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key%20%3E%20(schema)%20%3E%20(property)%20expiration">Link to this property</a>

metadata: optional unknown

Arbitrary JSON that is associated with a key.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key%20%3E%20(schema)%20%3E%20(property)%20metadata">Link to this property</a>

</details>

Link to this property

<details>

<summary>

KeyBulkUpdateResponse object {successful_key_count, unsuccessful_keys }

</summary>

successful_key_count: optional number

Number of keys successfully written or deleted by the bulk operation.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_update_response%20%3E%20(schema)%20%3E%20(property)%20successful_key_count">Link to this property</a>

unsuccessful_keys: optional array of string

Names of keys that failed to be written or deleted. Retry the operation for these keys.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_update_response%20%3E%20(schema)%20%3E%20(property)%20unsuccessful_keys">Link to this property</a>

</details>

Link to this property

<details>

<summary>

KeyBulkDeleteResponse object {successful_key_count, unsuccessful_keys }

</summary>

successful_key_count: optional number

Number of keys successfully written or deleted by the bulk operation.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_delete_response%20%3E%20(schema)%20%3E%20(property)%20successful_key_count">Link to this property</a>

unsuccessful_keys: optional array of string

Names of keys that failed to be written or deleted. Retry the operation for these keys.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_delete_response%20%3E%20(schema)%20%3E%20(property)%20unsuccessful_keys">Link to this property</a>

</details>

Link to this property

<details>

<summary>

KeyBulkGetResponse = object {values } or object {values }

</summary>

One of the following:

<details>

<summary>

WorkersKVBulkGetResult object {values }

</summary>

<details>

<summary>

values: optional map[stringor numberor booleanor map[unknown]]

Requested keys are paired with their values in an object.

</summary>

One of the following:

string

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%200">Link to this property</a>

number

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%201">Link to this property</a>

boolean

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%202">Link to this property</a>

map[unknown]

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(variant)%203">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20values">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

WorkersKVBulkGetResultWithMetadata object {values }

</summary>

<details>

<summary>

values: optional map[object {metadata, value, expiration } ]

Requested keys are paired with their values and metadata in an object.

</summary>

metadata: unknown

The metadata associated with the key.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(property)%20metadata">Link to this property</a>

value: unknown

The value associated with the key.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(property)%20value">Link to this property</a>

expiration: optional number

Expires the key at a certain time, measured in number of seconds since the UNIX epoch.

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values%20%3E%20(items)%20%3E%20(property)%20expiration">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20values">Link to this property</a>

</details>

<a href="#(resource)%20kv.namespaces.keys%20%3E%20(model)%20key_bulk_get_response%20%3E%20(schema)%20%3E%20(variant)%201">Link to this property</a>

</details>

Link to this property

KVNamespacesMetadata

Get a key's metadata

GET/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/metadata/{key_name}

ModelsExpand Collapse

MetadataGetResponse = unknown

Arbitrary JSON that is associated with a key.

Link to this property

KVNamespacesValues

Get a key's value

GET/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}

Write a key-value pair with optional metadata

PUT/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}

Delete a key-value pair

DELETE/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/values/{key_name}

ModelsExpand Collapse

ValueUpdateResponse object {}

Link to this property

ValueDeleteResponse object {}


description: Deliver low-latency live media content using the MoQ protocol over QUIC transport on Cloudflare's network. title: Media over QUIC at Cloudflare image: https://developers.cloudflare.com/moq/og.png?v=a38785c613daaafb


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/moq/llms.txt
Use this file to discover all available pages before exploring further.