kv keys

Set a key's value

Creates or replaces the value for a key. The request body is stored verbatim as the value — no base64, no JSON envelope — up to 1 MiB. The request's Content-Type header is stored with the value and echoed back on retrieval. Returns 201 when the key is created and 200 when an existing key is updated.

put/storage/kvs/{id}/keys/{key}

Path parameters

idstring uuid required

KV namespace ID

keystring required

Key name. Allowed characters: a-z A-Z 0-9 - _ / = .; maximum 256 characters; names starting with _ are reserved for system use. May contain /. When calling the HTTP API directly, URL-encode the key so the whole string is treated as one key (for example user/1 -> user%2F1). SDK users should pass the key raw - SDKs URL-encode path parameters automatically.

Query parameters

ttl_secsinteger

Time-to-live in seconds. When set, the key expires and is deleted after this duration. Requires a namespace provisioned with TTL support; namespaces without it return a 409.

Response

Key updated

Changes

Changed in 5 of the 61 revisions of this API.26621

  • 1571b0380bd7186See the full diff
    • the response property errors/items/code became optional for the status 400

      response-property-became-optional

    • the response property errors/items/code became optional for the status 401

      response-property-became-optional

    • the response property errors/items/code became optional for the status 404

      response-property-became-optional

    • the response property errors/items/code became optional for the status 409

      response-property-became-optional

    • the response property errors/items/code became optional for the status 413

      response-property-became-optional

    • the response property errors/items/code became optional for the status 422

      response-property-became-optional

    • the response property errors/items/title became optional for the status 400

      response-property-became-optional

    • the response property errors/items/title became optional for the status 401

      response-property-became-optional

    • the response property errors/items/title became optional for the status 404

      response-property-became-optional

    • the response property errors/items/title became optional for the status 409

      response-property-became-optional

    • the response property errors/items/title became optional for the status 413

      response-property-became-optional

    • the response property errors/items/title became optional for the status 422

      response-property-became-optional

    • the errors/items/code response's property type/format changed from integer/int32 to string/ for status 400

      response-property-type-changed

    • the errors/items/code response's property type/format changed from integer/int32 to string/ for status 401

      response-property-type-changed

    • the errors/items/code response's property type/format changed from integer/int32 to string/ for status 404

      response-property-type-changed

    • the errors/items/code response's property type/format changed from integer/int32 to string/ for status 409

      response-property-type-changed

    • the errors/items/code response's property type/format changed from integer/int32 to string/ for status 413

      response-property-type-changed

    • the errors/items/code response's property type/format changed from integer/int32 to string/ for status 422

      response-property-type-changed

    • added the optional property errors/items/meta/url to the response with the 400 status

      response-optional-property-added

    • added the optional property errors/items/meta/url to the response with the 401 status

      response-optional-property-added

    • added the optional property errors/items/meta/url to the response with the 404 status

      response-optional-property-added

    • added the optional property errors/items/meta/url to the response with the 409 status

      response-optional-property-added

    • added the optional property errors/items/meta/url to the response with the 413 status

      response-optional-property-added

    • added the optional property errors/items/meta/url to the response with the 422 status

      response-optional-property-added

    This revision also has 64 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 8f5f4e5379946612See the full diff
    • the errors/items/code response's property type/format changed from string/ to integer/int32 for status 400

      response-property-type-changed

    • the errors/items/code response's property type/format changed from string/ to integer/int32 for status 401

      response-property-type-changed

    • the errors/items/code response's property type/format changed from string/ to integer/int32 for status 404

      response-property-type-changed

    • the errors/items/code response's property type/format changed from string/ to integer/int32 for status 409

      response-property-type-changed

    • the errors/items/code response's property type/format changed from string/ to integer/int32 for status 413

      response-property-type-changed

    • the errors/items/code response's property type/format changed from string/ to integer/int32 for status 422

      response-property-type-changed

    • removed the optional property errors/items/meta/url from the response with the 400 status

      response-optional-property-removed

    • removed the optional property errors/items/meta/url from the response with the 401 status

      response-optional-property-removed

    • removed the optional property errors/items/meta/url from the response with the 404 status

      response-optional-property-removed

    • removed the optional property errors/items/meta/url from the response with the 409 status

      response-optional-property-removed

    • removed the optional property errors/items/meta/url from the response with the 413 status

      response-optional-property-removed

    • removed the optional property errors/items/meta/url from the response with the 422 status

      response-optional-property-removed

    • the response property errors/items/code became required for the status 400

      response-property-became-required

    • the response property errors/items/code became required for the status 401

      response-property-became-required

    • the response property errors/items/code became required for the status 404

      response-property-became-required

    • the response property errors/items/code became required for the status 409

      response-property-became-required

    • the response property errors/items/code became required for the status 413

      response-property-became-required

    • the response property errors/items/code became required for the status 422

      response-property-became-required

    • the response property errors/items/title became required for the status 400

      response-property-became-required

    • the response property errors/items/title became required for the status 401

      response-property-became-required

    • the response property errors/items/title became required for the status 404

      response-property-became-required

    • the response property errors/items/title became required for the status 409

      response-property-became-required

    • the response property errors/items/title became required for the status 413

      response-property-became-required

    • the response property errors/items/title became required for the status 422

      response-property-became-required

    This revision also has 41 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the endpoint scheme security bearerAuth was removed from the API

      api-security-removed

    • removed the media type */* from the request body

      request-body-media-type-removed

    • added the media type application/octet-stream to the request body

      request-body-media-type-added

    • removed the media type application/octet-stream from the request body

      request-body-media-type-removed

    • added the media type */* to the request body

      request-body-media-type-added

    This revision also has 111 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog