Skip to Content
Pocket Notifier

App API

The oRPC procedures the mobile app uses, served at /api/rpc.

The app API is appContract in packages/contract/src/app.ts. The apps call it through the typed oRPC client at /rpc, signed in with their better-auth session. Every procedure requires a session except invites.preview.

apps/native/utils/orpc.ts (after M1)
import type { ContractRouterClient } from "@orpc/contract";
import type { AppContract } from "@notifier/contract";

export const client: ContractRouterClient<AppContract> = createORPCClient(link);

const inbox = await client.messages.list({ unreadOnly: true });

Procedures

NamespaceProcedureWhat it does
megetThe signed-in user
projectslistProjects the user is a member of, with role, subscription, unread count; includes the private General project (personal: true)
get / create / update / deleteManage one project (update and delete need owner)
setSubscriptionSubscribe, unsubscribe, mute
featureslistA project's features, optionally one status, most recent activity first
createNew feature, idempotent by slug (owner or publisher)
updateStatusactive, done or archived (owner only)
memberslist / add / update / removeManage a project's members (owner only, except list)
messageslistInbox, or one project with projectId; unreadOnly filter
getOne message with read state
markReadBy IDs, or everything up to a message
publishSame rules as the public publish, for "send test message"
deleteRemove a message (owner only)
responsescreateAck or reply from a reply action
listResponses to a message (owner or publisher)
tokenslist / create / revokeThe user's access tokens; create returns the secret once
inviteslist / create / revokeInvites the user created
previewPublic: what an invite link grants, for the sign-up page
deviceslist / register / rename / removeThe user's phones; register upserts by push token

Errors

Every procedure can fail with UNAUTHORIZED, FORBIDDEN and NOT_FOUND. Some procedures declare more:

  • projects.create and members.add can return CONFLICT.
  • responses.create can return CONFLICT when the person has already responded to that action.
  • messages.publish can return TOO_MANY_REQUESTS.

The typed client exposes them as ORPCError with a known code, so the apps can show a specific message instead of a generic failure. See Errors.

On this page