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

# Get Variation History

> Retrieves the version history of a snippet variation. API Cost: N requests (one per history record returned).



## OpenAPI

````yaml GET /snippet/variation/history
openapi: 3.1.0
info:
  title: Snippets AI API
  description: >-
    A comprehensive API for managing snippets, folders, tags, and variations
    programmatically
  version: 1.0.0
  contact:
    name: Snippets AI Support
    email: team@getsnippets.ai
servers:
  - url: https://www.getsnippets.ai/api/prompts
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Snippets
    description: Operations for managing code snippets and text snippets
  - name: Variations
    description: Operations for managing snippet variations and version history
  - name: Folders
    description: Operations for organizing snippets into folders
  - name: Tags
    description: Operations for tagging and categorizing snippets
paths:
  /snippet/variation/history:
    get:
      tags:
        - Variations
      summary: Get variation version history
      description: >-
        Retrieves the version history of a snippet variation. API Cost: N
        requests (one per history record returned).
      operationId: getVariationHistory
      parameters:
        - name: variationId
          in: query
          required: true
          description: The ID of the variation
          schema:
            type: string
            format: uuid
        - name: limit
          in: query
          required: false
          description: Maximum number of versions to return (1-100)
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - name: fromDate
          in: query
          required: false
          description: Start date for filtering (ISO 8601 format)
          schema:
            type: string
            format: date-time
        - name: toDate
          in: query
          required: false
          description: End date for filtering (ISO 8601 format)
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Version history retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariationHistoryResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
components:
  schemas:
    VariationHistoryResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              changed_at:
                type: string
                format: date-time
              content:
                $ref: '#/components/schemas/SnippetContent'
        usage:
          $ref: '#/components/schemas/BatchUsageInfo'
        metadata:
          type: object
          properties:
            hasMore:
              type: boolean
            totalRecords:
              type: integer
    SnippetContent:
      type: object
      properties:
        type:
          type: string
          description: Content type (e.g., 'plaintext', 'code')
          example: plaintext
        content:
          type: string
          description: The actual content of the snippet
          example: Hello, world!
    BatchUsageInfo:
      type: object
      properties:
        remainingRequests:
          type: integer
          description: Number of API requests remaining
        usageDeducted:
          type: integer
          description: Number of requests deducted for this operation
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Error message describing what went wrong
        error:
          type: string
          description: Additional error details
  responses:
    BadRequest:
      description: Bad request - Invalid parameters or malformed JSON
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Snippet ID is required
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Invalid or inactive API key
    Forbidden:
      description: Forbidden - Insufficient permissions or quota exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficient_quota:
              value:
                success: false
                message: >-
                  Insufficient API requests. This operation requires 5 requests
                  but you have 0 remaining.
                usage:
                  remainingRequests: 0
                  requiredRequests: 5
            no_access:
              value:
                success: false
                message: API key does not have access to this team
    NotFound:
      description: Not Found - Requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Snippet not found
    RateLimitExceeded:
      description: Too Many Requests - Rate limit exceeded (20 requests per minute)
      headers:
        Retry-After:
          description: Number of seconds to wait before making another request
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: >-
              Rate limit exceeded. Too many requests from this API key. Try
              again in 120 seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token. Include your API key in the
        Authorization header.

````