> ## 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.

# Get Cache Status

> Returns the current status of a specific cache, including execution details for both the last incremental sync and the last full refresh.

The top-level `status` field is computed from the most recent execution across both sync types:
- `NOT_INITIALIZED`: No sync has ever been executed for this cache.
- `RUNNING`: At least one sync (incremental or full refresh) is currently in progress.
- `COMPLETED`: The most recent sync completed successfully.
- `FAILED`: The most recent sync failed. Check the `error` field in the relevant execution info for details.
- `CANCELLED`: The most recent sync was cancelled via a cancel endpoint.

Each execution info object (`lastIncrementalCacheExecution`, `lastFullRefreshCacheExecution`) contains:
- `id`: Unique execution identifier.
- `status`: Execution-specific status (RUNNING, COMPLETED, FAILED, CANCELLED).
- `progress`: Real-time progress with record counts (cached, inserted, updated, deleted).
- `error`: Error details if the execution failed.
- `createdAt`, `updatedAt`, `finishedAt`: Timestamps tracking execution lifecycle.

Use `excludeLogs=true` to omit the `cacheActionLogs` array for a lighter response, especially when polling for status during an active sync.

<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 get /data/projects/{projectId}/cache/{cacheId}/status
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}/status:
    get:
      tags:
        - Data -- Cache
      summary: Get Cache Status
      description: >-
        Returns the current status of a specific cache, including execution
        details for both the last incremental sync and the last full refresh.


        The top-level `status` field is computed from the most recent execution
        across both sync types:

        - `NOT_INITIALIZED`: No sync has ever been executed for this cache.

        - `RUNNING`: At least one sync (incremental or full refresh) is
        currently in progress.

        - `COMPLETED`: The most recent sync completed successfully.

        - `FAILED`: The most recent sync failed. Check the `error` field in the
        relevant execution info for details.

        - `CANCELLED`: The most recent sync was cancelled via a cancel endpoint.


        Each execution info object (`lastIncrementalCacheExecution`,
        `lastFullRefreshCacheExecution`) contains:

        - `id`: Unique execution identifier.

        - `status`: Execution-specific status (RUNNING, COMPLETED, FAILED,
        CANCELLED).

        - `progress`: Real-time progress with record counts (cached, inserted,
        updated, deleted).

        - `error`: Error details if the execution failed.

        - `createdAt`, `updatedAt`, `finishedAt`: Timestamps tracking execution
        lifecycle.


        Use `excludeLogs=true` to omit the `cacheActionLogs` array for a lighter
        response, especially when polling for status during an active sync.
      operationId: getCacheStatus
      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 check (UUID format)
          required: true
          schema:
            type: string
          example: 960bd651-7b3c-4511-9a88-18e14ac7742a
        - name: excludeLogs
          in: query
          description: >-
            When true, omits the cacheActionLogs array from the response for a
            lighter payload. Defaults to false.
          required: false
          schema:
            type: boolean
          example: true
      responses:
        '200':
          description: Cache status retrieved successfully.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CacheStatus'
        '404':
          description: Cache not found for the given cacheId.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CacheStatus'
components:
  schemas:
    CacheStatus:
      type: object
      properties:
        id:
          type: string
          description: The ID of the cache.
        status:
          type: string
          description: |-
            The status of the cache.
             RUNNING, CANCELLED, FAILED, COMPLETED, DELETED, NOT_INITIALIZED
          enum:
            - RUNNING
            - CANCELLED
            - FAILED
            - COMPLETED
            - DELETED
            - NOT_INITIALIZED
        catalogId:
          type: string
          description: The ID of the catalog that the cache belongs to.
        schemaName:
          type: string
          description: The name of the schema that the cache belongs to.
        tableName:
          type: string
          description: The name of the table that the cache belongs to.
        lastIncrementalCacheExecution:
          $ref: '#/components/schemas/CacheExecutionInfo'
        lastFullRefreshCacheExecution:
          $ref: '#/components/schemas/CacheExecutionInfo'
        cacheActionLogs:
          type: array
          description: The list of cache action logs
          items:
            $ref: '#/components/schemas/CacheActionRecord'
        appId:
          type: string
          writeOnly: true
        projectId:
          type: string
          description: The ID of the project that the cache belongs to.
    CacheExecutionInfo:
      type: object
      properties:
        id:
          type: string
        executionMode:
          type: string
        status:
          type: string
        error:
          type: object
        progress:
          $ref: '#/components/schemas/CacheExecutionProgress'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        finishedAt:
          type: string
          format: date-time
    CacheActionRecord:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        action:
          type: string
        message:
          type: string
        cacheType:
          type: string
        isScheduled:
          type: boolean
    CacheExecutionProgress:
      type: object
      properties:
        numberOfCachedRecords:
          type: integer
          format: int32
        numberOfInsertedRecords:
          type: integer
          format: int32
        numberOfUpdatedRecords:
          type: integer
          format: int32
        numberOfDeletedRecords:
          type: integer
          format: int32
        lastOffset:
          type: string
        lastCacheTxId:
          type: string
  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

````