---
title: "Cache Set"
method: POST
path: "/api/v1.cache.set"
tags: ["Cache"]
---

# Cache Set

`POST /api/v1.cache.set`

Cache Set

## Request body

- CacheSetIn
  - `namespace` string, nullable
  - `key` string, required
  - `value` integer[], required
  - `ttl_ms` integer, required — Time to live in milliseconds

## Response `200`

- CacheSetOut

## Other responses

- `400`
- `401`
- `403`
- `422`

## Changes

- **2026-04-14** `7f5edfb12f87` — 2 breaking
  - the `key` request property's minLength was increased from `0` to `1`
  - the `namespace` request property's minLength was increased from `0` to `1`
- **2026-04-14** `14bcce06404b` — 1 breaking, 1 warning
  - added the pattern `^[a-zA-Z0-9\-/_.=+]+$` to the request property `namespace`
  - the `namespace` request property's maxLength was set to `256`
- **2026-03-31** `cb1523fc3cdd` — 1 warning
  - the `ttl_ms` request property's min was set to `0.00`
- **2026-03-31** `f62be26d2a53` — 6 breaking, 4 warning, 3 info
  - the `detail` response's property type/format changed from `string`/`` to `array`/`` for status `422`
  - removed the required property `code` from the response with the `422` status
  - removed the required property `type` from the response with the `400` status
  - removed the required property `type` from the response with the `401` status
  - …9 more

[Change history](https://skmtc.dev/svix/apis/diom-api/changes/api/v1.cache.set/post.md)

---

[API](https://skmtc.dev/svix/apis/diom-api.md) · [All operations](https://skmtc.dev/svix/apis/diom-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/svix/diom-api/revisions/2027bc3fbcfb/schema)
