Historical Card Versions

This guide explains how to use the Guru Cards API to retrieve current and historical versions of a card. This is useful if you need to audit changes, display previous content, or analyze how a card has evolved over time. By the end of this article, you’ll know how to fetch the current version of a card, identify which version is current, list all historical versions, and retrieve a specific past version of a card.

Understanding Card Versions

Every time a card is updated and published, Guru increments its version number:

  • Version numbers start at 1
  • The highest version number is always the current version
  • Historical versions remain accessible via the Versions API

The version field is the key link between the current card and its revision history.


Step 1: Get the Current Version of a Card

To retrieve the current state of a card, call:

GET https://api.getguru.com/api/v1/cards/{cardId}

Example Response (Redacted)

{
  "id": "70e1b31c-8f3e-419f-ab03-b7a86dda1243",
  "version": 3,
  "preferredPhrase": "US Company Holidays",
  "content": "<p>...</p>",
  "verificationState": "TRUSTED",
  "lastModified": "2025-12-19T16:41:28.565+0000"
}

Key Fields

FieldDescription
idUnique identifier for the card
versionCurrent version number of the card
preferredPhraseThe card’s title
contentThe card’s rendered HTML content
verificationStateIndicates whether the card is trusted
lastModifiedTimestamp of the most recent update

Note: Many fields returned by this endpoint have been intentionally redacted in this documentation to focus on versioning behavior. Additional fields may be present in the full API response.


Step 2: List All Versions of a Card

To retrieve all historical versions of a card, use:

GET https://api.getguru.com/api/v1/cards/{cardId}/versions

Example Response (Redacted)

[
  {
    "id": "70e1b31c-8f3e-419f-ab03-b7a86dda1243",
    "version": 3,
    "lastModified": "2025-12-19T16:41:28.565+0000"
  },
  {
    "id": "70e1b31c-8f3e-419f-ab03-b7a86dda1243",
    "version": 2,
    "lastModified": "2025-12-19T16:39:40.086+0000"
  },
  {
    "id": "70e1b31c-8f3e-419f-ab03-b7a86dda1243",
    "version": 1,
    "lastModified": "2025-12-11T23:25:23.877+0000"
  }
]

What This Endpoint Is Best For

  • Determining how many versions exist for a card
  • Identifying the first version of a card
  • Finding the most recent previous version
  • Supporting auditing, change history, and compliance workflows

Step 3: Retrieve a Specific Card Version

Once you know the version number you want, fetch that exact version using:

GET https://api.getguru.com/api/v1/cards/{cardId}/versions/{version}

Example: Get Version 2

GET https://api.getguru.com/api/v1/cards/70e1b31c-8f3e-419f-ab03-b7a86dda1243/versions/2

Example Response (Redacted)

{
  "id": "70e1b31c-8f3e-419f-ab03-b7a86dda1243",
  "version": 2,
  "preferredPhrase": "US Company Holidays",
  "content": "<p>...</p>",
  "verificationState": "TRUSTED",
  "lastModified": "2025-12-19T16:39:40.086+0000"
}

This response uses the same structure as the current card endpoint, but reflects the card exactly as it existed at the specified version.


Common Use Cases

View the Previous Version of a Card

  1. Retrieve the current card using GET /cards/{cardId}
  2. Read the version field from the response
  3. Subtract 1 from that value
  4. Fetch the previous version using GET /cards/{cardId}/versions/{version}

Retrieve the Original Card Content

  1. List all versions using GET /cards/{cardId}/versions
  2. Identify the entry with version: 1
  3. Fetch that version directly

Compare Changes Over Time

  1. Retrieve multiple versions of the same card
  2. Compare the content field across versions (avoid diffing raw HTML when possible)
  3. Track how the card’s information has changed

Summary

GoalEndpoint
Get the current cardGET /api/v1/cards/{cardId}
List all versionsGET /api/v1/cards/{cardId}/versions
Get a specific versionGET /api/v1/cards/{cardId}/versions/{version}

The version field is the bridge between a card’s current state and its historical revisions, enabling transparency, auditing, and advanced content workflows.