# API reference

This is the API of the example multi-tenant app in [examples/full-multi](https://github.com/apistockhq/apistock/tree/main/examples/full-multi), rendered from its checked-in `openapi.json`. Every app you create with `aps new` serves the same reference for its own API at `/docs`, and `aps dev` serves the API at `http://127.0.0.1:8080`.

## Ops: audit

- [List audit events, newest first](/api-reference/ops-audit/ops-list-audit-events.md): `GET /ops/audit`
- [Count audit events](/api-reference/ops-audit/ops-audit-stats.md): `GET /ops/audit/stats`
- [Get an audit event](/api-reference/ops-audit/ops-get-audit-event.md): `GET /ops/audit/{id}`

## Ops: auth

- [List sign-in methods and what they need](/api-reference/ops-auth/ops-list-sign-in-methods.md): `GET /ops/auth/providers`

## Ops: job definitions

- [List job definitions](/api-reference/ops-job-definitions/ops-list-job-definitions.md): `GET /ops/jobs/definitions`
- [Get a job definition](/api-reference/ops-job-definitions/ops-get-job-definition.md): `GET /ops/jobs/definitions/{name}`
- [Change a job's configuration](/api-reference/ops-job-definitions/ops-update-job-definition.md): `PUT /ops/jobs/definitions/{name}`
- [Reset a job to its code defaults](/api-reference/ops-job-definitions/ops-reset-job-definition.md): `DELETE /ops/jobs/definitions/{name}`
- [List a job definition's changes](/api-reference/ops-job-definitions/ops-job-definition-history.md): `GET /ops/jobs/definitions/{name}/history`
- [Run a job now](/api-reference/ops-job-definitions/ops-run-job.md): `POST /ops/jobs/definitions/{name}/run`
- [List enabled scheduled jobs, soonest first](/api-reference/ops-job-definitions/ops-list-scheduled-jobs.md): `GET /ops/jobs/scheduled`

## Ops: job runs

- [Summarise job work](/api-reference/ops-job-runs/ops-jobs-overview.md): `GET /ops/jobs/overview`
- [List job runs, newest first](/api-reference/ops-job-runs/ops-list-job-runs.md): `GET /ops/jobs/runs`
- [Get a job run](/api-reference/ops-job-runs/ops-get-job-run.md): `GET /ops/jobs/runs/{id}`
- [Cancel a job run](/api-reference/ops-job-runs/ops-cancel-job-run.md): `POST /ops/jobs/runs/{id}/cancel`
- [Retry a job run now](/api-reference/ops-job-runs/ops-retry-job-run.md): `POST /ops/jobs/runs/{id}/retry`

## Ops: email

- [Show how the app sends email](/api-reference/ops-email/ops-get-mail.md): `GET /ops/mail`
- [Send a test email](/api-reference/ops-email/ops-send-test-email.md): `POST /ops/mail/test`

## Ops: job queues

- [List active job queues](/api-reference/ops-job-queues/ops-list-job-queues.md): `GET /ops/queues`
- [Pause a queue on every instance](/api-reference/ops-job-queues/ops-pause-job-queue.md): `POST /ops/queues/{name}/pause`
- [Resume a paused queue](/api-reference/ops-job-queues/ops-resume-job-queue.md): `POST /ops/queues/{name}/resume`

## Ops: releases

- [List releases, newest first](/api-reference/ops-releases/ops-list-releases.md): `GET /ops/releases`
- [List the releases running now](/api-reference/ops-releases/ops-current-releases.md): `GET /ops/releases/current`
- [List instance starts, newest first](/api-reference/ops-releases/ops-list-release-instances.md): `GET /ops/releases/instances`

## Ops: settings

- [List retention policies](/api-reference/ops-settings/ops-retention.md): `GET /ops/retention`
- [List runtime settings](/api-reference/ops-settings/ops-list-settings.md): `GET /ops/settings`
- [Get a runtime setting](/api-reference/ops-settings/ops-get-setting.md): `GET /ops/settings/{key}`
- [Change a runtime setting](/api-reference/ops-settings/ops-set-setting.md): `PUT /ops/settings/{key}`
- [Reset a runtime setting to its default](/api-reference/ops-settings/ops-reset-setting.md): `DELETE /ops/settings/{key}`
- [List a runtime setting's changes](/api-reference/ops-settings/ops-setting-history.md): `GET /ops/settings/{key}/history`

## Ops: system

- [Describe this instance](/api-reference/ops-system/ops-system.md): `GET /ops/system`

## Auth

- [Apple's return to the API](/api-reference/auth/auth-apple-callback.md): `POST /v1/auth/apple/callback`
- [Apple's server-to-server notifications](/api-reference/auth/auth-apple-notifications.md): `POST /v1/auth/apple/notifications`
- [Sign in with an Apple ID token](/api-reference/auth/auth-apple-token.md): `POST /v1/auth/apple/token`
- [Google's return to the API](/api-reference/auth/auth-google-callback.md): `GET /v1/auth/google/callback`
- [Sign in with a Google ID token](/api-reference/auth/auth-google-token.md): `POST /v1/auth/google/token`
- [List linked Google and Apple accounts](/api-reference/auth/auth-list-identities.md): `GET /v1/auth/identities`
- [Unlink a Google or Apple account](/api-reference/auth/auth-remove-identity.md): `DELETE /v1/auth/identities/{id}`
- [Sign in](/api-reference/auth/auth-login.md): `POST /v1/auth/login`
- [Finish signing in with a second factor](/api-reference/auth/auth-login-mfa.md): `POST /v1/auth/login/mfa`
- [Start a passkey second factor](/api-reference/auth/auth-login-mfa-passkey.md): `POST /v1/auth/login/mfa/passkey`
- [Sign out this device](/api-reference/auth/auth-logout.md): `POST /v1/auth/logout`
- [Sign out every device](/api-reference/auth/auth-logout-all.md): `POST /v1/auth/logout-all`
- [Get the signed-in user](/api-reference/auth/auth-me.md): `GET /v1/auth/me`
- [Delete the account](/api-reference/auth/auth-delete-account.md): `DELETE /v1/auth/me`
- [Replace the recovery codes](/api-reference/auth/auth-regenerate-recovery-codes.md): `POST /v1/auth/mfa/recovery-codes`
- [Start setting up an authenticator app](/api-reference/auth/auth-start-totp.md): `POST /v1/auth/mfa/totp`
- [Turn off the authenticator app](/api-reference/auth/auth-disable-totp.md): `DELETE /v1/auth/mfa/totp`
- [Turn on the authenticator app](/api-reference/auth/auth-confirm-totp.md): `POST /v1/auth/mfa/totp/confirm`
- [List passkeys](/api-reference/auth/auth-list-passkeys.md): `GET /v1/auth/passkeys`
- [Add a passkey](/api-reference/auth/auth-create-passkey.md): `POST /v1/auth/passkeys`
- [Sign in with a passkey](/api-reference/auth/auth-passkey-login.md): `POST /v1/auth/passkeys/login`
- [Start signing in with a passkey](/api-reference/auth/auth-passkey-login-options.md): `POST /v1/auth/passkeys/login/options`
- [Start adding a passkey](/api-reference/auth/auth-begin-passkey-registration.md): `POST /v1/auth/passkeys/registration`
- [Confirm a change with a passkey](/api-reference/auth/auth-begin-passkey-verification.md): `POST /v1/auth/passkeys/verification`
- [Rename a passkey](/api-reference/auth/auth-rename-passkey.md): `PATCH /v1/auth/passkeys/{id}`
- [Remove a passkey](/api-reference/auth/auth-remove-passkey.md): `DELETE /v1/auth/passkeys/{id}`
- [Change the password](/api-reference/auth/auth-change-password.md): `PUT /v1/auth/password`
- [Email a password reset code](/api-reference/auth/auth-forgot-password.md): `POST /v1/auth/password/forgot`
- [Set a new password with a reset code](/api-reference/auth/auth-reset-password.md): `POST /v1/auth/password/reset`
- [Create an account](/api-reference/auth/auth-register.md): `POST /v1/auth/register`
- [List signed-in devices](/api-reference/auth/auth-list-sessions.md): `GET /v1/auth/sessions`
- [Sign out one device](/api-reference/auth/auth-revoke-session.md): `DELETE /v1/auth/sessions/{id}`
- [Verify an email address with its code](/api-reference/auth/auth-verify-email.md): `POST /v1/auth/verify-email`
- [Send a new verification code](/api-reference/auth/auth-resend-verification.md): `POST /v1/auth/verify-email/resend`
- [Get a nonce for a native sign-in](/api-reference/auth/auth-social-nonce.md): `POST /v1/auth/{provider}/nonce`
- [Sign in with Google or Apple in a browser](/api-reference/auth/auth-start-social.md): `GET /v1/auth/{provider}/start`

## Example

- [Echo a message](/api-reference/example/echo.md): `POST /v1/echo`
- [Check the API is reachable](/api-reference/example/ping.md): `GET /v1/ping`

## Organisations

- [Accept an invitation](/api-reference/organisations/invitations-accept.md): `POST /v1/invitations/accept`
- [List your organisations](/api-reference/organisations/orgs-list.md): `GET /v1/orgs`
- [Create an organisation](/api-reference/organisations/orgs-create.md): `POST /v1/orgs`
- [Get an organisation](/api-reference/organisations/orgs-get.md): `GET /v1/orgs/{orgId}`
- [Rename an organisation](/api-reference/organisations/orgs-rename.md): `PATCH /v1/orgs/{orgId}`
- [Delete an organisation](/api-reference/organisations/orgs-delete.md): `DELETE /v1/orgs/{orgId}`
- [List open invitations](/api-reference/organisations/orgs-invitations-list.md): `GET /v1/orgs/{orgId}/invitations`
- [Invite someone](/api-reference/organisations/orgs-invitations-create.md): `POST /v1/orgs/{orgId}/invitations`
- [Revoke an invitation](/api-reference/organisations/orgs-invitations-revoke.md): `DELETE /v1/orgs/{orgId}/invitations/{invitationId}`
- [Resend an invitation](/api-reference/organisations/orgs-invitations-resend.md): `POST /v1/orgs/{orgId}/invitations/{invitationId}/resend`
- [Leave an organisation](/api-reference/organisations/orgs-leave.md): `POST /v1/orgs/{orgId}/leave`
- [List members](/api-reference/organisations/orgs-members-list.md): `GET /v1/orgs/{orgId}/members`
- [Change a member's role](/api-reference/organisations/orgs-members-change-role.md): `PATCH /v1/orgs/{orgId}/members/{userId}`
- [Remove a member](/api-reference/organisations/orgs-members-remove.md): `DELETE /v1/orgs/{orgId}/members/{userId}`
- [Restore a deleted organisation](/api-reference/organisations/orgs-restore.md): `POST /v1/orgs/{orgId}/restore`

## Projects

- [List the organisation's projects](/api-reference/projects/projects-list.md): `GET /v1/orgs/{orgId}/projects`
- [Create a project](/api-reference/projects/projects-create.md): `POST /v1/orgs/{orgId}/projects`
- [Get a project](/api-reference/projects/projects-get.md): `GET /v1/orgs/{orgId}/projects/{id}`
- [Update a project](/api-reference/projects/projects-update.md): `PATCH /v1/orgs/{orgId}/projects/{id}`
- [Delete a project](/api-reference/projects/projects-delete.md): `DELETE /v1/orgs/{orgId}/projects/{id}`

## System

- [Build information](/api-reference/system/get-version.md): `GET /version`

