Skip to content

Events

Endpoints for accessing sports events (matches).

List Events

Get a list of sports events/matches.

Endpoint

GET /api/auth/events

Query Parameters

  • tournament_id (optional) - Filter by tournament
  • team_id (optional) - Filter by team (home or away)
  • date (optional) - Filter by date (YYYY-MM-DD)
  • status (optional) - Filter by status (scheduled, live, finished)
  • page (optional) - Page number
  • per_page (optional) - Items per page (default: 20)

Response

json
{
  "data": [
    {
      "id": 1,
      "tournament_id": 1,
      "tournament": {
        "id": 1,
        "name": "Premier League",
        "logo": "https://cdn.example.com/tournaments/premier-league.png"
      },
      "home_team": {
        "id": 1,
        "name": "Manchester United",
        "logo": "https://cdn.example.com/teams/man-utd.png"
      },
      "away_team": {
        "id": 2,
        "name": "Liverpool",
        "logo": "https://cdn.example.com/teams/liverpool.png"
      },
      "start_time": "2024-01-15T15:00:00Z",
      "status": "scheduled",
      "venue": "Old Trafford",
      "home_score": null,
      "away_score": null,
      "chat_room_id": "!abc123:matrix.server",
      "predictions_count": 150
    },
    {
      "id": 2,
      "tournament_id": 1,
      "tournament": {
        "id": 1,
        "name": "Premier League"
      },
      "home_team": {
        "id": 3,
        "name": "Chelsea",
        "logo": "https://cdn.example.com/teams/chelsea.png"
      },
      "away_team": {
        "id": 4,
        "name": "Arsenal",
        "logo": "https://cdn.example.com/teams/arsenal.png"
      },
      "start_time": "2024-01-14T20:00:00Z",
      "status": "finished",
      "venue": "Stamford Bridge",
      "home_score": 2,
      "away_score": 1,
      "chat_room_id": "!def456:matrix.server",
      "predictions_count": 200
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 10,
    "per_page": 20,
    "total": 200
  }
}

Notes

  • Events are sorted by start_time (upcoming first)
  • Live events appear at the top
  • Each event has an associated Matrix chat room