Skip to main content

Endpoint

GET /server/clickwrap/{slug}/history

Authentication

This endpoint requires authentication via API key. Include your API key in the X-API-Key header:
X-API-Key: ca_your_api_key_here

Path Parameters

ParameterTypeRequiredDescription
slugstringYesUnique identifier for the clickwrap

Request Example

curl -X GET "https://platform.chamelio.ai/server/clickwrap/privacy-policy/history" \
  -H "X-API-Key: ca_your_api_key_here"
import requests

slug = "privacy-policy"

url = f"https://platform.chamelio.ai/server/clickwrap/{slug}/history"
headers = {
    "X-API-Key": "ca_your_api_key_here"
}

response = requests.get(url, headers=headers)
print(response.json())
const slug = "privacy-policy";

const response = await fetch(
  `https://platform.chamelio.ai/server/clickwrap/${slug}/history`,
  {
    method: 'GET',
    headers: {
      'X-API-Key': 'ca_your_api_key_here'
    }
  }
);

const data = await response.json();
console.log(data);

Response

Success Response

Status Code: 200 OK
{
  "slug": "privacy-policy",
  "versions": [
    {
      "clickwrap_version_id": 42,
      "clickwrap_id": 7,
      "version": 3,
      "content": "By clicking Accept, you agree to our updated Privacy Policy...",
      "content_html": "<p>By clicking Accept, you agree to our updated Privacy Policy...</p>",
      "is_draft": false,
      "archived_at": null,
      "created_at": "2026-05-01T09:00:00Z",
      "updated_at": "2026-05-01T09:00:00Z"
    },
    {
      "clickwrap_version_id": 31,
      "clickwrap_id": 7,
      "version": 2,
      "content": "By clicking Accept, you agree to our Privacy Policy...",
      "content_html": "<p>By clicking Accept, you agree to our Privacy Policy...</p>",
      "is_draft": false,
      "archived_at": "2026-05-01T09:00:00Z",
      "created_at": "2026-01-15T08:00:00Z",
      "updated_at": "2026-05-01T09:00:00Z"
    }
  ]
}

Response Fields

FieldTypeDescription
slugstringUnique clickwrap identifier
versionsarrayAll published (non-draft) versions, newest first

Version Object Fields

FieldTypeDescription
clickwrap_version_idintegerInternal identifier for this version
clickwrap_idintegerInternal identifier for the parent clickwrap
versionintegerSequential version number
contentstringPlain-text content of this version
content_htmlstring or nullSanitized HTML content of this version
is_draftbooleanAlways false — this endpoint only returns published versions
archived_atstring or nullISO 8601 timestamp when this version was superseded, or null if it is the current active version
created_atstringISO 8601 timestamp when this version was created
updated_atstringISO 8601 timestamp of the last update to this version

Error Responses

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.
{
  "detail": "Invalid API key"
}

404 Not Found

Returned when no active clickwrap exists for the given slug.
{
  "detail": "Clickwrap 'privacy-policy' not found"
}

500 Internal Server Error

Returned when the request fails due to a server error.
{
  "detail": "Internal server error"
}

Notes

Draft versions are never included in this response. Only versions that have been published (activated) are returned.
Use archived_at to distinguish the currently active version (where archived_at is null) from older superseded versions.

Use Cases

This endpoint is useful for:
  • Compliance auditing - Retrieve the exact text a user accepted at a given clickwrap_version_id
  • Re-consent detection - Compare the user’s last accepted version_number against the full history to determine if they need to re-accept
  • Change logging - Display a changelog of terms updates to end users