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

# Policy History

> Previous versions of a policy, newest first (up to 20).



## OpenAPI

````yaml GET /router/policies/{policy_id}/history
openapi: 3.0.1
info:
  title: Electron Hub API
  description: >-
    Unified API platform integrating 200+ AI models for chat, image generation,
    speech-to-text, embeddings, and more.
  version: 1.0.0
  contact:
    name: Electron Hub Support
    email: support@electronhub.ai
    url: https://discord.com/invite/electronhub
  license:
    name: MIT
servers:
  - url: https://api.electronhub.ai/v1
    description: Production API v1
security:
  - bearerAuth: []
paths:
  /router/policies/{policy_id}/history:
    get:
      tags:
        - Router
      summary: Policy history
      description: Previous versions of a policy, newest first (up to 20).
      operationId: getRouterPolicyHistory
      parameters:
        - name: policy_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z0-9-]{1,40}$
          example: work
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
              example:
                items:
                  - version: 2
                    savedAt: '2026-11-08T07:34:14.929184Z'
                    updatedBy: client
                    policy:
                      policyId: work
                      name: Work
                      schemaVersion: 4
                      mode: auto
                      auto:
                        costTier: medium
                        qualityFloor: 0
                        preferFast: false
                        preferVendor: null
                        preferStrength: 0
                        maxTtft: 0
                        perCategory: {}
                      custom:
                        rules: []
                        default:
                          - action: useAuto
                      models:
                        allowed: []
                        excluded:
                          - '*:free'
                        strictAllowed: false
                      guardrails:
                        maxCostPerReq: null
                        blockOverCost: false
                        budgetUsd: 5
                        budgetWindow: daily
                        budgetScope: routed
                        blockOverBudget: false
                        pii:
                          enabled: false
                          action: block
                          model: null
                          entities: {}
                          labels: {}
                          custom: []
                          scanAll: false
                      cache:
                        enabled: false
                        ttlMin: 1440
                        maxEntries: 100
                        semantic: false
                        semanticThreshold: 0.9
        '403':
          description: Proxy keys cannot manage Router settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Only master keys can manage Router settings.
                  type: error
                  param: null
                  code: 403
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API key (starts with 'ek-')

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.