Skip to content

HTTP endpoints ​

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), the SignalR hub at /api/hub, and the React app.

With accounts

Account ​

EndpointWhoNotes
PUT /api/account/consentSigned inSaves 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/deleteSigned inPermanently 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/exportSigned inEverything stored about the signed-in user, as a JSON file (DataExport/). (ExportDataEndpoint.cs)
DELETE /api/account/external-logins/{provider}Signed inRefused if it's the only way left to sign in (see SignInMethods). Emailed, like linking one. (LinkedLoginsEndpoints.cs)
POST /api/account/external-logins/link-ticketSigned inSee ExternalLinkTickets. (LinkedLoginsEndpoints.cs)
GET /api/account/external-loginsSigned in(LinkedLoginsEndpoints.cs)
DELETE /api/account/passkeys/{id}Signed inRefused 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/optionsSigned in(PasskeyAccountEndpoints.cs)
GET /api/account/passkeysSigned in(PasskeyAccountEndpoints.cs)
POST /api/account/passkeysSigned in(PasskeyAccountEndpoints.cs)
POST /api/account/passwordSigned inChanging 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/pictureSigned in(PictureEndpoints.cs)
PUT /api/account/pictureSigned in(PictureEndpoints.cs)
GET /api/account/preferencesSigned in(PreferenceEndpoints.cs)
PUT /api/account/product-newsSigned inProduct news on or off (Settings → Preferences), with when they chose, as a record of their consent. (PreferenceEndpoints.cs)
PUT /api/account/profileSigned in(UpdateProfileEndpoint.cs)
DELETE /api/account/sessions/{id}Signed in(SessionEndpoints.cs)
POST /api/account/sessions/sign-out-othersSigned in"Sign out everywhere else": every session but this one. (SessionEndpoints.cs)
GET /api/account/sessionsSigned in(SessionEndpoints.cs)
PUT /api/account/termsSigned inRecords 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/themeSigned inLight, 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/disableSigned inWith a code from the app or a recovery code. Forgets the key and the recovery codes. (TwoFactorEndpoints.cs)
POST /api/account/two-factor/enableSigned inFinishes the setup with a code from the app, and returns the recovery codes (shown once). (TwoFactorEndpoints.cs)
POST /api/account/two-factor/recovery-codesSigned inNew recovery codes, which replace the old ones (used or not). (TwoFactorEndpoints.cs)
POST /api/account/two-factor/setupSigned inA new key for the authenticator app; replaces any key from an unfinished setup. (TwoFactorEndpoints.cs)
GET /api/account/two-factorSigned in(TwoFactorEndpoints.cs)
POST /api/auth/confirm-email-changeAnyoneOpened 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/meSigned inRead 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 ​

EndpointWhoNotes
GET /api/admin/auditAdmins(IAuditLog.cs)
With organisations GET /api/admin/dashboardAdmins(AdminDashboardEndpoint.cs)
POST /api/admin/failed-messages/discardAdmins(FailedMessageEndpoints.cs)
POST /api/admin/failed-messages/replayAdminsSends the messages to their handlers again. (FailedMessageEndpoints.cs)
GET /api/admin/failed-messagesAdmins(FailedMessageEndpoints.cs)
With organisations PUT /api/admin/features/{feature}Admins(AdminFeatureEndpoints.cs)
With organisations GET /api/admin/featuresAdmins(AdminFeatureEndpoints.cs)
POST /api/admin/invitationsAdminsCreates 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}/grantAdminsPuts 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}/notesAdmins(AdminOrganisationEndpoints.cs)
With organisations POST /api/admin/organisations/{id}/suspendAdminsNobody 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}/unsuspendAdmins(AdminOrganisationEndpoints.cs)
With organisations DELETE /api/admin/organisations/{id}AdminsDeletes 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/organisationsAdmins(AdminOrganisationEndpoints.cs)
POST /api/admin/users/{id}/end-sessionsAdminsSigns 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}/lockAdminsLocks 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}/organisationsAdminsA user's organisations, for the back office's users list. (AdminOrganisationEndpoints.cs)
POST /api/admin/users/{id}/resend-confirmationAdminsEmails a new confirmation link to someone who hasn't confirmed their email yet. (ManageUserEndpoints.cs)
PUT /api/admin/users/{id}/rolesAdminsReplaces 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-factorAdminsFor 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}/unlockAdminsLifts any lockout: an admin's, or one from failed logins. (ManageUserEndpoints.cs)
GET /api/admin/usersAdminsUsers ordered by email, optionally filtered by part of the email. Page numbers start at 1. (ListUsersEndpoint.cs)

With accounts

Auth ​

EndpointWhoNotes
POST /api/auth/accept-invitationAnyoneOpened 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-emailAnyoneOpened from the link in the email sent on registration (the client's /confirm-email page). (ConfirmEmailEndpoint.cs)
GET /api/auth/external/{provider}Anyonelink: a ticket from the link-ticket endpoint, to link the provider to that signed-in account. (ExternalLoginEndpoints.cs)
POST /api/auth/forgot-passwordAnyoneAlways 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/loginAnyone(LoginEndpoint.cs)
POST /api/auth/logoutAnyone(LogoutEndpoint.cs)
GET /api/auth/optionsAnyone(AuthOptionsEndpoint.cs)
POST /api/auth/passkey/loginAnyone(PasskeyLoginEndpoints.cs)
POST /api/auth/passkey/optionsAnyoneNo 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/refreshAnyone(RefreshEndpoint.cs)
POST /api/auth/registerAnyoneCreates 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-confirmationAnyoneAlways answers 202, so it can't be used to find out who is registered. (ConfirmEmailEndpoint.cs)
POST /api/auth/reset-passwordAnyoneSets 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-factorAnyoneThe 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 ​

EndpointWhoNotes
POST /api/billing/checkoutSigned in(PaymentEndpoints.cs)
GET /api/billing/plansAnyoneThe 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/portalSigned inChanging plan, payment details or cancelling, and seeing invoices. (PaymentEndpoints.cs)
POST /api/billing/webhooks/{provider}AnyoneThe 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/billingSigned in(BillingEndpoints.cs)
EndpointWhoNotes
GET /api/consent/optionsAnyone(ConsentOptionsEndpoint.cs)

With organisations

Integrations ​

EndpointWhoNotes
POST /api/organisation/api-keys/{id}/rotateSigned inA 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 inRevoking deletes the key: requests with it fail at once. (ApiKeyEndpoints.cs)
GET /api/organisation/api-keysSigned in(ApiKeyEndpoints.cs)
POST /api/organisation/api-keysSigned in(ApiKeyEndpoints.cs)
DELETE /api/organisation/secrets/{name}Signed in(SecretEndpoints.cs)
PUT /api/organisation/secrets/{name}Signed in(SecretEndpoints.cs)
GET /api/organisation/secretsSigned in(SecretEndpoints.cs)
GET /api/organisation/webhooks/{id}/deliveriesSigned in(WebhookEndpoints.cs)
GET /api/organisation/webhooks/{id}/secretSigned in(WebhookEndpoints.cs)
POST /api/organisation/webhooks/{id}/testSigned inSends 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}/resendSigned in(WebhookEndpoints.cs)
GET /api/organisation/webhooks/eventsSigned in(WebhookEndpoints.cs)
GET /api/organisation/webhooksSigned in(WebhookEndpoints.cs)
POST /api/organisation/webhooksSigned in(WebhookEndpoints.cs)
EndpointWhoNotes
GET /api/legal/optionsAnyone(LegalOptionsEndpoint.cs)

With accounts

Notifications ​

EndpointWhoNotes
GET /api/account/email-preferencesSigned in(NotificationEndpoints.cs)
PUT /api/account/email-preferencesSigned in(NotificationEndpoints.cs)
POST /api/notifications/{id}/readSigned in(NotificationEndpoints.cs)
POST /api/notifications/read-allSigned in(NotificationEndpoints.cs)
POST /api/notifications/unsubscribeAnyoneThe 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/notificationsSigned in(NotificationEndpoints.cs)

With organisations

Organisations ​

EndpointWhoNotes
POST /api/join/detailsAnyone(JoinOrganisationEndpoints.cs)
POST /api/join/registerAnyoneCreates the account, joins, and signs in: the session starts in the organisation. (JoinOrganisationEndpoints.cs)
POST /api/joinSigned inThen switch to the organisation (POST /api/organisations/switch) to work in it. (JoinOrganisationEndpoints.cs)
GET /api/organisation/exportSigned inEverything 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/invitationsSigned in(InvitationEndpoints.cs)
POST /api/organisation/invitationsSigned in(InvitationEndpoints.cs)
DELETE /api/organisation/logoSigned in(OrganisationLogoEndpoints.cs)
PUT /api/organisation/logoSigned in(OrganisationLogoEndpoints.cs)
PUT /api/organisation/members/{userId}/roleSigned in(CurrentOrganisationEndpoints.cs)
DELETE /api/organisation/members/{userId}Signed inRemoves a member, or (for your own user id) leaves the organisation. (CurrentOrganisationEndpoints.cs)
GET /api/organisation/membersSigned in(CurrentOrganisationEndpoints.cs)
PUT /api/organisation/two-factorSigned inOwners 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/organisationSigned inDeletes 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/organisationSigned in(CurrentOrganisationEndpoints.cs)
PUT /api/organisationSigned in(CurrentOrganisationEndpoints.cs)
POST /api/organisations/switchSigned inNew 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/organisationsSigned in(OrganisationsEndpoints.cs)
POST /api/organisationsSigned inThe creator becomes its owner. Switch to it to work in it. (OrganisationsEndpoints.cs)

Todos ​

EndpointWhoNotes
Without accounts DELETE /api/todos/{id}/attachments/{attachmentId}AnyoneRemoves the attachment; its file is deleted once that's saved. (TodoAttachmentEndpoints.cs)
With accounts DELETE /api/todos/{id}/attachments/{attachmentId}Signed inRemoves the attachment; its file is deleted once that's saved. (TodoAttachmentEndpoints.cs)
Without accounts GET /api/todos/{id}/attachments/{attachmentId}AnyoneA short-lived URL the browser downloads the file from, saved under its name. (TodoAttachmentEndpoints.cs)
With accounts GET /api/todos/{id}/attachments/{attachmentId}Signed inA short-lived URL the browser downloads the file from, saved under its name. (TodoAttachmentEndpoints.cs)
Without accounts POST /api/todos/{id}/attachments/uploadsAnyoneStep 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/uploadsSigned inStep 1: room for the file? Then a signed upload URL, and a token to finish with. (TodoAttachmentEndpoints.cs)
Without accounts POST /api/todos/{id}/attachmentsAnyoneStep 3: the file is up. Check it, then add it to the Todo. (TodoAttachmentEndpoints.cs)
With accounts POST /api/todos/{id}/attachmentsSigned inStep 3: the file is up. Check it, then add it to the Todo. (TodoAttachmentEndpoints.cs)
Marten, without accounts POST /api/todos/{id}/completeAnyoneAggregate 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}/completeSigned inAggregate 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}/completeSigned inAggregate 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}/completeAnyone(CompleteTodoEndpoint.cs)
EF Core, with accounts POST /api/todos/{id}/completeSigned in(CompleteTodoEndpoint.cs)
Without accounts POST /api/todos/{id}/remindAnyoneSchedules 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}/remindSigned inSchedules 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}/remindSigned inEach reminder uses one of the plan's reminders for the month (PlanLimits.Reminders). (RemindTodoEndpoint.cs)
Marten, without accounts GET /api/todosAnyoneReads the Todo documents that the inline snapshot projection keeps up to date. (GetTodosEndpoint.cs)
Marten, with accounts, without organisations GET /api/todosSigned inReads the Todo documents that the inline snapshot projection keeps up to date. (GetTodosEndpoint.cs)
Marten, with organisations GET /api/todosSigned inReads 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/todosAnyone(GetTodosEndpoint.cs)
EF Core, with accounts, without organisations GET /api/todosSigned in(GetTodosEndpoint.cs)
EF Core, with organisations GET /api/todosSigned inThe organisation's Todos: the DbContext only sees the request's organisation. (GetTodosEndpoint.cs)
Marten, without accounts POST /api/todosAnyoneEvent 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/todosSigned inEvent 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/todosSigned inThe stream belongs to the request's organisation: Wolverine opens the session for it. (CreateTodoEndpoint.cs)
EF Core, without accounts POST /api/todosAnyone(CreateTodoEndpoint.cs)
EF Core, with accounts POST /api/todosSigned in(CreateTodoEndpoint.cs)

With organisations

Integrations/Webhooks ​

EndpointWhoNotes
POST /api/webhooks/incoming/{source}Anyone(IncomingWebhooks.cs)

Documentation for v0.10.1. Released under the MIT licence.