Write multiple key-value pairs
PUT
/accounts/{account_id}/storage/kv/namespaces/{namespace_id}/bulk https://api.cloudflare.com/client/v4
Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither expiration nor expiration_ttl is specified, the key-value pair will never expire. If both are set, expiration_ttl is used and expiration is ignored. The entire request size must be 100 megabytes or less.
Parameters
path Path Parameters
| Name | Type |
|---|---|
namespace_id
required
| type WorkersKvNamespaceIdentifier = string |
account_id
required
| type WorkersKvIdentifier = string |
Request Body
application/json
required
type WorkersKvBulkWrite = {
base64?: boolean;
expiration?:WorkersKvExpiration ;
expiration_ttl?:WorkersKvExpirationTtl ;
key:WorkersKvKeyNameBulk ;
metadata?:WorkersKvListMetadata ;
value: string;
}[]
base64?: boolean;
expiration?:
expiration_ttl?:
key:
metadata?:
value: string;
}[]
Responses
200 application/json
Write multiple key-value pairs response.
type WorkersKvApiResponseCommonNoResult = interface WorkersKvApiResponseCommon {
errors:WorkersKvMessages ;
messages:WorkersKvMessages ;
success: true;
} & { result?: {} | null; } & { result?:WorkersKvBulkResult ; }
errors:
messages:
success: true;
} & { result?: {} | null; } & { result?:
Client Errors
4XX application/json
Write multiple key-value pairs response failure.
type WorkersKvApiResponseCommonNoResult = interface WorkersKvApiResponseCommon {
errors:WorkersKvMessages ;
messages:WorkersKvMessages ;
success: true;
} & { result?: {} | null; } & { result?:WorkersKvBulkResult ; }
errors:
messages:
success: true;
} & { result?: {} | null; } & { result?: