Your Own Unified API: Build It on Truto or Build the Whole Layer?
What a team builds and maintains when it writes its own unified API layer, and which of those parts Truto's Pro add-on already runs.
Roopendra Talekar
·
·
6 min read
Your team’s apps in
A unified API has two halves. One half is the model: the resources and fields your product needs, and the mapping from each app's API to them. That half is yours, because nobody else knows your product's data. The other half is the layer that runs the model for every customer. That half is the same for every team, and it is most of the work.
On Truto you write the first half and Truto runs the second. This post lists each part of the layer, what Truto already runs, and what you would build and maintain in-house. For the step-by-step build with a coding agent, read How a Coding Agent Builds Your Own Unified API on Truto.
When to build your own model
Truto has pre-built unified APIs for categories such as CRM, HRIS, ATS, accounting and ticketing. Use one of them when its fields fit your product. Build your own model when they do not, for example:
- Your product needs a few fields from each app, in a shape that matches your own database.
- Your category has no pre-built unified API on Truto.
- You need a custom method that combines data from two of an app's endpoints.
You can also call each app's own API through the Proxy API, and your agents can use each account's MCP server. A unified model is one option next to them, not a replacement.
What you build in-house, and what Truto runs
| Part | On Truto | In-house |
|---|---|---|
| Schema | Resources with a JSON schema each | Your own model registry and API |
| Mapping runtime | JSONata with Truto's functions | Code per app, or your own engine |
| Editor and tests | Dashboard editor and CLI tests | An internal admin tool |
| Versions | History and restore built in | Your own history and rollback |
| Overrides | Environment and account overrides | Per-tenant config and merge code |
| Deploys | Validate and apply, no deploy | CI and a release per change |
| Auth | Each connected account's tokens | OAuth apps, token store, refresh |
| Paging and 429s | Next cursor; 429 passed back | Code per API |
| Logs | Every unified call logged | Your own logging and search |
The sections below give the detail and the source for each row.
The schema layer
In-house, you design the model, store it, and serve an API for it. On Truto, you create a unified API in the dashboard or with truto unified-models create. Each resource has a JSON schema, and each method is list, get, create, update, delete or a custom name. The name sets the path, so a model called my-crm answers at /unified/my-crm. See Creating Unified APIs on Truto.
The mapping runtime
In-house, each app gets its own adapter code, or you build an engine that runs mapping rules. On Truto, every mapping is a JSONata expression. A method can have a query mapping, a request body mapping, a response mapping, an error mapping and header mappings. Before and after steps fetch more data or keep state between calls. Mappings can use Truto's own JSONata functions, such as $mapValues, $firstNonEmpty and $dtFromIso. See Mapping bindings and functions.
Each mapping maps one integration to your model. You map HubSpot, Salesforce and Pipedrive to the same my-crm model, and your code calls one path for all three.
The mapping editor and tests
In-house, someone builds an admin tool to edit and test mappings, or every change goes through a pull request. On Truto, the dashboard has a mapping editor. Each mapping tab has an example input and its result, and Code View shows the whole configuration as YAML. On your machine, truto unified test-mapping runs a response mapping against a sample response, and truto jsonata eval runs any expression. On a live call, truto_response_format=debug shows the request Truto sent and the app's raw response. See Test and debug a mapping.
Version history and rollback
In-house, you store each version of each mapping and build a way to compare and restore them. On Truto, History in the mapping editor compares and restores earlier versions of a mapping. The Version history menu item does the same for the whole unified API. See Overriding Unified API mappings.
Per-environment and per-customer overrides
In-house, enterprise customers with custom fields need per-tenant config and code that merges it with the default mapping. On Truto, an environment override changes a mapping for every connected account in one environment. An integrated account override changes it for one connected account, and only needs the fields you add or change. Import from other Environment copies overrides between environments. See Overriding Unified API mappings and 3-Level API Mapping.
Testing and deploying mapping changes
In-house, a mapping change is a code change: tests, review, a build and a release. On Truto, mappings are configuration that Truto runs. The Truto CLI checks and pushes them:
truto unified-mappings validatechecks a mapping file against the model's schema, with no LLM calls and no writes.truto unified-mappings applychecks every mapping again, compares it with the live version, and writes only what passes.--dry-runshows the change first.- With a test account, apply runs read tests against it after the write. It never writes to the app.
A saved change can take up to about 23 minutes to reach API calls, because each connection caches mappings. POST /integrated-account/refresh-mapping-cache applies it sooner. See Unified mappings build.
Built by a coding agent
In-house, your coding agent writes adapter code that your team then owns. On Truto, truto unified-mappings build is an agent loop. It reads the integration's Proxy API, makes read-only sample calls through a connected account or reads the app's docs, and writes the JSONata for each method. When it cannot tell which endpoint or field is right, it asks a question instead of guessing. The output is a mapping file that you validate and apply. Truto's agent skills (truto-unified-mappings and truto-jsonata) teach Claude Code and Cursor the same steps. See Setting up Truto with a coding agent.
Auth, paging and rate limits
In-house, you register OAuth apps, store tokens, refresh them before they expire, and write paging code for each API. On Truto, a call to your own model runs through the connected account, and Truto refreshes its tokens. A list call returns the records with next_cursor for the next page. See How a Unified API call flows.
Truto does not retry rate-limited calls for you. When the app returns a 429, Truto passes it back with ratelimit headers and, when it has one, Retry-After. Your code decides when to retry. See Rate limits.
Logs, sync jobs and no code to host
In-house, you add logging, a place to search it, and jobs that copy data on a schedule. On Truto:
- Truto logs every unified call. Read the logs in the dashboard, with
GET /logor withtruto logs. See Viewing logs. - Sync jobs (RapidBridge) read your own unified resources by the name
your-model/resource. See Creating a RapidBridge sync job. - You host no integration code. Your model, mappings and overrides are configuration that Truto runs for every customer.
What a custom model does not do
- MCP tools. On a per-account MCP server, each Proxy API method that has a description is a tool. Your unified model does not add tools there. See /mcp.
- Instant changes. See Testing and deploying mapping changes.
- Retries. See Auth, paging and rate limits.
What it costs
Building your own unified models is part of the Pro add-on, $499 a month. The Free plan includes a 30-day trial of Pro. Unified calls cost the same as other API calls, $5 per 100,000, and connections are free. Calls on Truto's managed Google and QuickBooks apps are priced separately. Truto's pre-built unified APIs are a separate add-on, $499 per category a month. See pricing.
Next step
Follow the build end to end in How a Coding Agent Builds Your Own Unified API on Truto, or start with Creating Unified APIs on Truto in the docs.
FAQ
- Can I build my own unified API on Truto instead of using Truto's models?
- Yes. You define a unified model with your own resources and a JSON schema for each one, map each method to an integration's API with JSONata, install the model in an environment, and call it at /unified/your-model/your-resource. Building your own unified models is part of the Pro add-on, $499 a month.
- What would we have to build ourselves to run our own unified API in-house?
- A schema layer, a mapping runtime, a place to edit and test mappings, version history and rollback, per-environment and per-customer overrides, a test and deploy path for mapping changes, an OAuth and token store with refresh, pagination per API and logs. On Truto, you write the model and the mappings, and Truto runs the rest. Your code still retries a 429, which Truto passes back with ratelimit headers.
- Does Truto retry rate-limited calls on my own unified API?
- No. When the app returns a 429, Truto passes it back to you with ratelimit headers and, when it has one, Retry-After. Your code decides when to retry. This is the same for Truto's own unified APIs, the Proxy API and your own unified models.
- Can I change a mapping for one customer only?
- Yes. An environment override changes a mapping for every connected account in one environment. An integrated account override changes it for one connected account, for example to add a customer's custom field. Neither needs a code deploy.
- Does my own unified model become MCP tools?
- Not by itself. On a per-account MCP server, each Proxy API method that has a description is a tool. Your unified model serves your product's backend through the unified API. Your AI agents use the MCP server.
- How much does a custom unified API on Truto cost?
- Your own unified models come with the Pro add-on, $499 a month, and the Free plan includes a 30-day trial of Pro. Unified calls cost the same as other API calls, $5 per 100,000. Calls on Truto's managed Google and QuickBooks apps are priced separately.