HTTP endpoints
One page for every option
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 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), the SignalR hub at /api/hub, and the React app.
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) |
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) |
GET /api/account/export | Signed in | Everything stored about the signed-in user, as a JSON file (DataExport/). (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) |
POST /api/account/external-logins/link-ticket | Signed in | See ExternalLinkTickets. (LinkedLoginsEndpoints.cs) |
GET /api/account/external-logins | Signed in | (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) |
PUT /api/account/passkeys/{id} | Signed in | (PasskeyAccountEndpoints.cs) |
POST /api/account/passkeys/options | Signed in | (PasskeyAccountEndpoints.cs) |
GET /api/account/passkeys | Signed in | (PasskeyAccountEndpoints.cs) |
POST /api/account/passkeys | Signed in | (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) |
DELETE /api/account/picture | Signed in | (PictureEndpoints.cs) |
PUT /api/account/picture | Signed in | (PictureEndpoints.cs) |
GET /api/account/preferences | Signed in | (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) |
PUT /api/account/profile | Signed in | (UpdateProfileEndpoint.cs) |
DELETE /api/account/sessions/{id} | Signed in | (SessionEndpoints.cs) |
POST /api/account/sessions/sign-out-others | Signed in | "Sign out everywhere else": every session but this one. (SessionEndpoints.cs) |
GET /api/account/sessions | Signed in | (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) |
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) |
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) |
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) |
POST /api/account/two-factor/recovery-codes | Signed in | New recovery codes, which replace the old ones (used or not). (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) |
GET /api/account/two-factor | Signed in | (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) |
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) |
With accounts
Admin
| Endpoint | Who | Notes |
|---|---|---|
GET /api/admin/audit | Admins | (IAuditLog.cs) |
With organisations GET /api/admin/dashboard | Admins | (AdminDashboardEndpoint.cs) |
POST /api/admin/failed-messages/discard | Admins | (FailedMessageEndpoints.cs) |
POST /api/admin/failed-messages/replay | Admins | Sends the messages to their handlers again. (FailedMessageEndpoints.cs) |
GET /api/admin/failed-messages | Admins | (FailedMessageEndpoints.cs) |
With organisations PUT /api/admin/features/{feature} | Admins | (AdminFeatureEndpoints.cs) |
With organisations GET /api/admin/features | Admins | (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) |
With organisations 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) |
With organisations PUT /api/admin/organisations/{id}/notes | Admins | (AdminOrganisationEndpoints.cs) |
With organisations 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) |
With organisations POST /api/admin/organisations/{id}/unsuspend | Admins | (AdminOrganisationEndpoints.cs) |
With organisations DELETE /api/admin/organisations/{id} | Admins | Deletes it for everyone, with its data, as its owner can; its subscription is cancelled. (AdminOrganisationEndpoints.cs) |
With organisations GET /api/admin/organisations/{id} | Admins | (AdminOrganisationEndpoints.cs) |
With organisations GET /api/admin/organisations | Admins | (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) |
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) |
With organisations GET /api/admin/users/{id}/organisations | Admins | A user's organisations, for the back office's users list. (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) |
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) |
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) |
POST /api/admin/users/{id}/unlock | Admins | Lifts any lockout: an admin's, or one from failed logins. (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) |
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) |
POST /api/auth/confirm-email | Anyone | Opened from the link in the email sent on registration (the client's /confirm-email page). (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) |
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) |
POST /api/auth/login | Anyone | (LoginEndpoint.cs) |
POST /api/auth/logout | Anyone | (LogoutEndpoint.cs) |
GET /api/auth/options | Anyone | (AuthOptionsEndpoint.cs) |
POST /api/auth/passkey/login | Anyone | (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) |
POST /api/auth/refresh | Anyone | (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) |
POST /api/auth/resend-confirmation | Anyone | Always answers 202, so it can't be used to find out who is registered. (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) |
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) |
With organisations
Billing
| Endpoint | Who | Notes |
|---|---|---|
POST /api/billing/checkout | Signed in | (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) |
POST /api/billing/portal | Signed in | Changing plan, payment details or cancelling, and seeing invoices. (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) |
GET /api/billing | Signed in | (BillingEndpoints.cs) |
Consent
| Endpoint | Who | Notes |
|---|---|---|
GET /api/consent/options | Anyone | (ConsentOptionsEndpoint.cs) |
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) |
DELETE /api/organisation/api-keys/{id} | Signed in | Revoking deletes the key: requests with it fail at once. (ApiKeyEndpoints.cs) |
GET /api/organisation/api-keys | Signed in | (ApiKeyEndpoints.cs) |
POST /api/organisation/api-keys | Signed in | (ApiKeyEndpoints.cs) |
DELETE /api/organisation/secrets/{name} | Signed in | (SecretEndpoints.cs) |
PUT /api/organisation/secrets/{name} | Signed in | (SecretEndpoints.cs) |
GET /api/organisation/secrets | Signed in | (SecretEndpoints.cs) |
GET /api/organisation/webhooks/{id}/deliveries | Signed in | (WebhookEndpoints.cs) |
GET /api/organisation/webhooks/{id}/secret | Signed in | (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) |
DELETE /api/organisation/webhooks/{id} | Signed in | (WebhookEndpoints.cs) |
PUT /api/organisation/webhooks/{id} | Signed in | (WebhookEndpoints.cs) |
POST /api/organisation/webhooks/deliveries/{deliveryId}/resend | Signed in | (WebhookEndpoints.cs) |
GET /api/organisation/webhooks/events | Signed in | (WebhookEndpoints.cs) |
GET /api/organisation/webhooks | Signed in | (WebhookEndpoints.cs) |
POST /api/organisation/webhooks | Signed in | (WebhookEndpoints.cs) |
Legal
| Endpoint | Who | Notes |
|---|---|---|
GET /api/legal/options | Anyone | (LegalOptionsEndpoint.cs) |
With accounts
Notifications
| Endpoint | Who | Notes |
|---|---|---|
GET /api/account/email-preferences | Signed in | (NotificationEndpoints.cs) |
PUT /api/account/email-preferences | Signed in | (NotificationEndpoints.cs) |
POST /api/notifications/{id}/read | Signed in | (NotificationEndpoints.cs) |
POST /api/notifications/read-all | Signed in | (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) |
GET /api/notifications | Signed in | (NotificationEndpoints.cs) |
With organisations
Organisations
| Endpoint | Who | Notes |
|---|---|---|
POST /api/join/details | Anyone | (JoinOrganisationEndpoints.cs) |
POST /api/join/register | Anyone | Creates the account, joins, and signs in: the session starts in the organisation. (JoinOrganisationEndpoints.cs) |
POST /api/join | Signed in | Then switch to the organisation (POST /api/organisations/switch) to work in it. (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) |
DELETE /api/organisation/invitations/{id} | Signed in | (InvitationEndpoints.cs) |
GET /api/organisation/invitations | Signed in | (InvitationEndpoints.cs) |
POST /api/organisation/invitations | Signed in | (InvitationEndpoints.cs) |
DELETE /api/organisation/logo | Signed in | (OrganisationLogoEndpoints.cs) |
PUT /api/organisation/logo | Signed in | (OrganisationLogoEndpoints.cs) |
PUT /api/organisation/members/{userId}/role | Signed in | (CurrentOrganisationEndpoints.cs) |
DELETE /api/organisation/members/{userId} | Signed in | Removes a member, or (for your own user id) leaves the organisation. (CurrentOrganisationEndpoints.cs) |
GET /api/organisation/members | Signed in | (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) |
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) |
GET /api/organisation | Signed in | (CurrentOrganisationEndpoints.cs) |
PUT /api/organisation | Signed in | (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) |
GET /api/organisations | Signed in | (OrganisationsEndpoints.cs) |
POST /api/organisations | Signed in | The creator becomes its owner. Switch to it to work in it. (OrganisationsEndpoints.cs) |
Todos
| Endpoint | Who | Notes |
|---|---|---|
Without accounts DELETE /api/todos/{id}/attachments/{attachmentId} | Anyone | Removes the attachment; its file is deleted once that's saved. (TodoAttachmentEndpoints.cs) |
With accounts DELETE /api/todos/{id}/attachments/{attachmentId} | Signed in | Removes the attachment; its file is deleted once that's saved. (TodoAttachmentEndpoints.cs) |
Without accounts GET /api/todos/{id}/attachments/{attachmentId} | Anyone | A short-lived URL the browser downloads the file from, saved under its name. (TodoAttachmentEndpoints.cs) |
With accounts GET /api/todos/{id}/attachments/{attachmentId} | Signed in | A short-lived URL the browser downloads the file from, saved under its name. (TodoAttachmentEndpoints.cs) |
Without accounts 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) |
With accounts 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) |
Without accounts POST /api/todos/{id}/attachments | Anyone | Step 3: the file is up. Check it, then add it to the Todo. (TodoAttachmentEndpoints.cs) |
With accounts POST /api/todos/{id}/attachments | Signed in | Step 3: the file is up. Check it, then add it to the Todo. (TodoAttachmentEndpoints.cs) |
Marten, without accounts 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) |
Marten, with accounts, without organisations 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) |
Marten, with organisations 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) |
EF Core, without accounts POST /api/todos/{id}/complete | Anyone | (CompleteTodoEndpoint.cs) |
EF Core, with accounts POST /api/todos/{id}/complete | Signed in | (CompleteTodoEndpoint.cs) |
Without accounts 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) |
With accounts, without organisations 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) |
With organisations POST /api/todos/{id}/remind | Signed in | Each reminder uses one of the plan's reminders for the month (PlanLimits.Reminders). (RemindTodoEndpoint.cs) |
Marten, without accounts GET /api/todos | Anyone | Reads the Todo documents that the inline snapshot projection keeps up to date. (GetTodosEndpoint.cs) |
Marten, with accounts, without organisations GET /api/todos | Signed in | Reads the Todo documents that the inline snapshot projection keeps up to date. (GetTodosEndpoint.cs) |
Marten, with organisations 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) |
EF Core, without accounts GET /api/todos | Anyone | (GetTodosEndpoint.cs) |
EF Core, with accounts, without organisations GET /api/todos | Signed in | (GetTodosEndpoint.cs) |
EF Core, with organisations GET /api/todos | Signed in | The organisation's Todos: the DbContext only sees the request's organisation. (GetTodosEndpoint.cs) |
Marten, without accounts 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) |
Marten, with accounts, without organisations 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) |
Marten, with organisations POST /api/todos | Signed in | The stream belongs to the request's organisation: Wolverine opens the session for it. (CreateTodoEndpoint.cs) |
EF Core, without accounts POST /api/todos | Anyone | (CreateTodoEndpoint.cs) |
EF Core, with accounts POST /api/todos | Signed in | (CreateTodoEndpoint.cs) |
With organisations
Integrations/Webhooks
| Endpoint | Who | Notes |
|---|---|---|
POST /api/webhooks/incoming/{source} | Anyone | (IncomingWebhooks.cs) |