API Overview
The GeSmart Sync API provides REST endpoints for managing synchronization operations, configuration, and monitoring.
Base URL
All API endpoints are relative to your application URL:
- Development:
http://localhost:3000/api - Production:
https://your-domain.com/api
Authentication
Most endpoints require authentication using a Bearer token. Include the token in the Authorization header:
Authorization: Bearer YOUR_TOKEN_HERE
API Endpoints
Authentication
POST /api/auth/login- Login and get access tokenGET /api/auth/me- Get current user information
Sync Operations
POST /api/sync/[entityType]- Sync specific entity (products, customers, brands, categories)POST /api/sync/all- Sync all entitiesGET /api/sync/status- Get sync status for all entitiesGET /api/sync/progress- Get real-time sync progressPOST /api/sync/control- Control sync (pause, resume, stop)
Configuration
GET /api/config- Get sync configurationsPUT /api/config- Update sync configuration
Logs
GET /api/logs- Get sync logs (with pagination)GET /api/errors- Get error logs (with pagination)PATCH /api/errors- Mark error as resolved
Cron
GET /api/cron/sync- Trigger sync via external cron (requires API key)
Response Format
All API responses follow a consistent format:
{
"success": true,
"data": { ... },
"error": null
}
Error responses:
{
"success": false,
"error": "Error message",
"data": null
}
Rate Limiting
API requests are rate-limited to prevent abuse. If you exceed the limit, you'll receive a 429 Too Many Requests response.
Next Steps
- Authentication - Learn how to authenticate
- Sync Endpoints - Detailed sync API documentation