Skip to main content

Sync Endpoints

Check pending

Check if the server wants the agent to sync.
GET /api/v1/sync/pending
Response:
{
  "action": "sync",
  "reason": "manual_request",
  "sync_requested": true
}
FieldValues
action"sync" (run a sync) or "wait" (do nothing)
reason"manual_request", "scheduled", "no_sync_needed", "in_progress", "auto_sync_paused"
sync_requestedWhether a sync was explicitly requested

Upload inventory

Upload a gzipped inventory CSV from TCGplayer.
POST /api/v1/sync
Content-Type: application/gzip
The request body is the gzip-compressed CSV data. The server processes it, matches cards to the catalog, and calculates price updates. Response:
{"status": "ok", "cards_processed": 4521}

Get price updates

Download a CSV of price changes to import back to TCGplayer.
GET /api/v1/export/price-updates
Returns a CSV string (not JSON). Empty string if no updates.

Cancel sync

Release the sync lock if something goes wrong mid-sync.
POST /api/v1/sync/cancel
Response:
{"status": "cancelled"}
The server auto-clears stale locks after 5 minutes, so this is a courtesy call.