Save your starting eleven and bench
const url = 'https://foxleague.ai/api/teams/lineup';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"lineup":[1],"substitutes":[1],"wallet_address":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://foxleague.ai/api/teams/lineup \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "lineup": [ 1 ], "substitutes": [ 1 ], "wallet_address": "example" }'Saves your 11 starters and 7 substitutes and answers the team. Send up to 7 substitutes: a shorter bench is filled from your other cards, strongest first, leaving out cards listed for sale or still in a transfer cooldown. Every card must be yours and not listed for sale.
Who: a signed-in player with a team.
Refusals:
Lineup must have exactly 11 players:lineupdoes not hold 11 nonces.Substitutes cannot exceed 7 players:substitutesholds more than 7 nonces.User not found: the wallet has no account.Team must have exactly 11 starters + 7 substitutes. You picked <n> sub(s) and have only <r> eligible reserve(s). Acquire <x> more NFT(s) to complete the bench.: you do not have enough cards for a full bench.Some players are not owned by you or are listed for sale: a card is not yours, is listed for sale or appears twice.Cooldown active for recently-transferred players: <name> (<time left>), ...: a card received from another wallet is still in its transfer cooldown. The time left reads like3d 4hor5h 12m.
A wallet without a team gets HTTP 404 with an empty body. If the lineup cannot be saved on our side, the answer is HTTP 500 with an empty body.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”The starting eleven and bench to save.
object
NFT nonces of the 11 starters.
NFT nonces of up to 7 substitutes. A shorter bench is filled from your other cards.
Your wallet address. The body needs it, but the session decides which team changes.
Example generated
{ "lineup": [ 1 ], "substitutes": [ 1 ], "wallet_address": "example"}Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.
The answer. Present when success is true.
object
The team badge, usually an ipfs:// address (some older teams carry an inline image); null when none.
The badge’s ipfs:// address; null when none.
The coach name; null when not set.
When the team was created (RFC 3339).
The saved formation.
Team id.
NFT nonces of the 11 starters, as an array. Empty until a lineup is saved.
Team name.
NFT nonces of the bench, as an array.
Average of the starters’ seven attributes; null until a lineup is saved.
The owner’s user id.
true when the team carries the verified mark.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
Example
{ "data": { "badge": "ipfs://bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly", "badge_ipfs_uri": "ipfs://bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly", "coach_name": "Ada Moraru", "created_at": "2026-09-16T08:02:44.517093Z", "formation": "4-3-3", "id": 398, "lineup": [ 1301, 1234, 1240, 1255, 1262, 1270, 1288, 1290, 1302, 1311, 1325 ], "name": "Fox Rovers", "substitutes": [ 1330, 1342, 1356, 1361, 1377, 1389, 1394 ], "team_overall": 47.25, "user_id": 412, "verified": false }, "success": true}No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.
Example
Session expired or invalidThe wallet has no team yet. The body is empty.
The lineup could not be saved on our side. The body is empty.