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

# Get a cache rule

> Returns the rule if it belongs to the caller's organisation; 404 otherwise. Archived rules are NOT returned (use the audit log to inspect removed rules).



## OpenAPI

````yaml GET /api/gateway/v1/cache-rules/{id}
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/gateway/v1/cache-rules/{id}:
    get:
      tags:
        - Cache Rules
      summary: Get a cache rule
      description: >-
        Returns the rule if it belongs to the caller's organisation; 404
        otherwise. Archived rules are NOT returned (use the audit log to inspect
        removed rules).
      operationId: getApiGatewayV1Cache-rulesById
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: The rule
          content:
            application/json:
              schema:
                type: object
                properties:
                  cache_rule:
                    type: object
                    properties:
                      id:
                        type: string
                      organization_id:
                        type: string
                      name:
                        type: string
                      description:
                        type:
                          - string
                          - 'null'
                      priority:
                        type: integer
                      enabled:
                        type: boolean
                      matchers:
                        type: object
                        additionalProperties: {}
                      action:
                        type: object
                        properties:
                          mode:
                            type: string
                            enum:
                              - respect
                              - force
                              - disable
                          ttl:
                            type: integer
                          salt:
                            type: string
                        required:
                          - mode
                      mode_enum:
                        type: string
                        enum:
                          - RESPECT
                          - FORCE
                          - DISABLE
                      archived_at:
                        type:
                          - string
                          - 'null'
                      created_at:
                        type: string
                      updated_at:
                        type: string
                    required:
                      - id
                      - organization_id
                      - name
                      - description
                      - priority
                      - enabled
                      - matchers
                      - action
                      - mode_enum
                      - archived_at
                      - created_at
                      - updated_at
                required:
                  - cache_rule
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````