Changes
Understand how Diffy tracks and reports changes.
Accessing Changes
Changes are returned as part of domain details. When you fetch a domain, you get its recent changes:
GET /api/domains/:id
Response with Changes
{
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "competitor.com",
"displayName": "Competitor",
"status": "active",
"pages": [...],
"recentChanges": [
{
"id": "660e8400-e29b-41d4-a716-446655440000",
"pageId": "550e8400-e29b-41d4-a716-446655440001",
"domainId": "550e8400-e29b-41d4-a716-446655440000",
"orgId": "770e8400-e29b-41d4-a716-446655440000",
"changeType": "price_change",
"severity": "high",
"confidence": "0.95",
"summary": "Price increased from $99 to $129 on Pro plan",
"diffData": {
"before": "Starting at $99/month",
"after": "Starting at $129/month",
"stats": {
"additions": 1,
"deletions": 1,
"changes": 1
}
},
"snapshotBeforeId": "880e8400-e29b-41d4-a716-446655440000",
"snapshotAfterId": "880e8400-e29b-41d4-a716-446655440001",
"acknowledgedAt": null,
"acknowledgedBy": null,
"createdAt": "2024-01-15T10:30:00Z"
}
],
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}
Change Object
| Field | Type | Description |
|---|---|---|
id | uuid | Unique change identifier |
pageId | uuid | Page where change was detected |
domainId | uuid | Domain the page belongs to |
changeType | string | Classification of the change |
severity | string | Impact level: critical, high, medium, low |
confidence | decimal | Detection confidence (0.00 to 1.00) |
summary | string | Human-readable description |
diffData | object | Detailed diff information |
snapshotBeforeId | uuid | Reference to previous snapshot |
snapshotAfterId | uuid | Reference to new snapshot |
acknowledgedAt | datetime | When change was acknowledged (if any) |
createdAt | datetime | When change was detected |
Change Types
| Type | Description |
|---|---|
price_change | Pricing modification |
feature_added | New feature announced |
feature_removed | Feature deprecated or removed |
terms_update | Legal or terms change |
section_added | New content section added |
section_removed | Content section removed |
content_change | General content modification |
Severity Levels
| Severity | Description | Example |
|---|---|---|
critical | Major business impact | Competitor discontinued a product |
high | Significant change | Price increase over 20% |
medium | Notable change | New feature added |
low | Minor change | Text correction |
Diff Data Structure
The diffData object contains:
{
"before": "Original text content",
"after": "Modified text content",
"stats": {
"additions": 5,
"deletions": 2,
"changes": 3
},
"hunks": [
{
"oldStart": 10,
"oldLines": 3,
"newStart": 10,
"newLines": 5,
"lines": [
{ "type": "context", "content": "unchanged line" },
{ "type": "deletion", "content": "removed line" },
{ "type": "addition", "content": "added line" }
]
}
]
}
Future: Dedicated Changes API
Coming Soon
A dedicated Changes API with filtering, pagination, and search is planned for a future release. This will include:
GET /api/changes- List all changes across domainsGET /api/changes/:id- Get detailed change information- Filtering by severity, change type, date range
- Full-text search in change summaries