---
title: "Api Cache Partial Update"
method: PATCH
path: "/api/cache/{id}/"
tags: ["logs"]
---

# Api Cache Partial Update

`PATCH /api/cache/{id}/`

PATCH handler with superadmin lock and field protection.

Checks:
1. Object lock (is_managed=True -> non-superadmins can't modify)
2. Field protection (non-superadmins can't modify specific fields)

## Path parameters

- `id` integer, required

## Headers

- `Authorization` string, required

## Request body

- PatchedPublicCachedResponseDetailRequest — Strip org-internal fields and present a single cache_key for the public API. The PG ORM has two fields: - cache_key: internal key with integer org ID (legacy, used by CH enrichment) - cache_key_by_org_uuid: UUID-based key (safe to expose) The public API exposes ONE "cache_key" field whose value comes from cache_key_by_org_uuid. The internal cache_key and the raw cache_key_by_org_uuid field are both removed from the response.
  - `cache_key` string, nullable
  - `cache_key_by_org_uuid` string, nullable
  - `prompt_messages` union
    - unknown
    - unknown
  - `full_response` unknown
  - `hit_count` integer
  - `response_time` number, double
  - `timestamp` string, date-time
  - `updated_at` string, date-time
  - `expiry_date` string, date-time, nullable

## Response `200`

- PublicCachedResponseDetail — Strip org-internal fields and present a single cache_key for the public API. The PG ORM has two fields: - cache_key: internal key with integer org ID (legacy, used by CH enrichment) - cache_key_by_org_uuid: UUID-based key (safe to expose) The public API exposes ONE "cache_key" field whose value comes from cache_key_by_org_uuid. The internal cache_key and the raw cache_key_by_org_uuid field are both removed from the response.
  - `cache_key` string, nullable
  - `cache_key_by_org_uuid` string, nullable
  - `request_content` string, required
  - `prompt_content` string, required
  - `response_content` string, required
  - `prompt_messages` union
    - unknown
    - unknown
  - `full_response` unknown
  - `hit_count` integer
  - `response_time` number, double
  - `timestamp` string, date-time
  - `updated_at` string, date-time
  - `expiry_date` string, date-time, nullable

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/versions/c26d550029f8/schema)
