{
  "openapi": "3.0.3",
  "info": {
    "title": "Derbi client API",
    "version": "1.0.0",
    "description": "A read-only REST API with the standings, fixtures, results, top scorers and every team's page of any league with its public site switched on. JSON and iCal, computed on the spot."
  },
  "servers": [
    {
      "url": "https://derbiapp.com/client-api/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Demo key: dk_demo_derbi_client_api_v1"
      }
    },
    "schemas": {
      "LeagueView": {
        "type": "object",
        "required": [
          "league",
          "teams",
          "standings",
          "matches",
          "scorers",
          "live"
        ],
        "properties": {
          "league": {
            "$ref": "#/components/schemas/League",
            "description": "The league."
          },
          "teams": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Team"
            },
            "description": "Every team, by name."
          },
          "standings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Standing"
            },
            "description": "The standings, by position."
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Match"
            },
            "description": "Every match, by round and kick-off."
          },
          "scorers": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Scorer"
            },
            "description": "Top scorers; null when the league doesn't publish players."
          },
          "live": {
            "type": "boolean",
            "description": "A match is being played right now."
          }
        }
      },
      "League": {
        "type": "object",
        "required": [
          "name",
          "season",
          "sport",
          "rounds",
          "currentRound",
          "championSlots",
          "playoffSlots",
          "columns",
          "scoreUnit",
          "players",
          "brand"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "League name."
          },
          "group": {
            "type": "string",
            "description": "Group or division."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "season": {
            "type": "string",
            "description": "Season (\"2026/27\")."
          },
          "sport": {
            "type": "string",
            "enum": [
              "futsal",
              "football7",
              "football11",
              "basketball"
            ],
            "description": "Sport."
          },
          "rounds": {
            "type": "integer",
            "description": "Total rounds."
          },
          "currentRound": {
            "type": "integer",
            "description": "Current round."
          },
          "championSlots": {
            "type": "integer",
            "description": "Champion positions (1..n)."
          },
          "playoffSlots": {
            "type": "integer",
            "description": "Play-off positions after the champion ones."
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The sport's standings columns, in order."
          },
          "scoreUnit": {
            "type": "string",
            "enum": [
              "goals",
              "points"
            ],
            "description": "Score unit: goals or points."
          },
          "players": {
            "type": "boolean",
            "description": "Whether the league publishes player names."
          },
          "brand": {
            "$ref": "#/components/schemas/Brand",
            "description": "The look the organiser chose for the site."
          }
        }
      },
      "Brand": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "dark",
              "light"
            ],
            "description": "Theme: dark or light."
          },
          "color": {
            "type": "string",
            "description": "Main colour (hex)."
          },
          "logoUrl": {
            "type": "string",
            "description": "URL of the league's logo."
          },
          "coverUrl": {
            "type": "string",
            "description": "URL of the cover image."
          },
          "intro": {
            "type": "string",
            "description": "Presentation text (up to 280 characters)."
          }
        }
      },
      "Team": {
        "type": "object",
        "required": [
          "id",
          "name",
          "short",
          "color"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "short": {
            "type": "string",
            "description": "3-letter short name."
          },
          "color": {
            "type": "string",
            "description": "Main colour (hex)."
          },
          "homeVenue": {
            "type": "string",
            "description": "Usual ground or hall."
          },
          "kit": {
            "type": "object",
            "description": "Kit colours, per piece (hex)."
          },
          "crest": {
            "type": "object",
            "description": "Crest colours (hex)."
          }
        }
      },
      "Standing": {
        "type": "object",
        "required": [
          "pos",
          "teamId",
          "played",
          "won",
          "drawn",
          "lost",
          "for",
          "against",
          "diff",
          "points",
          "zone",
          "form"
        ],
        "properties": {
          "pos": {
            "type": "integer",
            "description": "Position."
          },
          "teamId": {
            "type": "string",
            "description": "Team."
          },
          "played": {
            "type": "integer",
            "description": "Played."
          },
          "won": {
            "type": "integer",
            "description": "Won."
          },
          "drawn": {
            "type": "integer",
            "description": "Drawn (always 0 in basketball)."
          },
          "lost": {
            "type": "integer",
            "description": "Lost."
          },
          "for": {
            "type": "integer",
            "description": "Goals or points scored."
          },
          "against": {
            "type": "integer",
            "description": "Goals or points conceded."
          },
          "diff": {
            "type": "integer",
            "description": "Difference."
          },
          "points": {
            "type": "integer",
            "description": "Table points."
          },
          "zone": {
            "type": "string",
            "enum": [
              "champion",
              "playoff"
            ],
            "nullable": true,
            "description": "Zone: champion, play-off or none."
          },
          "form": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "W",
                "D",
                "L"
              ]
            },
            "description": "Last 5 results, most recent last."
          }
        }
      },
      "Match": {
        "type": "object",
        "required": [
          "id",
          "round",
          "homeId",
          "awayId",
          "startsAt",
          "venue",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier."
          },
          "round": {
            "type": "integer",
            "description": "Round."
          },
          "homeId": {
            "type": "string",
            "description": "Home team."
          },
          "awayId": {
            "type": "string",
            "description": "Away team."
          },
          "startsAt": {
            "type": "integer",
            "nullable": true,
            "description": "Kick-off in UTC milliseconds; null while the date is pending."
          },
          "venue": {
            "type": "string",
            "description": "Ground or hall."
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "live",
              "pending_result",
              "finished",
              "postponed",
              "suspended_rain"
            ],
            "description": "Status: scheduled, live, pending result, finished, postponed or suspended for rain."
          },
          "homeScore": {
            "type": "integer",
            "description": "Home score, once started."
          },
          "awayScore": {
            "type": "integer",
            "description": "Away score, once started."
          },
          "outcome": {
            "type": "object",
            "description": "When it wasn't fully played: kind (walkover, abandoned…) and the side at fault."
          }
        }
      },
      "Scorer": {
        "type": "object",
        "required": [
          "pos",
          "playerId",
          "teamId",
          "name",
          "value",
          "matches"
        ],
        "properties": {
          "pos": {
            "type": "integer",
            "description": "Position."
          },
          "playerId": {
            "type": "string",
            "description": "Player."
          },
          "teamId": {
            "type": "string",
            "description": "Team."
          },
          "name": {
            "type": "string",
            "description": "Name (full, or first name and initial, as the league chose)."
          },
          "value": {
            "type": "integer",
            "description": "Goals or points."
          },
          "matches": {
            "type": "integer",
            "description": "Matches played."
          }
        }
      },
      "TeamView": {
        "type": "object",
        "required": [
          "team",
          "standing",
          "matches",
          "players"
        ],
        "properties": {
          "team": {
            "$ref": "#/components/schemas/Team",
            "description": "The team."
          },
          "standing": {
            "$ref": "#/components/schemas/Standing",
            "nullable": true,
            "description": "Its standings row."
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Match"
            },
            "description": "Its matches."
          },
          "players": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Player"
            },
            "description": "Squad by number; null when the league doesn't publish players."
          }
        }
      },
      "Player": {
        "type": "object",
        "required": [
          "id",
          "name",
          "number",
          "position"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "number": {
            "type": "integer",
            "description": "Shirt number."
          },
          "position": {
            "type": "string",
            "description": "Position (the sport's identifier)."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message",
          "docs"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "key",
              "billing",
              "league",
              "not_found",
              "rate"
            ],
            "description": "Error code."
          },
          "message": {
            "type": "string",
            "description": "Explanation, in English."
          },
          "docs": {
            "type": "string",
            "description": "Link to this page."
          }
        }
      }
    }
  },
  "paths": {
    "/leagues/{slug}": {
      "get": {
        "operationId": "league",
        "summary": "Whole league",
        "description": "League details, teams, standings, every match and the top scorers in one answer. The most useful call: one request is enough to draw a whole league site.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeagueView"
                },
                "example": {
                  "league": {
                    "name": "Lliga Demo Futbol 7",
                    "season": "2026/27",
                    "sport": "football7",
                    "rounds": 18,
                    "currentRound": 10,
                    "championSlots": 1,
                    "playoffSlots": 3,
                    "columns": [
                      "pos",
                      "team",
                      "played",
                      "won",
                      "drawn",
                      "lost",
                      "for",
                      "diff",
                      "points"
                    ],
                    "scoreUnit": "goals",
                    "players": true,
                    "brand": {
                      "mode": "dark",
                      "color": "#2f6fd6",
                      "intro": "La lliga de futbol 7 dels dissabtes al matí."
                    }
                  },
                  "teams": [
                    {
                      "id": "demo-futbol-7-sal",
                      "name": "CF Saltiró",
                      "short": "SAL",
                      "color": "#7B4FD6",
                      "homeVenue": "Camp del Saltiró"
                    },
                    {
                      "id": "demo-futbol-7-mon",
                      "name": "Club Montalt",
                      "short": "MON",
                      "color": "#D6458F",
                      "homeVenue": "Camp de Montalt"
                    },
                    {
                      "id": "demo-futbol-7-roc",
                      "name": "FC Rocafort",
                      "short": "ROC",
                      "color": "#1F9D55",
                      "homeVenue": "Camp Municipal Rocafort"
                    }
                  ],
                  "standings": [
                    {
                      "teamId": "demo-futbol-7-sal",
                      "played": 10,
                      "won": 5,
                      "drawn": 4,
                      "lost": 1,
                      "for": 19,
                      "against": 6,
                      "diff": 13,
                      "points": 19,
                      "form": [
                        "W",
                        "W",
                        "W",
                        "D",
                        "D"
                      ],
                      "pos": 1,
                      "zone": "champion"
                    },
                    {
                      "teamId": "demo-futbol-7-mon",
                      "played": 10,
                      "won": 4,
                      "drawn": 5,
                      "lost": 1,
                      "for": 10,
                      "against": 3,
                      "diff": 7,
                      "points": 17,
                      "form": [
                        "W",
                        "W",
                        "W",
                        "D",
                        "L"
                      ],
                      "pos": 2,
                      "zone": "playoff"
                    },
                    {
                      "teamId": "demo-futbol-7-roc",
                      "played": 10,
                      "won": 5,
                      "drawn": 1,
                      "lost": 4,
                      "for": 17,
                      "against": 11,
                      "diff": 6,
                      "points": 16,
                      "form": [
                        "W",
                        "L",
                        "W",
                        "W",
                        "W"
                      ],
                      "pos": 3,
                      "zone": "playoff"
                    }
                  ],
                  "matches": [
                    {
                      "id": "demo-futbol-7-j10-48",
                      "round": 10,
                      "homeId": "demo-futbol-7-vil",
                      "awayId": "demo-futbol-7-est",
                      "startsAt": 1792828800000,
                      "venue": "Camp de Vilanoveta",
                      "status": "finished",
                      "homeScore": 3,
                      "awayScore": 1
                    },
                    {
                      "id": "demo-futbol-7-j10-49",
                      "round": 10,
                      "homeId": "demo-futbol-7-can",
                      "awayId": "demo-futbol-7-sal",
                      "startsAt": 1792828800000,
                      "venue": "Camp de Canyet",
                      "status": "finished",
                      "homeScore": 1,
                      "awayScore": 1
                    },
                    {
                      "id": "demo-futbol-7-j11-50",
                      "round": 11,
                      "homeId": "demo-futbol-7-gav",
                      "awayId": "demo-futbol-7-bel",
                      "startsAt": 1793437200000,
                      "venue": "Camp de les Gavarres",
                      "status": "scheduled"
                    }
                  ],
                  "scorers": [
                    {
                      "pos": 1,
                      "playerId": "demo-futbol-7-sal-5",
                      "teamId": "demo-futbol-7-sal",
                      "name": "Roger Vilaró",
                      "value": 5,
                      "matches": 10
                    },
                    {
                      "pos": 2,
                      "playerId": "demo-futbol-7-vil-4",
                      "teamId": "demo-futbol-7-vil",
                      "name": "Arnau Xirau",
                      "value": 4,
                      "matches": 10
                    },
                    {
                      "pos": 3,
                      "playerId": "demo-futbol-7-bel-5",
                      "teamId": "demo-futbol-7-bel",
                      "name": "Eloi Gual",
                      "value": 4,
                      "matches": 10
                    }
                  ],
                  "live": false
                }
              }
            }
          },
          "401": {
            "description": "key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "billing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "league",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/leagues/{slug}/matches": {
      "get": {
        "operationId": "matches",
        "summary": "Matches",
        "description": "Every match of the season, by round and kick-off, with the teams to resolve their names. Matches not played yet carry no score.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "matches",
                    "teams"
                  ],
                  "properties": {
                    "matches": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Match"
                      }
                    },
                    "teams": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  }
                },
                "example": {
                  "matches": [
                    {
                      "id": "demo-futbol-7-j10-48",
                      "round": 10,
                      "homeId": "demo-futbol-7-vil",
                      "awayId": "demo-futbol-7-est",
                      "startsAt": 1792828800000,
                      "venue": "Camp de Vilanoveta",
                      "status": "finished",
                      "homeScore": 3,
                      "awayScore": 1
                    },
                    {
                      "id": "demo-futbol-7-j10-49",
                      "round": 10,
                      "homeId": "demo-futbol-7-can",
                      "awayId": "demo-futbol-7-sal",
                      "startsAt": 1792828800000,
                      "venue": "Camp de Canyet",
                      "status": "finished",
                      "homeScore": 1,
                      "awayScore": 1
                    },
                    {
                      "id": "demo-futbol-7-j11-50",
                      "round": 11,
                      "homeId": "demo-futbol-7-gav",
                      "awayId": "demo-futbol-7-bel",
                      "startsAt": 1793437200000,
                      "venue": "Camp de les Gavarres",
                      "status": "scheduled"
                    }
                  ],
                  "teams": [
                    {
                      "id": "demo-futbol-7-sal",
                      "name": "CF Saltiró",
                      "short": "SAL",
                      "color": "#7B4FD6",
                      "homeVenue": "Camp del Saltiró"
                    },
                    {
                      "id": "demo-futbol-7-mon",
                      "name": "Club Montalt",
                      "short": "MON",
                      "color": "#D6458F",
                      "homeVenue": "Camp de Montalt"
                    },
                    {
                      "id": "demo-futbol-7-roc",
                      "name": "FC Rocafort",
                      "short": "ROC",
                      "color": "#1F9D55",
                      "homeVenue": "Camp Municipal Rocafort"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "billing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "league",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/leagues/{slug}/scorers": {
      "get": {
        "operationId": "scorers",
        "summary": "Top scorers",
        "description": "The top scorers table (points in basketball). Returns 404 when the league chose not to publish player names.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "scorers",
                    "teams"
                  ],
                  "properties": {
                    "scorers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Scorer"
                      }
                    },
                    "teams": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  }
                },
                "example": {
                  "scorers": [
                    {
                      "pos": 1,
                      "playerId": "demo-futbol-7-sal-5",
                      "teamId": "demo-futbol-7-sal",
                      "name": "Roger Vilaró",
                      "value": 5,
                      "matches": 10
                    },
                    {
                      "pos": 2,
                      "playerId": "demo-futbol-7-vil-4",
                      "teamId": "demo-futbol-7-vil",
                      "name": "Arnau Xirau",
                      "value": 4,
                      "matches": 10
                    },
                    {
                      "pos": 3,
                      "playerId": "demo-futbol-7-bel-5",
                      "teamId": "demo-futbol-7-bel",
                      "name": "Eloi Gual",
                      "value": 4,
                      "matches": 10
                    }
                  ],
                  "teams": [
                    {
                      "id": "demo-futbol-7-sal",
                      "name": "CF Saltiró",
                      "short": "SAL",
                      "color": "#7B4FD6",
                      "homeVenue": "Camp del Saltiró"
                    },
                    {
                      "id": "demo-futbol-7-mon",
                      "name": "Club Montalt",
                      "short": "MON",
                      "color": "#D6458F",
                      "homeVenue": "Camp de Montalt"
                    },
                    {
                      "id": "demo-futbol-7-roc",
                      "name": "FC Rocafort",
                      "short": "ROC",
                      "color": "#1F9D55",
                      "homeVenue": "Camp Municipal Rocafort"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "billing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "league",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/leagues/{slug}/teams/{teamId}": {
      "get": {
        "operationId": "team",
        "summary": "Team page",
        "description": "One team: its details, its standings row, its matches and its squad (when the league publishes players).",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7"
          },
          {
            "name": "teamId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7-sal"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamView"
                },
                "example": {
                  "team": {
                    "id": "demo-futbol-7-sal",
                    "name": "CF Saltiró",
                    "short": "SAL",
                    "color": "#7B4FD6",
                    "homeVenue": "Camp del Saltiró"
                  },
                  "standing": {
                    "teamId": "demo-futbol-7-sal",
                    "played": 10,
                    "won": 5,
                    "drawn": 4,
                    "lost": 1,
                    "for": 19,
                    "against": 6,
                    "diff": 13,
                    "points": 19,
                    "form": [
                      "W",
                      "W",
                      "W",
                      "D",
                      "D"
                    ],
                    "pos": 1,
                    "zone": "champion"
                  },
                  "matches": [
                    {
                      "id": "demo-futbol-7-j1-4",
                      "round": 1,
                      "homeId": "demo-futbol-7-sal",
                      "awayId": "demo-futbol-7-can",
                      "startsAt": 1787385600000,
                      "venue": "Camp del Saltiró",
                      "status": "finished",
                      "homeScore": 1,
                      "awayScore": 1
                    },
                    {
                      "id": "demo-futbol-7-j2-9",
                      "round": 2,
                      "homeId": "demo-futbol-7-vil",
                      "awayId": "demo-futbol-7-sal",
                      "startsAt": 1787990400000,
                      "venue": "Camp de Vilanoveta",
                      "status": "finished",
                      "homeScore": 1,
                      "awayScore": 5
                    }
                  ],
                  "players": [
                    {
                      "id": "demo-futbol-7-sal-1",
                      "name": "Jofre Pagès",
                      "number": 1,
                      "position": "goalkeeper"
                    },
                    {
                      "id": "demo-futbol-7-sal-5",
                      "name": "Roger Vilaró",
                      "number": 5,
                      "position": "forward"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "billing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "league",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/leagues/{slug}/calendar.ics": {
      "get": {
        "operationId": "ics",
        "summary": "iCal fixtures",
        "description": "Dated matches as iCalendar, to subscribe to from Google Calendar, Apple Calendar or Outlook. With ?team= only one team's.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7"
          },
          {
            "name": "team",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "demo-futbol-7-sal"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string"
                },
                "example": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Derbi//Lliga//CA\r\nX-WR-CALNAME:Lliga Demo Futbol 7\r\nBEGIN:VEVENT\r\nUID:demo-futbol-7-j11-50@demo-futbol-7.derbi\r\nDTSTART:20261107T090000Z\r\nDTEND:20261107T101500Z\r\nSUMMARY:CE Gavarres - Penya Bellavista\r\nLOCATION:Camp de les Gavarres\r\nDESCRIPTION:Lliga Demo Futbol 7 · J11\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"
              }
            }
          },
          "401": {
            "description": "key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "billing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "league",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}