PATCH /api/v1/loterias/:id
Updates an existing loteria’s configuration. Changes toisActive will cascade to associated sorteos.
Authentication
Requires authentication. Typically ADMIN role for updates.Path Parameters
UUID of the loteria to update
Request Body
All fields are optional. Only provided fields will be updated.Update the loteria name.Min: 2 characters
Update configuration rules.See Create Loteria for full schema.
Activate or deactivate the loteria.
Changing this field triggers cascade operations on all associated sorteos.
Response
Indicates if the operation was successful
The updated loteria object
Example Request
Example Response
Error Responses
Cascade Effects
- Deactivate Loteria
- Activate Loteria
Setting
isActive: falseCascade effect:- Loteria is marked inactive
- All SCHEDULED sorteos are marked
isActive: false - Sorteos remain in database but hidden from vendedores
- Existing tickets remain valid
Common Update Scenarios
Add New Draw Time
Add New Draw Time
Add a third daily draw:Effect:
- New sorteos will be created at 20:55
- Existing sorteos unchanged
- Next seed will include new time
Enable REVENTADO
Enable REVENTADO
Turn on REVENTADO feature:Effect:
- New sorteos will have
reventadoEnabled: true - Existing sorteos unchanged
- Vendedores can sell REVENTADO bets on new sorteos
Change to 3 Digits
Change to 3 Digits
Switch from Times (2) to Monazos (3):Effect:
- New sorteos inherit
digits: 3 - Existing sorteos keep their original digits
- Winning numbers must be 000-999 for new sorteos
Disable Auto-Creation
Disable Auto-Creation
Stop automatic sorteo generation:Effect:
- Cron job skips this loteria
- Sorteos must be created manually
- Useful for irregular or special draws
Partial Updates
rulesJson is merged with existing rules. Only specified fields are updated.times but preserves frequency, digits, reventadoConfig, etc.
Activity Logging
All updates are logged:Best Practices
Preview Before Seeding
After updating
drawSchedule, use Preview Schedule to verify changes.Test with Inactive
When making significant changes, set
isActive: false first to test without affecting vendedores.Related Endpoints
Get Loteria
View current configuration
Preview Schedule
See effect of schedule changes
Seed Sorteos
Generate sorteos with new rules
Activity Logs
View update history