Insert an item into an kv store
PUT {{fastly_url}}/resources/stores/kv/{{store_id}}/keys/{{key_name}}?add&append&background_fetch&prepend
Set a new value for a new or existing key in an kv store.
Authorization: API token with at least Engineer permissions.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
add | null | Ensures the request will only succeed if the key doesn't already exist (shortcut equivalent for using the if-generation-match header with a value of 0). | |
append | null | Updates the contents of a key by appending the body of the request to the existing key's contents. If the specified key does not exist, a new key is created. | |
background_fetch | null | If set to true, allows fetching from the origin to occur in the background, enabling a faster response with stale content. The cache will be updated with fresh content after the request is completed. | |
prepend | null | Updates the contents of a key by prepending the body of the request onto the existing key's contents. If the specified key does not exist, a new key is created. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
if-generation-match | null | Requests for keys will return a 'generation' header specific to the version of a key. The generation header is a unique, non-serial 32-bit integer that can be used for testing against a specific KV store value. | |
metadata | null | An arbitrary data field which can contain up to 2000B of data. | |
time_to_live_sec | null | Sets a time for the key to expire. Deletion will take place up to 24 hours after the ttl reaches 0. |