Skip to main content

GET /api/v1/loterias/:id

Retrieves detailed information about a specific loteria (lottery) by its UUID.

Authentication

Requires authentication. Available to all roles.

Path Parameters

id
string
required
UUID of the loteria to retrieve

Response

success
boolean
Indicates if the operation was successful
data
object
The loteria object with full details

Example Request

curl https://api.example.com/api/v1/loterias/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Lotto",
    "rulesJson": {
      "digits": 2,
      "drawSchedule": {
        "frequency": "diario",
        "times": ["12:55", "18:55"],
        "daysOfWeek": null
      },
      "reventadoConfig": {
        "enabled": true
      },
      "autoCreateSorteos": true
    },
    "isActive": true,
    "createdAt": "2025-03-03T10:00:00-06:00",
    "updatedAt": "2025-03-03T10:00:00-06:00"
  }
}

Error Responses

{
  "success": false,
  "error": "Lotería not found"
}

Understanding Configuration

The digits field determines the winning number format:
Times/Tiempos Lottery
  • Valid numbers: 00-99
  • Display format: “00” to “99”
  • Example: “42”, “07”
The drawSchedule defines when sorteos are auto-generated:
{
  "frequency": "diario",
  "times": ["12:55", "18:55"],
  "daysOfWeek": [1, 2, 3, 4, 5]
}
This creates sorteos:
  • Every weekday (Mon-Fri)
  • At 12:55 PM and 6:55 PM
  • In Costa Rica timezone
When reventadoConfig.enabled: true:
  • Sorteos inherit reventadoEnabled: true
  • Vendedores can sell REVENTADO bets
  • Evaluation can include extra multipliers
  • Additional payouts for REVENTADO winners
See Multipliers Guide for details.
The autoCreateSorteos flag controls automatic generation:
  • Sorteos created by cron job
  • Based on drawSchedule
  • Runs daily (configurable)
  • Idempotent (no duplicates)

Example Configurations

{
  "id": "loteria-uuid",
  "name": "Lotto",
  "rulesJson": {
    "digits": 2,
    "drawSchedule": {
      "frequency": "diario",
      "times": ["12:55", "18:55"]
    },
    "reventadoConfig": {
      "enabled": true
    },
    "autoCreateSorteos": true
  },
  "isActive": true
}

Use Cases

1

View Configuration

Retrieve loteria details to understand draw schedule and rules.
2

Verify Schedule

Check drawSchedule before using Preview Schedule.
3

Check REVENTADO

Verify if REVENTADO is enabled for this loteria.
4

Create Sorteos

Use configuration to manually create sorteos or seed them.

List Loterias

Get all loterias

Update Loteria

Modify configuration

Preview Schedule

See generated sorteos

Seed Sorteos

Generate sorteos from schedule

Build docs developers (and LLMs) love