Skip to main content

GET /api/v1/change-history

Returns a paginated feed of all changes made within a tenant. Every create, update, delete, publish, rollback, approve, reject, archive, and restore action is recorded in the audit log and surfaced through this endpoint. Use it to answer “who changed what, when?” for compliance, debugging, and operational visibility.

Authentication

Requires a valid tenant and one of the following roles: admin or editor.
HeaderRequiredDescription
X-Tenant-IdYesTenant identifier
AuthorizationYesBearer token or API key

Query Parameters

All parameters are optional. When no filters are provided, the endpoint returns the most recent changes across all entity types.
ParameterTypeDefaultDescription
entityTypestringFilter by entity type (e.g., decision_flow, offer, creative, category, channel, qualification_rule, contact_policy, connector, pipeline, schema, customer)
entityIdstringFilter to changes for a specific entity by its ID
actionstringFilter by action type: create, update, delete, publish, rollback, approve, reject, soft_delete, restore
sincestringISO 8601 timestamp. Only return changes at or after this time
limitinteger50Number of results per page (max 200)
pageinteger1Page number for pagination

Example Request

Fetch all decision flow changes in the last 7 days:
curl -X GET "https://playground.kaireonai.com/api/v1/change-history?entityType=decision_flow&since=2026-03-25T00:00:00Z&limit=20" \
  -H "X-Tenant-Id: my-tenant" \
  -H "Authorization: Bearer sk_live_abc123"

Example Response

{
  "changes": [
    {
      "id": "audit_f7a2b1c3",
      "action": "rollback",
      "entityType": "decision_flow",
      "entityId": "flow_abc123",
      "entityName": "Default Recommendation Flow",
      "summary": "Rolled back Decision Flow \"Default Recommendation Flow\"",
      "user": {
        "id": "user_001",
        "name": "jane.smith@example.com"
      },
      "timestamp": "2026-04-01T10:30:00.000Z",
      "changes": {
        "action": "rollback",
        "fromVersion": 5,
        "toVersion": 3,
        "newVersion": 6,
        "notes": "Rollback to v3: Reverting due to scoring regression in v5"
      }
    },
    {
      "id": "audit_e3d4c5b6",
      "action": "publish",
      "entityType": "decision_flow",
      "entityId": "flow_abc123",
      "entityName": "Default Recommendation Flow",
      "summary": "Published Decision Flow \"Default Recommendation Flow\"",
      "user": {
        "id": "user_002",
        "name": "john.doe@example.com"
      },
      "timestamp": "2026-03-25T16:45:00.000Z",
      "changes": {
        "version": 5,
        "notes": "Experimental propensity model"
      }
    },
    {
      "id": "audit_a1b2c3d4",
      "action": "update",
      "entityType": "decision_flow",
      "entityId": "flow_abc123",
      "entityName": "Default Recommendation Flow",
      "summary": "Updated Decision Flow \"Default Recommendation Flow\"",
      "user": {
        "id": "user_002",
        "name": "john.doe@example.com"
      },
      "timestamp": "2026-03-25T15:00:00.000Z",
      "changes": {}
    }
  ],
  "total": 3,
  "page": 1,
  "limit": 20
}

Response Fields

FieldTypeDescription
changesarrayList of audit log entries matching the query
changes[].idstringUnique audit log entry ID
changes[].actionstringThe action performed (see table below)
changes[].entityTypestringThe type of entity that was changed
changes[].entityIdstringThe ID of the changed entity
changes[].entityNamestring or nullHuman-readable name of the entity, if available
changes[].summarystringAuto-generated one-line summary (e.g., "Published Decision Flow \"Default Flow\"")
changes[].user.idstring or nullThe ID of the user who made the change
changes[].user.namestringThe name or email of the user, or "system" for automated changes
changes[].timestampstringISO 8601 timestamp of when the change occurred
changes[].changesobjectAction-specific change details (varies by action type)
totalintegerTotal number of matching records (for pagination)
pageintegerCurrent page number
limitintegerResults per page

Action Types

ActionDescription
createEntity was created
updateEntity was modified
deleteEntity was permanently deleted
publishDecision flow or other entity was published to production
rollbackDecision flow was rolled back to a previous version
approveGovernance approval was granted
rejectGovernance approval was rejected
soft_deleteEntity was archived (soft-deleted)
restorePreviously archived entity was restored
gdpr_erasureCustomer data was erased for GDPR compliance

Error Responses

StatusCause
401Missing or invalid authentication credentials
403Insufficient role (requires admin or editor)
500Internal server error

Combine entityId with no other filters to see the complete lifecycle of a single entity — from creation through every update, publish, and rollback.
The summary field is auto-generated from the action and entity type, formatted for display in a UI timeline (e.g., “Created Offer”, “Published Decision Flow”). Use it directly in activity feeds without additional formatting.
See also: Audit Logs | Decision Flow Versions | Decision Flow Rollback