Sync time entries for reporting
This page documents the legacy API v0. New integrations should use API v1.
START_FROM="2026-07-01T00:00:00Z"PAGE=1LIMIT=100
while true; do RESPONSE=$(curl "https://api.teamgrid.app/times?startFrom=$START_FROM&page=$PAGE&limit=$LIMIT" \ -H "Authorization: Bearer $TEAMGRID_API_TOKEN" \ -H "Accept: application/json")
printf '%s' "$RESPONSE" | jq -c '.data[]' | while read -r TIME_ENTRY; do TIME_ID=$(printf '%s' "$TIME_ENTRY" | jq -r '._id') echo "Upsert time entry $TIME_ID" done
TOTAL_PAGES=$(printf '%s' "$RESPONSE" | jq -r '.pagination.pages') if [ "$PAGE" -ge "$TOTAL_PAGES" ]; then break fi PAGE=$((PAGE + 1))doneRun incremental syncs with overlap if downstream processing can be delayed. Upsert by TeamGrid _id so repeated syncs remain safe.Choose a synchronization window
Section titled “Choose a synchronization window”Use an ISO 8601 UTC timestamp for startFrom. Store the latest completed sync timestamp in your own system.
Page through time entries
Section titled “Page through time entries”Request a stable page size and continue until the pagination metadata indicates that no more pages remain.
Upsert by TeamGrid id
Section titled “Upsert by TeamGrid id”Use each time entry _id as the primary external key in the reporting system.