Developers

API Reference

The xiflow REST API lets you build, manage, and share lineups programmatically.

Last updated · July 3, 2026

Coming soon

The public API ships with the backend. The contract below is the target we're building against — endpoints, shapes, and errors may change before release. Follow the changelog for the announcement.

Overview

The API is RESTful and returns JSON. All write and read endpoints for private resources require authentication. Public shared lineups can be fetched without a token.

Base URL: https://api.xiflow.app/v1 Content-Type: application/json

Authentication

Authenticated requests carry a bearer token in the Authorization header:

Authorization: Bearer <token>

Auth endpoints

MethodPathDescription
POST/api/auth/registerRegister a new user
POST/api/auth/loginLog in and receive a token
GET/api/auth/userGet the current user profile
POST/api/auth/logoutInvalidate the current session

Lineups

A lineup describes a formation and the players assigned to each slot. The caller may only read, update, and delete their own lineups.

MethodPathDescription
GET/api/lineupsList the caller's lineups
GET/api/lineups/:idGet a single lineup
POST/api/lineupsCreate a lineup
PUT/api/lineups/:idUpdate a lineup
DELETE/api/lineups/:idDelete a lineup
POST/api/lineups/:id/duplicateDuplicate a lineup

A lineup payload includes the formation id, a name, and a players map of slot id to player:

{ "id": "ln_1abc", "name": "Away vs City", "formation": "4-3-3", "players": { "lw": { "name": "...", "role": "FWD", "rating": 85 }, // ... } }

Teams

Teams group players under a club or squad so lineups can be built from a known roster.

MethodPathDescription
GET/api/teamsList the caller's teams
POST/api/teamsCreate a team
GET/api/teams/:idGet a team
PUT/api/teams/:idUpdate a team
DELETE/api/teams/:idDelete a team

Sharing

Sharing exposes a lineup publicly via a short access code. The shared resource is read-only.

MethodPathDescription
POST/api/share/lineups/:idCreate a share link
GET/api/share/:accessCodeFetch a shared lineup
DELETE/api/share/:shareIdRevoke a share link

Errors

Errors return a JSON body with an errorfield describing what went wrong.

StatusNameMeaning
400Bad requestMissing or invalid fields
401UnauthorizedMissing or invalid token
403ForbiddenNot the owner of this resource
404Not foundThe resource does not exist
429Rate limitedToo many requests, slow down
500Server errorSomething broke on our side