tRPC Procedures
tRPC is the canonical Inklura Platform API. Every domain is exposed as a router of
procedures, reachable at /api/trpc/<router>.<procedure>. There are roughly 350
routers and ~6,567 procedures — the catalog below is representative, not exhaustive.
Procedure naming
A call names a router and a procedure joined by a dot:
<router>.<procedure>
For example products.list, orders.get, invoices.createDraft, campaigns.sendCampaign.
The router groups a domain; the procedure is the operation.
Procedure kinds
Each procedure is built on one of six base procedures, which determine what a caller must present:
| Kind | Requires |
|---|---|
publicProcedure |
Nothing — callable without a session (e.g. login, signup, password reset). |
protectedProcedure |
A valid session (Bearer JWT or session cookie). |
permissionProtectedProcedure(["perm:action"]) |
A session and the named permission(s). |
tenantProtectedProcedure |
A session scoped to a resolved tenant. |
roleProtectedProcedure |
A session holding a required role. |
internalProcedure |
Not callable externally — internal/service use only. |
internalProcedure procedures exist in the router tree but are not reachable by an external
caller. Do not build against them.
Calling conventions
Queries are GET, mutations are POST. Inputs and outputs are superjson-wrapped:
inputs go in {"json":<value>}, and the result you want is nested at result.data.json.
Authenticate with a Bearer JWT (see Sessions & Tokens).
Raw HTTP — query (GET)
Input is URL-encoded into ?input=:
curl -G "https://manage.inklura.fr/api/trpc/products.get" \
-H "Authorization: Bearer $INKLURA_TOKEN" \
--data-urlencode 'input={"json":{"id":"<product-id>"}}'
For a procedure that takes no input, omit ?input= entirely:
curl "https://manage.inklura.fr/api/trpc/auth.getSession" \
-H "Authorization: Bearer $INKLURA_TOKEN"
Raw HTTP — mutation (POST)
Input is the JSON body, wrapped the same way:
curl -X POST "https://manage.inklura.fr/api/trpc/clients.create" \
-H "Authorization: Bearer $INKLURA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"json":{"name":"Acme SARL","email":"contact@acme.example"}}'
Both return the payload under result.data.json:
{ "result": { "data": { "json": { "id": "…" } } } }
Typed client (@trpc/client)
For TypeScript callers, use @trpc/client with the superjson transformer and an
httpBatchLink pointed at the mount. Add the Authorization header via the link's
headers option:
import { createTRPCClient, httpBatchLink } from "@trpc/client";
import superjson from "superjson";
const client = createTRPCClient<AppRouter>({
links: [
httpBatchLink({
url: "https://manage.inklura.fr/api/trpc",
transformer: superjson,
headers() {
return {
Authorization: `Bearer ${process.env.INKLURA_TOKEN}`,
// Optionally pin tenant/site scope:
"X-Tenant-Id": process.env.INKLURA_TENANT_ID ?? "",
"X-Site-Id": process.env.INKLURA_SITE_ID ?? "",
};
},
}),
],
});
const session = await client.auth.getSession.query();
const created = await client.clients.create.mutate({
name: "Acme SARL",
email: "contact@acme.example",
});
With the transformer configured on the link, the client handles the superjson wrapping and unwrapping for you — you pass and receive plain values.
Batching
The endpoint speaks the standard tRPC batch protocol, so httpBatchLink coalesces multiple
calls made in the same tick into a single HTTP request. Method override is enabled on the
mount (allowMethodOverride=true), and the mount accepts both GET and POST.
Router catalog
The routers below are verified examples, grouped by family. They are representative of the ~350 routers on the platform — not a complete list. Procedure counts are approximate.
Auth & identity
| Router | Procedures (examples) |
|---|---|
auth |
getSession, getProfile, canAccessManage, getUserInfo, verifyEmail, resendVerificationEmail, and public login / register / signup / requestPasswordReset / bridgeOidc |
Commerce & CRM
| Router | Procedures (examples) |
|---|---|
products |
~27 procedures — list / get plus CRUD (only list / get are REST-exposed) |
orders |
~48 procedures — CRUD plus the fulfillment lifecycle |
clients |
create and the rest of CRUD |
invoices |
getInvoices, getInvoice, createInvoice, createDraft, updateDraft, updateInvoiceStatus, convertQuote, createCreditNote, getDashboardMetrics, and public getPublicInvoice |
Other routers in this family (names only): profile, users, tiers, vendors,
inventory, stockActions, recurringInvoices, payments, stripe, shipping,
taxRates, coupons, subscriptions, accounting, billing, saasPlans.
POS & restaurant
Names only: posManagement, posOrders, kitchen/kds, tablePayment, posLoyalty,
clickCollect, floorPlans, tableReservations, delivery.
CMS & publishing
Names only: cms, articles, posts, medias, forms, sections, slider,
magazinePublications, classifiedAds, feedApiKeys.
Comms & marketing
| Router | Procedures (examples) |
|---|---|
campaigns |
getCampaigns, getCampaignById, createCampaign, createCampaignWizard, updateCampaign, deleteCampaign, sendCampaign, pauseCampaign, resumeCampaign, duplicateCampaign, getCampaignActivity, getCampaignTags, createCampaignTag |
helpdeskKb |
getArticles, getArticleById, createArticle, updateArticle, deleteArticle, getCategories, getCategoryById, createCategory, updateCategory, deleteCategory |
Other routers in this family (names only): marketingCampaigns, emails,
emailTemplates, newsletter, segments, communications, mautic, support,
chat/liveChat.
Platform & admin
Names only: admin, tenants, settings, permissions, onboarding, site,
siteProvisioning, webhooks, sessions, monitoring, health, queues,
aiOperations, workflowAutomation.
Because the catalog is large and evolving, treat the lists above as a starting map. The verified procedure names are safe to call; the "names only" routers are real but their procedure signatures are not documented here.
Related
- Sessions & Tokens — how the server resolves your identity and scope
- Errors & Rate Limits — the error envelope and Zod validation errors
- Pagination & Filtering — the
page/pageSizeconvention - REST Endpoints — the partial
/api/v1bridge