# LawFive API > LawFive is for soccer referees: it keeps their matches, match reports, venues and the officials they work with. Integrations reach a person's own data on the hosted service or a self-hosted server, using an API key they make in Settings. Start with the overview, then fetch only the pages the job needs. Every page is Markdown. ## Start here - [Overview](https://lawfive.dev/agents/overview.md): the address, API keys, errors and what's on each page. - [The data model](https://lawfive.dev/agents/data-model.md): the records and every type they're made of. ## Worked examples - [Keep a copy up to date](https://lawfive.dev/agents/guide-keep-in-sync.md): Follow every change with `GET /v1/changes`, deletions included, without missing any. The key needs read access to each collection you want; the others are left out. - [Read matches with their venues and officials](https://lawfive.dev/agents/guide-read-matches.md): List someone's upcoming matches, with the names a match only refers to by id. The key needs `matches:read`, `venues:read` and `referees:read`. - [Receive changes as they happen](https://lawfive.dev/agents/guide-receive-webhooks.md): Check that a webhook delivery is really from LawFive, then act on it once. The person makes the webhook in the website's Settings → Webhooks, chooses its topics and gets its `whsec_...` secret once. - [Save a record safely](https://lawfive.dev/agents/guide-save-a-record.md): Create, change and delete a match without overwriting a change made elsewhere, such as on the person's watch. The key needs `matches:read` and `matches:write`. ## API reference, for integrations - [Server](https://lawfive.dev/agents/server.md): What the server is and offers. - [Records](https://lawfive.dev/agents/records.md): The user's records, one collection per kind. - [Tracks](https://lawfive.dev/agents/tracks.md): GPS and heart rate for a match report, in LawFive's own format whatever recorded them: convert from the source (RefSix, an activity file, a phone's health store) before uploading. - [Sync](https://lawfive.dev/agents/sync.md): Everything that changed since a device last looked. - [Import](https://lawfive.dev/agents/import.md): Adding and updating matches from a spreadsheet, CSV or JSON file. - [Stats](https://lawfive.dev/agents/stats.md): Reports on the user's games, worked out by the server so every app shows the same. - [Places](https://lawfive.dev/agents/places.md): Address search for placing venues on the map. - [Weather](https://lawfive.dev/agents/weather.md): Forecasts for the user's matches, and the weather finished matches were played in. ## API reference, not open to API keys - [Accounts](https://lawfive.dev/agents/accounts.md): Signing up, in and out (Better Auth's endpoints). - [Linking a watch](https://lawfive.dev/agents/linking-a-watch.md): A watch links to an account with a code (RFC 8628): it asks for a code and shows it, someone signed in enters it on the web app's Link page and approves it, and the watch, polling meanwhile, gets its own token. - [People](https://lawfive.dev/agents/people.md): Admins see everyone on the server, approve or decline new accounts, make other admins, and make password reset links, suspend and delete accounts, and change who can sign up; and make plans, named sets of limits, and put each account in one. - [App sign-in](https://lawfive.dev/agents/app-sign-in.md): Signing in on a phone with a code the web app shows, as a QR code or in letters, instead of typing a password. - [Invitations](https://lawfive.dev/agents/invitations.md): Links that let someone make an account even when sign-up is closed. - [Assignor calendars](https://lawfive.dev/agents/assignor-calendars.md): An assignor system's private calendar link (ArbiterSports, Assignr, HorizonWebRef, RefTown and others give each official one), which the server reads every 30 minutes into the account's matches through the import: new games added, moved ones changed, ones gone before kickoff canceled. - [Calendar](https://lawfive.dev/agents/calendar.md): A private calendar feed of the user's matches, for calendar apps to subscribe to. - [Devices](https://lawfive.dev/agents/devices.md): Where the account is signed in. - [Attachments](https://lawfive.dev/agents/attachments.md): Photos on matches, venues and referees, kept by the server on its disk or in S3-compatible storage. - [Export](https://lawfive.dev/agents/export.md): Everything in the account as one zip, and restoring one into an account, for backups and moving between servers. - [Sharing](https://lawfive.dev/agents/sharing.md): A match's share link: an address nobody can guess that shows the match, its log and its track to anyone who has it, without signing in. - [Webhooks](https://lawfive.dev/agents/webhooks.md): URLs that hear about changes to the account's records: matches, match reports, venues, referees, competitions and templates, however they were made (the web app, the API, a watch, an import). - [API keys](https://lawfive.dev/agents/api-keys.md): Keys for scripts and integrations, made in the web app's Settings. - [Watch](https://lawfive.dev/agents/watch.md): What a Garmin watch uses, shaped for its little memory: matches in the form it starts one from, and finished matches as it saved them. - [Quiz](https://lawfive.dev/agents/quiz.md): The Laws of the Game quiz's questions. ## Optional - [OpenAPI 3.1](https://lawfive.dev/openapi.json): the whole API for generating clients or loading into tools, about 600 KB. A server's own copy, matching its version, is at `/v1/openapi.json`. - [JSON Schema for a match](https://lawfive.dev/schemas/Match.json): one file per type, at `/schemas/.json`.