Why incremental synchronization matters
Fetching all records on every synchronization has real costs:- Slower synchronizations — more data to transfer and process
- Higher load on the connected systems
- Unnecessary processing — comparing all records to detect changes is expensive
- Rate limiting risk — repeated full synchronizations can hit connector rate limits
How it works
Most Chift Unified API collection endpoints support theupdated_after parameter, which returns only records created or updated on or after a specified timestamp.
- Store the timestamp of your last successful synchronization
- On the next synchronization run, pass that timestamp as
updated_after - Process only the new and updated records
- Store the new timestamp for the next run
Example request
2024-10-15T14:30:00Z.
Implementing incremental synchronization
1. Check if updated_after is supported
The API reference for each endpoint documents whether updated_after is available. Not all connectors support it for every endpoint, and some newer connectors may have limited support.
2. Store your last synchronization timestamp
Keep the timestamp of your last successful synchronization for each consumer and each endpoint. This is the value you’ll pass asupdated_after on the next run.
First synchronization: full initial load
On your first synchronization for a consumer, you don’t have a previous timestamp to use. Instead, use thedate_from and date_to parameters (if supported) to load historical data, or simply fetch all records without updated_after.
updated_after.
When updated_after is not supported
Some connectors don’t support incremental synchronization for certain endpoints. When this happens, you’ll need to manually track changes by comparing the current response with your stored records.
Strategy: Compare and identify changes
- Fetch all records from the endpoint (you’ll need to paginate if there are many)
- Compare each record with your stored version
- Identify three types:
- New records — in the API response but not in your system
- Updated records — in your system but with changed values (check
updated_atif available) - Deleted records — in your system but missing from the API response (optional: implement soft deletes or mark as archived)
Performance considerations
Manually comparing all records is less efficient than true incremental synchronization. We recommend:- Requesting higher pagination limits to reduce API calls
- Running these synchronizations less frequently (e.g., once per day instead of every hour)
- Consider using caching headers to avoid unnecessary fetches — see Caching in Chift API
Best practices
1. Always store timestamps in UTC
Always work with UTC timestamps. Many timezone bugs come from mixing timezones.2. Be precise with timing
Store the exact timestamp of when the synchronization completed, not rounded times. This ensures you don’t miss edge-case records created at exact second boundaries.3. Handle synchronization failures gracefully
If a synchronization fails partway through, don’t update your stored timestamp. Only update it after all records have been successfully processed and stored.4. Monitor connector-specific behavior
Some connectors have quirks:- Records might be updated within a brief window after creation
- Deleted records might still appear for a short time with a
deleted_atfield - Timestamps might have millisecond precision on some systems and second precision on others
5. Plan for the first synchronization carefully
Initial synchronizations can be large. Consider:- Running them at off-peak times
- Breaking them into smaller date ranges if the dataset is huge
- Using
date_fromanddate_toto limit the initial load period
Troubleshooting
No records returned, but I know data was updated
Check:- Is
updated_aftersupported for this endpoint? (Check the API reference) - Is your timestamp in UTC?
- Are you using the correct format? (ISO 8601:
YYYY-MM-DDTHH:MM:SSZ) - Is your stored timestamp actually before the data you expect? (Clocks can drift)
Different results between connectors
Connector behavior varies:- Some update
updated_atwhen related objects change (e.g., marking an invoice as paid) - Others only update
updated_atwhen the record itself changes - Some don’t support
updated_atat all
Timestamps are drifting
If your synchronizations keep missing recent data, you may have a clock drift issue between your system and Chift’s servers. Monitor theserver_time in API responses and adjust your next synchronization time accordingly.
Memory issues with full synchronizations
If you’re doing manual comparison (for connectors withoutupdated_after support) and hitting memory limits with large datasets:
- Fetch and process records in smaller batches rather than loading everything at once
- Use streaming if your API client supports it
Related documentation
- Pagination limits — Understanding page sizes and throughput
- Caching in Chift API — How cached responses work and when to bypass them
- Good practices for create and update requests — Handling mutations reliably
- API reference — See which endpoints support
updated_after