Schedule Sync API
The v2 sync endpoint provides optimistic locking and transactional updates for schedules.
Endpoint
POST /api/events/:eventId/schedule/v2/sync
Request
{
"scheduleVersion": 5,
"changes": [
{
"type": "UPDATE",
"id": "perf_123",
"data": {
"performanceTime": "2025-03-15T09:15:00Z"
}
},
{
"type": "CREATE",
"tempId": "temp_1",
"data": {
"teamName": "New Team",
"performanceTime": "2025-03-15T10:00:00Z"
}
}
]
}
Response
Success:
{
"success": true,
"newVersion": 6,
"results": [
{ "id": "perf_123", "status": "updated" },
{ "tempId": "temp_1", "id": "perf_456", "status": "created" }
]
}
Version Conflicts
If another user modified the schedule:
{
"success": false,
"error": {
"code": "VERSION_CONFLICT",
"message": "Schedule was modified by another user"
}
}
Fetch the latest schedule and retry.
Change Types
| Type | Description |
|---|---|
| CREATE | Add new performance |
| UPDATE | Modify existing performance |
| DELETE | Remove performance |
Related Docs
- API Overview - Full API documentation
- Schedule Engine - How sync works internally