---
title: "Save one of my Fantacalcio squads"
method: PUT
path: "/v1/fantasy/fantacalcio/me/roster"
tags: ["fantasy"]
---

# Save one of my Fantacalcio squads

`PUT /v1/fantasy/fantacalcio/me/roster`

## Request

- Base URL: `https://api.predixsport.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.predixsport.com/v1/fantasy/fantacalcio/me/roster`
- Auth: none declared

Saves the 25 players you own in one team, as player codes, plus the Classic options your league changed, `substitution_mode` among them (traditional, hybrid or dynamic, hybrid when omitted). Every code is checked against this season's catalog and the ROLES come from that catalog, never from this request, which is what makes the 3 keepers, 8 defenders, 8 midfielders and 6 forwards check mean something. A code the catalog does not carry is refused with that code in the message rather than guessed at. Resolve names with GET /v1/fantasy/fantacalcio/players first. The save REPLACES that team's squad rather than adding to it, and it bumps a revision, which is how advice computed on the previous squad is marked stale. Saving one team never touches another. This changes Predixsport private state only. It never signs in to any fantasy platform and never changes your squad there. Requires mcp:read and fantasy:fantacalcio:write. The Fantacalcio workspace is in a private beta: this endpoint answers 403 for an account outside it.

## Headers

- `authorization` string, nullable

## Request body

- FantacalcioRosterWrite
  - `season` string, required
  - `team` integer, nullable: Team slot. Omitted saves the first one.
  - `team_name` string, required
  - `mode` 'classic': Only Classic is served. Mantra is not.
  - `roster` FantacalcioRosterEntry[], required: The 25 players you own, as player codes. Roles come from the season catalog, never from this request, and the squad must hold 3 keepers, 8 defenders, 8 midfielders and 6 forwards once those roles are applied.
    - `player_code` string, required
    - `credits` integer: What this player cost at the auction. 0 when unknown.
  - `league_rules` FantacalcioLeagueRules: The Classic options a league may change, all optional. An omitted field keeps the engine default. The field names mirror ``fantasy_solver/conf/fantacalcio.yml::league_overrides`` one for one and a drift test holds them to it.
    - `bonus_clean_sheet` number, nullable: Porta imbattuta: points the goalkeeper earns when he is fielded, gets a vote and his team concedes nothing. 0 (the default) means the league does not pay it, 1 is the value fantacalcio.it recommends. The forecast prices it as the bonus times the probability of a clean sheet, reported per player as clean_sheet_expected and never folded into a projected fantavoto.
    - `defence_enabled` boolean, nullable: Whether the league pays the defence modifier at all.
    - `defence_ladder` array[], nullable: Pairs of [average pure vote, points], thresholds increasing from 0 to 10 and values non-decreasing from -30 to 30. Every value, negative ones included, is added to your own score. A modifier your league charges to the opponent instead is not modelled.
      - number[]
    - `defence_include_keeper` boolean, nullable: Whether the goalkeeper's pure vote enters the modifier average. True (the default) averages the keeper and the best three defenders, false averages the best four defenders and ignores the keeper.
    - `defence_min_defenders` integer, nullable: Fielded defenders required before the modifier pays anything. Four is the Leghe Fantacalcio rule, so a three-defender formation earns nothing there. Three and five exist on other league managers.
    - `sv_value` number, nullable: Vote given to a fielded player who did not get one. Null is the default (he scores nothing after substitutions), 6.0 is a '6 politico' league.
    - `max_subs` integer, nullable: How many substitutions the league makes in a matchweek. Three is the Classic default, Leghe Fantacalcio leagues often run five.
    - `substitution_mode` 'traditional' | 'hybrid' | 'dynamic', nullable: How a starter who gets no vote is replaced. 'traditional': only a reserve of the same role enters, otherwise the slot stays empty. 'hybrid' (the default, the Leghe Fantacalcio 'Ibrido'): a reserve of the same role first, otherwise the first voted reserve in bench order that leaves one of the league's allowed formations, so a midfielder can replace a forward and 4-3-3 becomes 4-4-2. 'dynamic': bench order rules, the first voted reserve that leaves an allowed formation enters even when a same-role one sits lower. The goalkeeper is only ever replaced by a goalkeeper. On Leghe Fantacalcio it sits under league management, options, substitutions.
    - `bench_size` integer, nullable: Null means every non-starter sits on the bench, in order.
    - `modules` string[], nullable: The formations this league allows, e.g. ['3-4-3', '4-4-2']. The three outfield lines must add up to ten, and the list is enforced when a lineup is declared, not only when it is optimised.

## Response `200`

Successful Response

- FantacalcioSavedRoster
  - `season` string, required
  - `team` integer, required
  - `mode` string, required
  - `team_name` string, required
  - `status` string, required
  - `revision` integer, required
  - `updated_at` string, date-time, required
  - `roster` FantacalcioSavedPlayer[], required
    - `player_code` string, required
    - `role` 'P' | 'D' | 'C' | 'A', required
    - `name` string, required
    - `club` string, required: Club identifier, the join key of the module.
    - `club_name` string, required: The same club as a label.
    - `credits` integer, required
  - `league_rules` FantacalcioLeagueRules, required: The Classic options a league may change, all optional. An omitted field keeps the engine default. The field names mirror ``fantasy_solver/conf/fantacalcio.yml::league_overrides`` one for one and a drift test holds them to it.
    - `bonus_clean_sheet` number, nullable: Porta imbattuta: points the goalkeeper earns when he is fielded, gets a vote and his team concedes nothing. 0 (the default) means the league does not pay it, 1 is the value fantacalcio.it recommends. The forecast prices it as the bonus times the probability of a clean sheet, reported per player as clean_sheet_expected and never folded into a projected fantavoto.
    - `defence_enabled` boolean, nullable: Whether the league pays the defence modifier at all.
    - `defence_ladder` array[], nullable: Pairs of [average pure vote, points], thresholds increasing from 0 to 10 and values non-decreasing from -30 to 30. Every value, negative ones included, is added to your own score. A modifier your league charges to the opponent instead is not modelled.
      - number[]
    - `defence_include_keeper` boolean, nullable: Whether the goalkeeper's pure vote enters the modifier average. True (the default) averages the keeper and the best three defenders, false averages the best four defenders and ignores the keeper.
    - `defence_min_defenders` integer, nullable: Fielded defenders required before the modifier pays anything. Four is the Leghe Fantacalcio rule, so a three-defender formation earns nothing there. Three and five exist on other league managers.
    - `sv_value` number, nullable: Vote given to a fielded player who did not get one. Null is the default (he scores nothing after substitutions), 6.0 is a '6 politico' league.
    - `max_subs` integer, nullable: How many substitutions the league makes in a matchweek. Three is the Classic default, Leghe Fantacalcio leagues often run five.
    - `substitution_mode` 'traditional' | 'hybrid' | 'dynamic', nullable: How a starter who gets no vote is replaced. 'traditional': only a reserve of the same role enters, otherwise the slot stays empty. 'hybrid' (the default, the Leghe Fantacalcio 'Ibrido'): a reserve of the same role first, otherwise the first voted reserve in bench order that leaves one of the league's allowed formations, so a midfielder can replace a forward and 4-3-3 becomes 4-4-2. 'dynamic': bench order rules, the first voted reserve that leaves an allowed formation enters even when a same-role one sits lower. The goalkeeper is only ever replaced by a goalkeeper. On Leghe Fantacalcio it sits under league management, options, substitutions.
    - `bench_size` integer, nullable: Null means every non-starter sits on the bench, in order.
    - `modules` string[], nullable: The formations this league allows, e.g. ['3-4-3', '4-4-2']. The three outfield lines must add up to ten, and the list is enforced when a lineup is declared, not only when it is optimised.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/predixsport/apis/predixsport-api.md) · [All operations](https://skmtc.dev/predixsport/apis/predixsport-api/llms.txt) · [OpenAPI document](https://skmtc.dev/predixsport/apis/predixsport-api/revisions/02014aee733d?raw)
