---
title: "Updates or creates a cache time"
method: PUT
path: "/cache-times/{id}"
tags: ["cache times", "private"]
---

# Updates or creates a cache time

`PUT /cache-times/{id}`

## Request

- Base URL: `/v1` (relative, and the document’s source URL is not known)
- URL: `/v1/cache-times/{id}`
- Auth: API key in header `Authorization`

Updates a cache time if it exists or creates a new one for a given id

## Path parameters

- `id` string, required

## Request body

- CacheTimePutRequest
  - `path` string, required: Path for which caching is set
  - `collection_id` string: Collection ID - used for grouping and filtering of cache time objects
  - `collection_title` string: Collection title - used for describing the collection in a human-readable format
  - `release_time` string, date-time: Release time in ISO-8601 format

## Response `204`

Cache time successfully updated or created

## Other responses

- `400`: Invalid request, reasons can be one of the following: * cache time id was incorrect * missing required fields * empty request body * unknown extra fields * wrong type for field

---

[API](https://skmtc.dev/office-of-national-statistics/apis/legacy-cache-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/legacy-cache-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/legacy-cache-api/revisions/eea11da5c81c?raw)
