API unification means building a single, consistent interface across multiple APIs that share the same domain — for example, syncing contacts from HubSpot, Salesforce, and Pipedrive using one unifiedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nangohq/nango/llms.txt
Use this file to discover all available pages before exploring further.
Contact model.
Nango lets you define your own unified models and implement the mapping logic in TypeScript functions. Unlike pre-built unified APIs, you control the schema and can handle API-specific edge cases without being boxed in.
When unification makes sense
Unification delivers the most value when you integrate with multiple APIs in the same category — CRMs, HR platforms, accounting systems, support tools — where customers choose between providers. Standardizing these into a single internal model means you only change the mapping logic, not your application.Unification doesn’t have to be perfect to be useful. Even partial alignment across APIs reduces downstream complexity.
How to build a unified API
Define your unified model
Define a shared schema using zod in a
models.ts file. This becomes the contract between your integration functions and your application.models.ts
Implement a sync for each provider
Write a sync function per provider that fetches data and maps it to the unified model. Each sync uses the same output type.
Implement unified actions (optional)
For write operations, implement the same action for each provider with identical input/output types.
Best practices
Use your existing data model as the unified schema
Use your existing data model as the unified schema
If your application already has a data model for contacts, invoices, or tickets — use it as the unified model. This keeps your codebase consistent and avoids a separate translation layer in your app.
Expect nullable fields
Expect nullable fields
Not every API provides the same data. Design your unified model with nullable fields for data that may be absent from some providers, and handle missing values gracefully.
Use the same model for reads and writes
Use the same model for reads and writes
Use identical input/output types for both syncs (reads) and actions (writes). This eliminates duplicate mapping logic and makes your integration easier to maintain.
Handle API-specific extensions
Handle API-specific extensions
For fields unique to one provider, extend your unified model rather than polluting the shared schema. You can attach raw API responses in a separate field for maximum flexibility.