---
url: /saas-starter/v0.10.1/guide/reference/endpoints.md
---

# HTTP endpoints

::: tip What this page covers
Every choice of `--Persistence`, `--Auth`, `--IncludeTests` and `--Aspire`: a label says
which options a part is for. The copy in your app's `docs/` folder has only the parts for yours.
`ApiHost` stands for your app's name.
:::

Every endpoint of ApiHost's API, by the folder its code is in. "Signed in" endpoints need an
access token (`Authorization: Bearer ...`); "Admins" need the Admin role. Request and response
bodies are in the OpenAPI document (`/openapi/v1.json`), which the API reference at
`/scalar` shows, both in Development. The app also serves `/health/live` and `/health/ready`
([observability](../observability.md)), the SignalR hub at `/api/hub`, and the React app.

::: info With accounts

## Account

| Endpoint | Who | Notes |
|---|---|---|
| `PUT /api/account/consent` | Signed in | Saves their cookie choices, as a record of what they agreed to and so other devices they sign in on don't ask again. The browser keeps them in a cookie as well (the client's features/consent), which is all a visitor who isn't signed in has. ([PreferenceEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PreferenceEndpoints.cs)) |
| `POST /api/account/delete` | Signed in | Permanently deletes the account. The password (and a code, with two-factor on) is required again, so a stolen access token alone can't delete it. The user's data in other features is deleted by their AccountDeleted handlers. ([DeleteAccountEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/DeleteAccountEndpoint.cs)) |
| `GET /api/account/export` | Signed in | Everything stored about the signed-in user, as a JSON file (DataExport/). ([ExportDataEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/ExportDataEndpoint.cs)) |
| `DELETE /api/account/external-logins/{provider}` | Signed in | Refused if it's the only way left to sign in (see SignInMethods). Emailed, like linking one. ([LinkedLoginsEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/LinkedLoginsEndpoints.cs)) |
| `POST /api/account/external-logins/link-ticket` | Signed in | See ExternalLinkTickets. ([LinkedLoginsEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/LinkedLoginsEndpoints.cs)) |
| `GET /api/account/external-logins` | Signed in |  ([LinkedLoginsEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/LinkedLoginsEndpoints.cs)) |
| `DELETE /api/account/passkeys/{id}` | Signed in | Refused if it's the only way left to sign in (see SignInMethods). Emailed, like adding one: someone else in the account could remove the owner's passkey. ([PasskeyAccountEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PasskeyAccountEndpoints.cs)) |
| `PUT /api/account/passkeys/{id}` | Signed in |  ([PasskeyAccountEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PasskeyAccountEndpoints.cs)) |
| `POST /api/account/passkeys/options` | Signed in |  ([PasskeyAccountEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PasskeyAccountEndpoints.cs)) |
| `GET /api/account/passkeys` | Signed in |  ([PasskeyAccountEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PasskeyAccountEndpoints.cs)) |
| `POST /api/account/passkeys` | Signed in |  ([PasskeyAccountEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PasskeyAccountEndpoints.cs)) |
| `POST /api/account/password` | Signed in | Changing the password signs out every other session (all refresh tokens are revoked) and returns new tokens, so the session that made the change stays signed in. ([ChangePasswordEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/ChangePasswordEndpoint.cs)) |
| `DELETE /api/account/picture` | Signed in |  ([PictureEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PictureEndpoints.cs)) |
| `PUT /api/account/picture` | Signed in |  ([PictureEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PictureEndpoints.cs)) |
| `GET /api/account/preferences` | Signed in |  ([PreferenceEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PreferenceEndpoints.cs)) |
| `PUT /api/account/product-news` | Signed in | Product news on or off (Settings → Preferences), with when they chose, as a record of their consent. ([PreferenceEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PreferenceEndpoints.cs)) |
| `PUT /api/account/profile` | Signed in |  ([UpdateProfileEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/UpdateProfileEndpoint.cs)) |
| `DELETE /api/account/sessions/{id}` | Signed in |  ([SessionEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/SessionEndpoints.cs)) |
| `POST /api/account/sessions/sign-out-others` | Signed in | "Sign out everywhere else": every session but this one. ([SessionEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/SessionEndpoints.cs)) |
| `GET /api/account/sessions` | Signed in |  ([SessionEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/SessionEndpoints.cs)) |
| `PUT /api/account/terms` | Signed in | Records that they accepted the current terms and privacy policy (Legal/LegalOptions.cs): people who signed up with Google or GitHub, were invited, or accepted an older version are asked after signing in. ([PreferenceEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PreferenceEndpoints.cs)) |
| `PUT /api/account/theme` | Signed in | Light, dark, or the device's setting. The browser keeps it too, so pages show it before the app has loaded (the client's lib/theme.ts). ([PreferenceEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/PreferenceEndpoints.cs)) |
| `POST /api/account/two-factor/disable` | Signed in | With a code from the app or a recovery code. Forgets the key and the recovery codes. ([TwoFactorEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/TwoFactorEndpoints.cs)) |
| `POST /api/account/two-factor/enable` | Signed in | Finishes the setup with a code from the app, and returns the recovery codes (shown once). ([TwoFactorEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/TwoFactorEndpoints.cs)) |
| `POST /api/account/two-factor/recovery-codes` | Signed in | New recovery codes, which replace the old ones (used or not). ([TwoFactorEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/TwoFactorEndpoints.cs)) |
| `POST /api/account/two-factor/setup` | Signed in | A new key for the authenticator app; replaces any key from an unfinished setup. ([TwoFactorEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/TwoFactorEndpoints.cs)) |
| `GET /api/account/two-factor` | Signed in |  ([TwoFactorEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/TwoFactorEndpoints.cs)) |
| `POST /api/auth/confirm-email-change` | Anyone | Opened from the link sent to the new address when a user changes their email in Settings (the client's /confirm-email-change page). Needs no login: the token proves the request. ([ConfirmEmailChangeEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/ConfirmEmailChangeEndpoint.cs)) |
| `GET /api/auth/me` | Signed in | Read from the database rather than the token's claims, so a changed email, display name or role shows straight away. ([MeEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Account/MeEndpoint.cs)) |
:::

::: info With accounts

## Admin

| Endpoint | Who | Notes |
|---|---|---|
| `GET /api/admin/audit` | Admins |  ([IAuditLog.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/IAuditLog.cs)) |
|  `GET /api/admin/dashboard` | Admins |  ([AdminDashboardEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminDashboardEndpoint.cs)) |
| `POST /api/admin/failed-messages/discard` | Admins |  ([FailedMessageEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/FailedMessageEndpoints.cs)) |
| `POST /api/admin/failed-messages/replay` | Admins | Sends the messages to their handlers again. ([FailedMessageEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/FailedMessageEndpoints.cs)) |
| `GET /api/admin/failed-messages` | Admins |  ([FailedMessageEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/FailedMessageEndpoints.cs)) |
|  `PUT /api/admin/features/{feature}` | Admins |  ([AdminFeatureEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminFeatureEndpoints.cs)) |
|  `GET /api/admin/features` | Admins |  ([AdminFeatureEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminFeatureEndpoints.cs)) |
| `POST /api/admin/invitations` | Admins | Creates an account with no password and emails the person a link to choose one (see AcceptInvitationEndpoint). Inviting someone whose invitation is still pending sends it again. Works whether or not open registration is on (Accounts:AllowRegistration). ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
|  `POST /api/admin/organisations/{id}/grant` | Admins | Puts the organisation on a plan until a date, free of charge: to extend a trial, or to give a customer a plan. Not for an organisation that's subscribed: change that in the provider. ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
|  `PUT /api/admin/organisations/{id}/notes` | Admins |  ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
|  `POST /api/admin/organisations/{id}/suspend` | Admins | Nobody can work in a suspended organisation (OrganisationSetup checks every request); its members' sessions move to their other organisations. Nothing is deleted. ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
|  `POST /api/admin/organisations/{id}/unsuspend` | Admins |  ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
|  `DELETE /api/admin/organisations/{id}` | Admins | Deletes it for everyone, with its data, as its owner can; its subscription is cancelled. ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
|  `GET /api/admin/organisations/{id}` | Admins |  ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
|  `GET /api/admin/organisations` | Admins |  ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
| `POST /api/admin/users/{id}/end-sessions` | Admins | Signs the user out everywhere: their refresh tokens are revoked, so each session ends when its access token expires (within Jwt:AccessTokenLifetimeMinutes). For a lost device, or a suspected stolen password (with a password reset). ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
| `POST /api/admin/users/{id}/lock` | Admins | Locks the account until an admin unlocks it, and ends its sessions: refresh tokens are revoked now, and access tokens expire within their lifetime (Jwt:AccessTokenLifetimeMinutes). ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
|  `GET /api/admin/users/{id}/organisations` | Admins | A user's organisations, for the back office's users list. ([AdminOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/AdminOrganisationEndpoints.cs)) |
| `POST /api/admin/users/{id}/resend-confirmation` | Admins | Emails a new confirmation link to someone who hasn't confirmed their email yet. ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
| `PUT /api/admin/users/{id}/roles` | Admins | Replaces the user's roles. The new roles are in their access token from their next login or token refresh (within Jwt:AccessTokenLifetimeMinutes). ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
| `POST /api/admin/users/{id}/turn-off-two-factor` | Admins | For someone who lost both their authenticator app and their recovery codes: turns two-factor authentication off, so they can sign in with their password (or Google/GitHub) and set it up again. Check it's really them first, through some other channel. ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
| `POST /api/admin/users/{id}/unlock` | Admins | Lifts any lockout: an admin's, or one from failed logins. ([ManageUserEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ManageUserEndpoints.cs)) |
| `GET /api/admin/users` | Admins | Users ordered by email, optionally filtered by part of the email. Page numbers start at 1. ([ListUsersEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Admin/ListUsersEndpoint.Marten.cs)) |
:::

::: info With accounts

## Auth

| Endpoint | Who | Notes |
|---|---|---|
| `POST /api/auth/accept-invitation` | Anyone | Opened from the invitation email (the client's /accept-invitation page): sets the password of the account the admin created, confirms its email (the link proves the person owns it), and signs them in. ([AcceptInvitationEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/AcceptInvitationEndpoint.cs)) |
| `POST /api/auth/confirm-email` | Anyone | Opened from the link in the email sent on registration (the client's /confirm-email page). ([ConfirmEmailEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/ConfirmEmailEndpoint.cs)) |
| `GET /api/auth/external/{provider}` | Anyone | link: a ticket from the link-ticket endpoint, to link the provider to that signed-in account. ([ExternalLoginEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/ExternalLoginEndpoints.cs)) |
| `POST /api/auth/forgot-password` | Anyone | Always answers 202, whether or not the email has an account, so the endpoint can't be used to find out who is registered. If it does, emails a link to the client's /reset-password page carrying a one-time token (valid for an hour; see TokenProviders). ([ForgotPasswordEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/ForgotPasswordEndpoint.cs)) |
| `POST /api/auth/login` | Anyone |  ([LoginEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/LoginEndpoint.cs)) |
| `POST /api/auth/logout` | Anyone |  ([LogoutEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/LogoutEndpoint.cs)) |
| `GET /api/auth/options` | Anyone |  ([AuthOptionsEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/AuthOptionsEndpoint.cs)) |
| `POST /api/auth/passkey/login` | Anyone |  ([PasskeyLoginEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/PasskeyLoginEndpoints.cs)) |
| `POST /api/auth/passkey/options` | Anyone | No user is named: the browser offers the passkeys it has for this site (discoverable credentials), so the person doesn't type their email. ([PasskeyLoginEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/PasskeyLoginEndpoints.cs)) |
| `POST /api/auth/refresh` | Anyone |  ([RefreshEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/RefreshEndpoint.cs)) |
| `POST /api/auth/register` | Anyone | Creates the account and emails a confirmation link; login is refused until it's opened (SignIn.RequireConfirmedEmail, see IdentityJwtSetup). With Accounts:AllowRegistration set to false, only invited people get accounts, and this answers 403. ([RegisterEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/RegisterEndpoint.cs)) |
| `POST /api/auth/resend-confirmation` | Anyone | Always answers 202, so it can't be used to find out who is registered. ([ConfirmEmailEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/ConfirmEmailEndpoint.cs)) |
| `POST /api/auth/reset-password` | Anyone | Sets a new password using the token from the reset email, and signs out every session. Opening the emailed link proves the user owns the address, so it also confirms the email (someone who lost the confirmation email can get in this way) and lifts a lockout from failed logins. ([ResetPasswordEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/ResetPasswordEndpoint.cs)) |
| `POST /api/auth/two-factor` | Anyone | The second step of signing in with two-factor authentication on (Identity/TwoFactor.cs). A wrong code counts towards a lockout, like a wrong password. ([TwoFactorLoginEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Auth/TwoFactorLoginEndpoint.cs)) |
:::

::: info With organisations

## Billing

| Endpoint | Who | Notes |
|---|---|---|
| `POST /api/billing/checkout` | Signed in |  ([PaymentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Billing/PaymentEndpoints.cs)) |
| `GET /api/billing/plans` | Anyone | The plans on offer, for the pricing page. Public: the pricing page is for visitors. The pricing page is pre-rendered from a copy (src/Client/src/features/billing/plans.json), which a test keeps the same as this (docs/billing.md). ([BillingEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Billing/BillingEndpoints.cs)) |
| `POST /api/billing/portal` | Signed in | Changing plan, payment details or cancelling, and seeing invoices. ([PaymentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Billing/PaymentEndpoints.cs)) |
| `POST /api/billing/webhooks/{provider}` | Anyone | The payment provider's webhook: checks the signature, stores the event and answers at once; PaymentEventHandler does the work from a durable queue. Anyone can call it, so a request without a valid signature is refused. ([PaymentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Billing/PaymentEndpoints.cs)) |
| `GET /api/billing` | Signed in |  ([BillingEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Billing/BillingEndpoints.cs)) |
:::

## Consent

| Endpoint | Who | Notes |
|---|---|---|
| `GET /api/consent/options` | Anyone |  ([ConsentOptionsEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Consent/ConsentOptionsEndpoint.cs)) |

::: info With organisations

## Integrations

| Endpoint | Who | Notes |
|---|---|---|
| `POST /api/organisation/api-keys/{id}/rotate` | Signed in | A new key with the same name and scope. The old one keeps working for ApiKeyOptions.RotationGracePeriod, so programs can switch over, then expires. ([ApiKeyEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/ApiKeyEndpoints.cs)) |
| `DELETE /api/organisation/api-keys/{id}` | Signed in | Revoking deletes the key: requests with it fail at once. ([ApiKeyEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/ApiKeyEndpoints.cs)) |
| `GET /api/organisation/api-keys` | Signed in |  ([ApiKeyEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/ApiKeyEndpoints.cs)) |
| `POST /api/organisation/api-keys` | Signed in |  ([ApiKeyEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/ApiKeyEndpoints.cs)) |
| `DELETE /api/organisation/secrets/{name}` | Signed in |  ([SecretEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/SecretEndpoints.cs)) |
| `PUT /api/organisation/secrets/{name}` | Signed in |  ([SecretEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/SecretEndpoints.cs)) |
| `GET /api/organisation/secrets` | Signed in |  ([SecretEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/SecretEndpoints.cs)) |
| `GET /api/organisation/webhooks/{id}/deliveries` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `GET /api/organisation/webhooks/{id}/secret` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `POST /api/organisation/webhooks/{id}/test` | Signed in | Sends a "webhook.test" event to this webhook only, to check the receiver. ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `DELETE /api/organisation/webhooks/{id}` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `PUT /api/organisation/webhooks/{id}` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `POST /api/organisation/webhooks/deliveries/{deliveryId}/resend` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `GET /api/organisation/webhooks/events` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `GET /api/organisation/webhooks` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
| `POST /api/organisation/webhooks` | Signed in |  ([WebhookEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Integrations/WebhookEndpoints.cs)) |
:::

## Legal

| Endpoint | Who | Notes |
|---|---|---|
| `GET /api/legal/options` | Anyone |  ([LegalOptionsEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Legal/LegalOptionsEndpoint.cs)) |

::: info With accounts

## Notifications

| Endpoint | Who | Notes |
|---|---|---|
| `GET /api/account/email-preferences` | Signed in |  ([NotificationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Notifications/NotificationEndpoints.cs)) |
| `PUT /api/account/email-preferences` | Signed in |  ([NotificationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Notifications/NotificationEndpoints.cs)) |
| `POST /api/notifications/{id}/read` | Signed in |  ([NotificationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Notifications/NotificationEndpoints.cs)) |
| `POST /api/notifications/read-all` | Signed in |  ([NotificationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Notifications/NotificationEndpoints.cs)) |
| `POST /api/notifications/unsubscribe` | Anyone | The link in a notification email: needs no login. Mail apps' "Unsubscribe" button POSTs to it (RFC 8058, with a form body this ignores), and so does the /unsubscribe page. ([NotificationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Notifications/NotificationEndpoints.cs)) |
| `GET /api/notifications` | Signed in |  ([NotificationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Notifications/NotificationEndpoints.cs)) |
:::

::: info With organisations

## Organisations

| Endpoint | Who | Notes |
|---|---|---|
| `POST /api/join/details` | Anyone |  ([JoinOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/JoinOrganisationEndpoints.cs)) |
| `POST /api/join/register` | Anyone | Creates the account, joins, and signs in: the session starts in the organisation. ([JoinOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/JoinOrganisationEndpoints.cs)) |
| `POST /api/join` | Signed in | Then switch to the organisation (POST /api/organisations/switch) to work in it. ([JoinOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/JoinOrganisationEndpoints.cs)) |
| `GET /api/organisation/export` | Signed in | Everything stored for the current organisation, as a JSON file (DataExport/). Owners only: it includes every member's email address. ([ExportOrganisationEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/ExportOrganisationEndpoint.cs)) |
| `DELETE /api/organisation/invitations/{id}` | Signed in |  ([InvitationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/InvitationEndpoints.cs)) |
| `GET /api/organisation/invitations` | Signed in |  ([InvitationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/InvitationEndpoints.cs)) |
| `POST /api/organisation/invitations` | Signed in |  ([InvitationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/InvitationEndpoints.cs)) |
| `DELETE /api/organisation/logo` | Signed in |  ([OrganisationLogoEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/OrganisationLogoEndpoints.cs)) |
| `PUT /api/organisation/logo` | Signed in |  ([OrganisationLogoEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/OrganisationLogoEndpoints.cs)) |
| `PUT /api/organisation/members/{userId}/role` | Signed in |  ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `DELETE /api/organisation/members/{userId}` | Signed in | Removes a member, or (for your own user id) leaves the organisation. ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `GET /api/organisation/members` | Signed in |  ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `PUT /api/organisation/two-factor` | Signed in | Owners only. Members without two-factor authentication can't work in the organisation while it's on (their tokens stop working at once, and the switcher says why), so the owner turning it on must have it first. ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `DELETE /api/organisation` | Signed in | Deletes the organisation for everyone. Its data is deleted in the background by each feature's OrganisationDeleted handler, run for this organisation's tenant (the store publishes the message in the same transaction as the deletion). Members' tokens stop working at once; the browser then refreshes them into another organisation. ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `GET /api/organisation` | Signed in |  ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `PUT /api/organisation` | Signed in |  ([CurrentOrganisationEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/CurrentOrganisationEndpoints.cs)) |
| `POST /api/organisations/switch` | Signed in | New tokens for the same session, working in another of the user's organisations. The old refresh token is revoked, as when refreshing. ([OrganisationsEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/OrganisationsEndpoints.cs)) |
| `GET /api/organisations` | Signed in |  ([OrganisationsEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/OrganisationsEndpoints.cs)) |
| `POST /api/organisations` | Signed in | The creator becomes its owner. Switch to it to work in it. ([OrganisationsEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Organisations/OrganisationsEndpoints.cs)) |
:::

## Todos

| Endpoint | Who | Notes |
|---|---|---|
|  `DELETE /api/todos/{id}/attachments/{attachmentId}` | Anyone | Removes the attachment; its file is deleted once that's saved. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `DELETE /api/todos/{id}/attachments/{attachmentId}` | Signed in | Removes the attachment; its file is deleted once that's saved. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `GET /api/todos/{id}/attachments/{attachmentId}` | Anyone | A short-lived URL the browser downloads the file from, saved under its name. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `GET /api/todos/{id}/attachments/{attachmentId}` | Signed in | A short-lived URL the browser downloads the file from, saved under its name. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `POST /api/todos/{id}/attachments/uploads` | Anyone | Step 1: room for the file? Then a signed upload URL, and a token to finish with. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `POST /api/todos/{id}/attachments/uploads` | Signed in | Step 1: room for the file? Then a signed upload URL, and a token to finish with. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `POST /api/todos/{id}/attachments` | Anyone | Step 3: the file is up. Check it, then add it to the Todo. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `POST /api/todos/{id}/attachments` | Signed in | Step 3: the file is up. Check it, then add it to the Todo. ([TodoAttachmentEndpoints.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/TodoAttachmentEndpoints.Marten.cs)) |
|  `POST /api/todos/{id}/complete` | Anyone | Aggregate handler workflow: \[WriteAggregate] loads the Todo by replaying its event stream (the {id} route value is the stream id) and answers 404 if it doesn't exist. The method is a pure function that decides what happens: Wolverine appends the returned Events to the stream (with an optimistic concurrency check) and sends the OutgoingMessages through the outbox, all in one transaction. ([CompleteTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CompleteTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/complete` | Signed in | Aggregate handler workflow: \[WriteAggregate] loads the Todo by replaying its event stream (the {id} route value is the stream id) and answers 404 if it doesn't exist. The method is a pure function that decides what happens: Wolverine appends the returned Events to the stream (with an optimistic concurrency check) and sends the OutgoingMessages through the outbox, all in one transaction. ([CompleteTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CompleteTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/complete` | Signed in | Aggregate handler workflow: \[WriteAggregate] loads the Todo by replaying its event stream (the {id} route value is the stream id) and answers 404 if it doesn't exist. The method is a pure function that decides what happens: Wolverine appends the returned Events to the stream (with an optimistic concurrency check) and sends the OutgoingMessages through the outbox, all in one transaction. Wolverine loads the stream for the request's organisation only, so another organisation's Todo is a 404 like any missing one. ([CompleteTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CompleteTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/complete` | Anyone |  ([CompleteTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CompleteTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/complete` | Signed in |  ([CompleteTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CompleteTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/remind` | Anyone | Schedules a TodoReminderDue message. Local queues are durable (Program.cs), so scheduled messages are stored in PostgreSQL and still fire after a restart. ([RemindTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/RemindTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/remind` | Signed in | Schedules a TodoReminderDue message. Local queues are durable (Program.cs), so scheduled messages are stored in PostgreSQL and still fire after a restart. ([RemindTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/RemindTodoEndpoint.Marten.cs)) |
|  `POST /api/todos/{id}/remind` | Signed in | Each reminder uses one of the plan's reminders for the month (PlanLimits.Reminders). ([RemindTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/RemindTodoEndpoint.Marten.cs)) |
|  `GET /api/todos` | Anyone | Reads the Todo documents that the inline snapshot projection keeps up to date. ([GetTodosEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/GetTodosEndpoint.Marten.cs)) |
|  `GET /api/todos` | Signed in | Reads the Todo documents that the inline snapshot projection keeps up to date. ([GetTodosEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/GetTodosEndpoint.Marten.cs)) |
|  `GET /api/todos` | Signed in | Reads the Todo documents that the inline snapshot projection keeps up to date. The organisation's Todos: Wolverine's session only sees the request's organisation. ([GetTodosEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/GetTodosEndpoint.Marten.cs)) |
|  `GET /api/todos` | Anyone |  ([GetTodosEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/GetTodosEndpoint.Marten.cs)) |
|  `GET /api/todos` | Signed in |  ([GetTodosEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/GetTodosEndpoint.Marten.cs)) |
|  `GET /api/todos` | Signed in | The organisation's Todos: the DbContext only sees the request's organisation. ([GetTodosEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/GetTodosEndpoint.Marten.cs)) |
|  `POST /api/todos` | Anyone | Event sourcing: a new Todo is a new event stream that starts with TodoCreated. The inline snapshot projection (MartenPersistence) writes the Todo document that GET /api/todos reads, in the same transaction. The TodoChanged notification goes through the outbox, so open tabs only hear about the Todo once it is saved. ([CreateTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CreateTodoEndpoint.Marten.cs)) |
|  `POST /api/todos` | Signed in | Event sourcing: a new Todo is a new event stream that starts with TodoCreated. The inline snapshot projection (MartenPersistence) writes the Todo document that GET /api/todos reads, in the same transaction. The TodoChanged notification goes through the outbox, so open tabs only hear about the Todo once it is saved. ([CreateTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CreateTodoEndpoint.Marten.cs)) |
|  `POST /api/todos` | Signed in | The stream belongs to the request's organisation: Wolverine opens the session for it. ([CreateTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CreateTodoEndpoint.Marten.cs)) |
|  `POST /api/todos` | Anyone |  ([CreateTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CreateTodoEndpoint.Marten.cs)) |
|  `POST /api/todos` | Signed in |  ([CreateTodoEndpoint.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Features/Todos/CreateTodoEndpoint.Marten.cs)) |

::: info With organisations

## Integrations/Webhooks

| Endpoint | Who | Notes |
|---|---|---|
| `POST /api/webhooks/incoming/{source}` | Anyone |  ([IncomingWebhooks.cs](https://github.com/LibreSharp/saas-starter/blob/v0.10.1/src/ApiHost/Integrations/Webhooks/IncomingWebhooks.cs)) |
:::
