> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaka.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Cache Settings

> Updates the sync schedules of an existing cache. Use this to change how frequently the cache is refreshed.

Only schedule fields are updated; the target table, catalog, and schema cannot be changed after creation. When a schedule is changed, any previously running scheduled workflow for that mode is replaced with the new schedule. Set a schedule's `type` to `NONE` to disable that particular sync mode.

The schedule `expression` uses ISO-8601 duration format (e.g. `PT6H` = every 6 hours, `PT15M` = every 15 minutes, `P1D` = every day).

<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />

  <img src="https://cdn.peaka.com/badges/project-api-key-badge.png" />
</span>


## OpenAPI

````yaml put /data/projects/{projectId}/cache/{cacheId}
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /data/projects/{projectId}/cache/{cacheId}:
    put:
      tags:
        - Data -- Cache
      summary: Update Cache Settings
      description: >-
        Updates the sync schedules of an existing cache. Use this to change how
        frequently the cache is refreshed.


        Only schedule fields are updated; the target table, catalog, and schema
        cannot be changed after creation. When a schedule is changed, any
        previously running scheduled workflow for that mode is replaced with the
        new schedule. Set a schedule's `type` to `NONE` to disable that
        particular sync mode.


        The schedule `expression` uses ISO-8601 duration format (e.g. `PT6H` =
        every 6 hours, `PT15M` = every 15 minutes, `P1D` = every day).
      operationId: updateCacheSettings
      parameters:
        - name: projectId
          in: path
          description: The unique identifier of the project that owns the cache
          required: true
          schema:
            type: string
          example: mtKDhe1U
        - name: cacheId
          in: path
          description: The unique identifier of the cache to update (UUID format)
          required: true
          schema:
            type: string
          example: 960bd651-7b3c-4511-9a88-18e14ac7742a
      requestBody:
        description: >-
          Updated schedule configuration. Only the provided schedule fields are
          updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CacheSettingsUpdateRequest'
            examples:
              Update Both Schedules:
                description: >-
                  Sets full refresh to every 24 hours and incremental sync to
                  every 6 hours.
                value:
                  fullRefreshCacheSchedule:
                    type: BASIC
                    expression: PT24H
                  incrementalCacheSchedule:
                    type: BASIC
                    expression: PT6H
              Disable Full Refresh:
                description: >-
                  Disables the full refresh schedule while keeping incremental
                  sync active.
                value:
                  fullRefreshCacheSchedule:
                    type: NONE
                  incrementalCacheSchedule:
                    type: BASIC
                    expression: PT1H
        required: true
      responses:
        '200':
          description: >-
            Cache settings updated successfully. Returns the updated cache
            configuration.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Cache'
        '404':
          description: Cache not found for the given cacheId.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Cache'
components:
  schemas:
    CacheSettingsUpdateRequest:
      type: object
      properties:
        incrementalCacheSchedule:
          $ref: '#/components/schemas/Schedule'
        fullRefreshCacheSchedule:
          $ref: '#/components/schemas/Schedule'
      description: |-
        This class represents a request to cache data.
         It contains the catalog ID, schema name, table name, and schedule of the cache request.
    Cache:
      type: object
      properties:
        id:
          type: string
          description: The ID of the cache.
        catalogId:
          type: string
          description: The ID of the catalog for the cache request.
        schemaName:
          type: string
          description: The name of the schema for the cache request.
        tableName:
          type: string
          description: The name of the table for the cache request.
        incrementalCacheSchedule:
          $ref: '#/components/schemas/Schedule'
        fullRefreshCacheSchedule:
          $ref: '#/components/schemas/Schedule'
        appId:
          type: string
          writeOnly: true
        projectId:
          type: string
          description: The ID of the project for the cache request.
    Schedule:
      type: object
      properties:
        type:
          type: string
          description: The type of the schedule. BASIC or NONE.
        expression:
          type: string
          description: |-
            The expression of the schedule.
             Valid if the type is other than NONE.
             For BASIC, the expression is a duration in ISO-8601 format.
             "PT15M"     -- parses as "15 minutes" (where a minute is 60 seconds)
             "PT10H"     -- parses as "10 hours" (where an hour is 3600 seconds)
             "P2D"       -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
      description: |-
        This class represents a schedule for a cache request.
         It contains the type and expression of the schedule.
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````