Why EspoCRM REST API integration needs a design before the first call
A reliable EspoCRM REST API integration starts with decisions, not code. Before a website form, ERP, mail or telephony system writes its first record, the team needs to settle four things: which identity the integration runs as, what that identity is allowed to do, which authentication method it uses, and which system owns each field. Get those right and the connection is predictable. Leave them open and the first working call often becomes the first production incident, usually a record created under the wrong user, a field overwritten by the wrong system, or a retry that quietly doubles a lead.
The hardest part is the integration user. EspoCRM's REST API works through dedicated API users with role-based permissions, so every connected system needs its own API user with only the entity and field access it requires. A website form may only need to create leads, while an ERP sync may need to read and update accounts and opportunities. Before building, list each system, the entities it touches, the operations it performs and the fields it may change. Then choose between API key and HMAC authentication. The EspoCRM API documentation describes HMAC as the most secure method and basic authentication as not recommended, so plan for HMAC where your systems can sign requests. Confirm each caller's support for signing before committing.
Two other design questions matter as much as credentials. The first is field ownership: if the ERP and CRM both hold a company's billing address, one of them must be the source of truth, and the other must not write over it. The second is failure handling. Networks drop, webhooks fire twice and upstream systems retry, so the design must define how each write is identified, how duplicates are detected and what happens when a call fails partway through. Keep the scope clear: this page covers the REST API as the main integration surface. CSV import and single sign-on are covered on their own sibling topics.
Which EspoCRM components an integration touches
Every EspoCRM integration reads or writes through a small set of components: the API user that authenticates the call, the entities and fields it touches, the scripts that run on save, and the background jobs that process queued work. Each one changes what the integration can do and where it can fail, so they should be designed together rather than configured one at a time.
API users and role permissions
Each integration should run under its own API user, not a person's admin account, so its access can be scoped with a dedicated role. The role decides which entities the integration can read, create, edit or delete, and which fields it sees. Review the role for every connected system, since a website form, an ERP sync and a telephony lookup rarely need the same rights. Confirm which permissions your EspoCRM version applies to API calls before testing against production data.
EspoCRM API docsAPI key, HMAC and basic authentication
The REST API accepts API key, HMAC and basic authentication. The EspoCRM docs describe HMAC as the most secure option and basic authentication as not recommended, so basic should be avoided for any new integration. API keys are simpler to rotate in a script but carry a single shared secret, so store them in a secrets manager and restrict the API user's IP access. Choose the method per integration and document who holds each secret.
Entities and fields in the Entity Manager
Integrations write to standard entities such as Account, Contact and Lead, and often to custom fields created in the Entity Manager for external IDs, sync timestamps or source system references. Those fields are the integration's anchor for matching records on the next sync. Renaming or deleting them later breaks every connected system, so agree field names and types before go-live. Confirm which fields the API user's role can write, because a field that is hidden from the role will fail silently in some flows.
Before-save API scripts in Formula Script
API before-save scripts written in Formula Script run when a record is saved through the API and can set defaults, normalize values or reject invalid input before the record is stored. They are useful for enforcing consistent phone formats or source tags across all connected systems. They also run on every API write, so a slow or incorrect script affects every integration at once. Test each script with the exact payloads your websites, ERP and telephony tools send, and keep a copy of the script logic in your integration documentation.
Formula docsCron and background jobs
EspoCRM requires cron or a scheduled task to run background jobs, and integration work that is queued, such as large imports, email processing or some webhook and workflow actions, depends on it. If cron stops, records may appear to save while downstream effects never happen. Check that the scheduled task runs under the correct user, that its failures are logged and alerted, and that its schedule is documented for the team that operates the server. Confirm how your chosen hosting setup runs it before go-live.
Server configuration docsAPI key or HMAC: choosing the authentication method
An API key is a long secret value that the calling system sends with each request so EspoCRM can identify the API user making it. The key works as a bearer credential: anyone who holds it can act with that API user's role permissions. In EspoCRM, keys belong to dedicated API users, so permissions are set on the API user's role and the key can be replaced without touching any employee account. Review the EspoCRM API documentation for the exact request header and key generation steps.
- Where the secret lives: in the calling system's secret store or environment configuration, never in website front-end code, shared spreadsheets or tickets.
- Rotation: replacing a key means generating a new one, updating every caller and then retiring the old value. Schedule the change so a running ERP sync does not fail midway.
- Auditing: requests are attributed to the API user, so one key per integration keeps the audit trail readable.
- Exposure risk: a leaked key works from any network location unless access is restricted, so combine it with IP restrictions where your EspoCRM security settings allow.
Confirm how keys are generated, whether the value is shown only once, and which header carries it before any code is written.
HMAC authentication signs each request with a shared secret. The client computes a keyed hash over parts of the request, such as the method, the path and a timestamp, and the server recomputes the same value to verify it. The secret itself is not sent with the request, so a captured request is harder to alter. The EspoCRM docs describe HMAC as the most secure of the supported methods, which makes it the default choice where the caller can sign requests.
- How it works: the header format and the order of the signed string are defined by EspoCRM. The client must reproduce the canonical string exactly, and small differences in encoding or ordering are the most common cause of failed integrations.
- Where the secret lives: under the same secret store rule as API keys. The secret must be available to the signing code, so it sits in the integration service and never in browser code.
- Rotation: rotate on the same schedule as keys. Check whether the platform accepts two active secrets during a transition window before planning a cutover.
- Auditing: requests are still attributed to the API user. Log signing failures on the calling side so clock drift can be separated from a wrong secret.
Confirm the exact header names, signing string order, hash algorithm and timestamp tolerance in the API documentation, and test against a non-production instance first.
Basic authentication sends a username and password with requests so the server can verify the caller. Because the credential is a password, it carries the weaknesses of password-based access into an unattended process. The EspoCRM docs do not recommend basic authentication, and integrations should treat it as a method to avoid rather than a shortcut for a quick connection. Any use of it should be recorded as a migration item with an owner and a removal date.
- Credential type: a user password, which is a weak fit for a machine caller that runs without human oversight.
- Rotation: changing the password breaks every caller at once, and the change often needs manual steps in several systems.
- Auditing: if a shared or administrator account is used, attribution is lost. Use a dedicated API user even when basic authentication is the only option.
- Interaction with login controls: password policies, lockout rules and 2FA designed for people can disrupt scheduled calls, so failures may look like random outages.
Confirm with the API documentation whether basic authentication is enabled on your EspoCRM version, and whether it can be turned off for integrations before go-live.
For most integrations the decision depends on two questions: can the calling system sign requests, and can it store secrets safely? The EspoCRM docs describe HMAC as the most secure method and basic authentication as not recommended, so HMAC is the default where the caller supports it. API keys suit simpler callers that run inside a secured back end, provided rotation, restricted permissions and network controls are in place. The choice should be recorded in the integration design so the team that operates the integration knows which method applies to each caller.
- Website forms: send requests through a server-side component. Keys or secrets should never reach a visitor's browser.
- ERP and telephony: check whether the connector or middleware supports HMAC signing. If it does not, plan a small signing service rather than falling back to basic authentication.
- Email and other sync jobs: confirm which API operations the sync uses and whether those operations need write access.
- One API user per integration: give each integration its own API user with the narrowest role that works, so one compromised secret limits the damage to one integration.
Ask the platform owner to confirm the supported methods on your EspoCRM version, then test each caller in a non-production environment before it reaches live data.
Integration decisions and their operational trade-offs
This table compares the main design choices for connecting EspoCRM to websites, ERP, email and telephony systems, with the situations where each fits and what it costs to run. Read each row as a decision to settle before build, since the choices interact, especially API user scope and where duplicate matching lives.
| Decision | Option | When it fits | Operational cost and trade-off |
|---|---|---|---|
| API user scope | One API user per integration | Each system has its own credentials, role and audit trail, and you need to revoke one without affecting others | More users and roles to maintain and review; each needs its own permission set and credential rotation |
| API user scope | Shared API user for several integrations | A small number of low-risk integrations under one owner with limited permissions | Harder to attribute changes in the audit log and to revoke access for one system without disrupting the rest |
| Inbound pattern | Polling EspoCRM from middleware on a schedule | Systems that cannot receive calls, or where a short delay in updates is acceptable | Simple to reason about, but adds load on a schedule and makes change detection your job, including deletions |
| Inbound pattern | Webhook-style outbound calls from a middleware layer | Near-real-time updates to other systems, with a receiver that can accept and retry | Requires a receiver, retry handling and monitoring of failed deliveries; test each event trigger before relying on it |
| Write timing | Direct synchronous writes from the calling system | Low volume and a user waiting for confirmation on screen | A slow or failed EspoCRM response blocks the caller; errors surface immediately but load spikes pass straight through |
| Write timing | Queued writes processed by a worker | Bulk updates, ERP batches or telephony events that arrive in bursts | Adds a queue to run and secure; needs idempotency keys or checks so retries do not create duplicate records |
| System of record | Defined owner per field, documented in a mapping sheet | Fields edited in more than one system, such as account owner, status or billing address | Ownership rules must be written and enforced in both directions; without them, sync loops overwrite valid data |
| Duplicate matching | Checks in EspoCRM before-save scripts | Duplicates created from many paths, including forms, users and imports, so one rule protects them all | Logic lives in the CRM and must be reviewed on each upgrade or customization change; confirm the Formula Script capabilities you need |
| Duplicate matching | Checks in the middleware before calling EspoCRM | Matching uses data outside the CRM, such as ERP customer IDs, or several source systems feed one record | Users who edit directly in EspoCRM bypass the check, so a second rule or a periodic review may still be needed |
How to build the integration in sequence
The sequence moves from a confirmed EspoCRM baseline and a locked-down API identity to a tested write path, then to error handling and staged production traffic. Each step closes with a check, so the team knows the integration is safe to widen before the next step begins.
Confirm the EspoCRM version and hosting
Record the exact EspoCRM version, the PHP, database and web server stack, and where the instance is hosted before writing any code. Confirm the version against the supported server requirements in the EspoCRM documentation, and confirm that cron is running, because background jobs depend on it. Ask the platform owner to confirm whether the instance is self-hosted or on EspoCRM Cloud, since that determines who applies patches and who can change server-side settings. The check is a written environment record, reviewed by the platform owner, that lists the version, stack, hosting model and a staging copy available for testing.
Create a dedicated API user with the narrowest role
Create a separate API user in EspoCRM for each external system, rather than reusing an administrator or a named employee account. Give that user a role that grants only the entities and actions the integration needs, such as read and create on Leads and read-only on Accounts. Keep the user out of administrative roles and document which system owns it. The check is a test call made as that user that succeeds on an allowed entity and returns a permission error on an entity outside the role.
Choose and configure the authentication method
Select HMAC for the integration, because the EspoCRM API documentation describes it as the most secure option and lists basic authentication as not recommended. API key is a simpler alternative if HMAC is not practical for the calling system. Store the secret in the calling system's secrets store, not in code or configuration files in the repository. Restrict the source IP addresses permitted to call the API where your network allows it. The check is a successful authenticated request from the test environment and a rejected request when the signature or key is altered.
Map each external field to an EspoCRM field and owner
Build a field map that lists each source field, its EspoCRM entity and field, the data type, the required status and the system of record for that value. Assign an owner to each field, meaning the system or team allowed to change it, so that the website, ERP, email tool and telephony system do not overwrite each other. Decide which assigned user or team receives records created by the integration. The check is a signed-off map where every EspoCRM field the integration writes has one named owner and a documented fallback when the source value is empty.
Build a test client that creates and updates one record
Write a small client that creates one test record, then updates the same record using its EspoCRM identifier, using the staging instance only. Run it with the API user from step two and the authentication method from step three. Log the request, the response and the record identifier for each call. The check is a single record in staging with the correct values, the correct assigned owner and team, and an update that changes only the intended fields.
Add before-save logic for validation and duplicate checks
Add validation rules in EspoCRM, such as before-save formula scripts configured in the Entity Manager or API before-save scripts, so that malformed or duplicate records are rejected at the point of entry rather than cleaned up later. Define the duplicate key, for example email address plus account name, and test it against records that already exist. Confirm with the EspoCRM documentation which script type applies to API writes in your version. The check is a set of test requests where invalid and duplicate payloads are rejected with a clear error, and valid payloads still succeed.
Add retry and idempotency handling
Give every outbound write a stable external identifier stored in a custom EspoCRM field, so that a retried request updates the existing record instead of creating a second one. Retry only on network timeouts and server errors, with a limited number of attempts and increasing delays between them. Send requests that fail after the final attempt to a queue or error log that someone reviews each day. The check is a test in which the same request is sent twice, leaves one record, and a deliberately failed request appears in the error log with its payload and response code.
Enable production traffic in stages
Turn on production traffic for one source system at a time, starting with the lowest-risk flow, and keep the other flows switched off until the first one has run cleanly. Compare record counts, owners and duplicate rates in EspoCRM against the source system after each stage. Keep the staging test client available for regression testing before every change. Confirm the rollback path, which is the procedure to disable the API user or stop the calling job, before the first production write. The check is a reconciliation report for each stage that matches source and EspoCRM counts and shows no unexpected duplicates or overwritten owners.
How to handle sync errors and duplicates without losing records
Sync failures between EspoCRM and websites, ERP, email or telephony systems rarely look like outages. They look like missing contacts, duplicated accounts and events that were applied twice. The four failure modes to design for are timeouts (the caller gives up while EspoCRM is still writing), partial writes (an account is saved but its related contact or activity is not), retries (the external system resends an event it thinks failed, such as a web form post or a call log), and two systems creating the same contact at nearly the same moment. Each one needs a deliberate answer before go-live, because the REST API will accept a valid request either way and will not know it is a duplicate.
The pattern that holds up is three parts working together. First, store the external system's identifier on the EspoCRM record in a dedicated custom field, for example an externalId field added through the Entity Manager, and make the integration look up that field before creating anything. Second, write every failed or ambiguous call to an error queue with the payload, the endpoint, the HTTP status and the attempt count, so nothing disappears silently. Third, run a scheduled reconciliation job that compares the external system's records with EspoCRM by identifier and replays or flags the gaps. Confirm the exact behavior of your EspoCRM version's create and update endpoints, including how they respond to repeated requests, in the EspoCRM docs: API before you rely on them for idempotency.
Do not confuse this with CSV import duplicate matching. The import tool's duplicate matching on chosen fields is a one-time bulk loading control, and it does not guard a live integration that receives events all day. Use it for the initial load and for cleanup runs, and treat the migration topic as the place to plan field mapping, import order for related records and reverting test imports: EspoCRM migration from Salesforce, SugarCRM or spreadsheets covers the import mechanics. Ask your team to decide, before build, which system is the master for each field, how merges are approved, and who reviews the error queue each day, because an unowned queue is how records get lost.
How website, ERP, email and telephony traffic reaches EspoCRM through the API
The flow starts with the website form, ERP, mail and telephony systems, which call EspoCRM either directly or through a middleware layer you control. Every request enters the EspoCRM host through Nginx and is authenticated as a dedicated API user with role-based permissions, not a person's admin account. The application then reads and writes the database, while cron runs background jobs such as workflows and queued actions. Check that each caller has its own API user, that the trust boundary matches your network rules, and that no integration depends on a shared credential.
External systems reach EspoCRM through Nginx, the REST API and a role-restricted API user.
What drives effort in an EspoCRM integration
This table lists the factors that most change the scope of an EspoCRM REST API integration, with a practical way to keep each one contained. Read it before scoping, because most extra effort comes from a few drivers that were not defined early. The main takeaway is that narrow field scope, one shared API user pattern and a clear error process reduce work more than any single technical choice.
| Driver | Why it changes effort | How to keep it down |
|---|---|---|
| Number of source systems | Each website, ERP, email or telephony system adds its own auth method, payload shape, error codes and owner to agree with. | Start with the systems that need live data, and defer others to a later phase or a scheduled file exchange. |
| Entities and fields mapped | Every mapped field needs a type match, a default rule and a test case. Contacts, accounts, leads and opportunities multiply quickly. | Map only fields that a process actually reads or writes, and document the source of truth for each one. |
| Direction of sync | One-way pushes are simpler than two-way sync, which must resolve which side wins when both change the same record. | Assign ownership per field, so each field is written by one system and the other side only reads it. |
| Volume and frequency of calls | High-frequency updates, bulk operations and retries raise load on the EspoCRM server and cron jobs, and make rate and timing issues more likely. | Batch non-urgent updates, prefer webhooks for events, and confirm call volumes with the business owner before design. |
| Error queues and reconciliation | Failed writes need storage, retry rules, alerting and a person who clears them. Reconciliation reports add a further build. | Define retry limits and a single error queue early, and agree which errors need a human decision. |
| Duplicate handling | Matching logic on email, phone or company name must be decided per source, and merges can be hard to undo. | Choose one matching key per entity, and test duplicate rules with sample data before enabling writes. |
| Custom entities | Custom entities, and the formulas or layouts tied to them, must exist in every environment and survive upgrades. | Reuse existing standard entities where possible and record each custom entity in the integration design. |
| Number of environments | Development, test and production each need API users, endpoints, credentials and test data, and drift between them causes rework. | Keep one API user pattern across environments and manage configuration changes through a single, documented process. |
| Compliance evidence needs | Assessors may ask for access records, change history, data flow diagrams and proof that API credentials are controlled. | Agree the evidence list up front and capture logs, role definitions and test results as the build progresses. |
How the integration changes by deployment model
On a single server, EspoCRM, its web server and its database share one host, so API traffic from websites, ERP, email and telephony systems usually reaches EspoCRM over one network path. TLS is typically terminated on the same web server that serves the API, which keeps certificate management simple but means every integration depends on that one host being available. Background work such as scheduled jobs and the sync actions your integrations trigger depends on cron running on that same machine.
- Network path: Integrations call the API directly on the host, so firewall rules are short but usually broad. Restrict the source addresses that may reach the API path.
- TLS termination: Terminate TLS on the EspoCRM web server with a certificate every caller trusts, and confirm the callers verify it.
- Cron reliability: Cron runs on the same host as the application, so a single failure can stop both the web app and queued integration work. Monitor the cron schedule.
- Middleware location: Middleware such as an integration service or webhook receiver usually runs on a separate host or container, not on the CRM server, so the CRM host stays small.
- Backup coupling: A single host means the application and database are backed up together, which simplifies restores of duplicate-cleaned or reverted records.
Before building, confirm with your team which host runs cron and whether a single outage would halt all connected systems.
When the database runs on its own server and the application runs on one or more application servers, API calls travel across an internal network between tiers. Each hop adds a place where TLS, firewall rules and timeouts must line up, and sync errors can originate in the network rather than in EspoCRM. The database connection and the API endpoint are reached by different paths, so you need to know which tier each integration actually touches.
- Network path: Define explicit rules from middleware to the application tier and from the application tier to the database. Keep the database unreachable from integration hosts.
- TLS termination: Decide whether a load balancer terminates TLS and whether traffic between it and the application is re-encrypted. Confirm the chosen design with your security team.
- Cron reliability: Background jobs and imports must run on exactly one designated node. Running cron on several application servers can cause duplicate processing of the same queue.
- Middleware location: Place middleware where it can reach the application tier but not the database. Ensure it handles retries when one application server is unavailable.
- Session and file handling: Confirm where uploaded files and attachments are stored so that any application server can serve them to API consumers.
High availability design, including load balancing and separating file storage, is covered on a sibling topic, so review that before finalizing this tier layout.
In an air-gapped network, the CRM and the systems it integrates with have no route to the public internet. Websites, ERP, email and telephony integrations must all sit inside the isolated network, and any external dependency such as a certificate authority, package mirror or vendor license check has to be handled manually. Webhooks that expect outbound callbacks to internet endpoints will not work unless the receiver is also inside the same boundary.
- Network path: Every integration path is internal. Document each allowed flow between the CRM, the ERP, the mail relay and the telephony platform, and block everything else.
- TLS termination: Use an internal certificate authority that your callers trust. Plan how certificates are renewed without internet-based automation.
- Cron reliability: Cron must run without external time or update services that are unreachable. Check that scheduled sync and cleanup jobs keep running through planned maintenance windows.
- Middleware location: Keep middleware inside the enclave, since a relay outside it would reintroduce a path across the boundary. Confirm the trust zone rules with your security team before deployment.
- Updates and packages: Upgrades and extension installs need an approved transfer process. Confirm with the EspoCRM documentation which artifacts you must stage offline for your version.
The exact offline installation steps and supported components depend on your environment, so confirm them with your platform team and the current EspoCRM documentation before committing to a design.
How to lock down the integration path
An integration is a standing login that can read and write customer records without a person in the loop, so it needs the same scrutiny as any production account. The cards below cover the identity, credential, network and logging controls that together keep the EspoCRM REST API from becoming the weakest entry point into your CRM. Each one should be decided before the first integration goes live.
Dedicated API users with minimal roles
Create a separate API user for each integration, such as the website form, the ERP sync or the telephony connector, and assign it a role that grants only the entities and actions that integration needs. A single shared API user makes it impossible to tell which system changed a record and turns one leaked credential into full access. Review each role against the actual calls the integration makes, and confirm which fields the role can write, since broad write access on accounts or opportunities is the common over-permission.
EspoCRM API docsHMAC over basic authentication
The EspoCRM API supports API key, HMAC and basic authentication. The docs describe HMAC as the most secure method and basic authentication as not recommended, so basic authentication should be ruled out for any production integration. Confirm with your integration developers that the systems you connect, such as the ERP or telephony platform, can sign requests with HMAC before you commit to a design that cannot.
Read the API docsSecret storage and rotation
API keys and HMAC secrets should live in a secrets manager or the connected system's encrypted secret store, never in website source code, shared spreadsheets or chat threads. Record who holds each credential, which integration uses it, and when it was last rotated. Plan rotation as a routine task with a short overlap window so both old and new credentials work during the cutover, which avoids a sync outage each time a key changes.
IP restriction and TLS
Limit the API to the source addresses your integrations actually use, such as your web hosting or ERP servers, and deny everything else at the proxy or firewall. Serve the API only over TLS so keys and signatures are never sent in clear text across the network. Ask your hosting team to confirm that the Nginx, Apache or IIS layer in front of EspoCRM enforces both rules, since application settings alone do not replace network controls.
Admin accounts stay out of integrations
Never connect an integration with an administrator account, even during testing, because an admin credential can change roles, users and system settings. Keep integration users outside the admin group and separate from the staff accounts used for daily work. Review the admin list periodically and confirm that no integration user has been added to it by a later configuration change.
Token lifetime and access review
Check the authentication token lifetime settings that the EspoCRM security docs recommend limiting, and confirm how long a session or token stays valid after an integration secret is retired. Schedule a periodic access review that compares each API user against its documented purpose, disables users for retired integrations and removes roles that are no longer needed.
Logging and monitoring API activity
Log which API user made each request, the entity affected, the time and the source address, and send those logs to a place your security team reviews. Watch for unusual volumes, failed authentication bursts and writes from an integration outside its normal schedule. Confirm with your team which audit records EspoCRM keeps by default and which need to be forwarded from the web server or a central log store.
How to test that the integration works and fails safely
Test the permission boundary before you test the happy path. Create a dedicated API user with a role that grants only the entity types and actions the integration needs, then run a set of authorized and unauthorized calls against it. Authorized calls should succeed for the fields and scopes the role allows. Unauthorized calls should be refused: a read on an entity the role cannot see, a write to a field outside the integration's scope, and a delete the role should not hold. Use each authentication method your design allows, and confirm that a rejected key or HMAC signature produces a clear error rather than a partial write. Also test a deliberately malformed payload, such as a missing required field, a wrong data type or an unknown field name in the request body. The correct result is a rejected request with no record created or changed. If a malformed payload creates a half-populated record, the integration layer or the field validation needs fixing before go-live.
Test duplicates, outages and restarts as deliberate failures. Submit the same website form or order event twice and confirm that your idempotency key or duplicate matching rule stops a second record from being created. Then take the ERP offline and send a write that depends on it. The middleware should queue or retry the event, record the failure, and leave the EspoCRM record in a state someone can understand. Restart the middleware in the middle of a batch and check that it resumes without replaying completed items or skipping any. For each test, confirm the outcome in three places: the record itself (values, owner, team and related links), the audit history or stream for that record, and your integration log. The owner should be the API user or the intended service owner, not an administrator. Ask your partner or internal team to document the expected result for every case before running it, so a pass or fail is not a matter of opinion. Confirm exact behavior for webhooks and retries against the EspoCRM docs: API for your version, because retry and delivery semantics belong to your middleware and should be verified rather than assumed.
What to monitor, back up, upgrade and document after go-live
This table compares each operational area against what to watch, what to keep, and what to hand over after go-live. Read each row as a question to answer for your own environment before the integration is trusted with production data. The main takeaway is that API errors, sync queues and credentials need an owner, and that every EspoCRM upgrade in version 10 is run from the command line and followed by retesting the integrations.
| Area | What to watch or keep | Evidence to hand over |
|---|---|---|
| API error rates and latency | Track HTTP error codes and response times per API user, especially authentication failures and timeouts from websites, ERP, email and telephony callers | Alert thresholds agreed with the owner, and a dashboard or log view the on-call team can open |
| Failed-sync queue depth | Count records that failed to sync and how long they have waited, so duplicate or partial writes are caught early | Queue definition, retry rules and the steps for clearing or replaying failed items |
| Credential expiry | Record expiry dates for API keys and HMAC secrets, and the owner of each API user, before they lapse | Credential register with rotation dates and the process for revoking a compromised key |
| Cron health | Confirm that the scheduled job runner executes on time, since background jobs and queued processing depend on it | Cron schedule, last-run checks and an alert when runs stop |
| Backups of database and files | Back up the database and the uploaded files together, so restored records match their attachments | Backup schedule, storage location, and a recorded restore test with its result |
| Retesting after each EspoCRM upgrade | Upgrades in version 10 are run from the command line, not the UI, so schedule a regression pass of every inbound and outbound integration after each release | Test cases per integration, the results of the last run, and the upgrade record |
| Runbook and data-flow documentation | Document which system sends which fields, the sync direction, duplicate matching rules and the steps for common errors | Data-flow diagram, field mapping sheet, runbook and named owners for each integration |
Questions buyers ask about EspoCRM API integration
What does an EspoCRM API integration cost and what drives the price?
The cost depends on how many systems connect, how many objects and fields move, and how much logic sits between them. Each connection to a website, ERP, email or telephony system needs analysis, a build, error handling, duplicate rules and testing against a non-production instance. Ongoing costs include monitoring, fixing breaks after upgrades or vendor API changes, and changes when processes shift. Self-hosted EspoCRM is licensed under AGPL-3.0 and can be downloaded and self-hosted for free, so the spend is on the integration work and hosting, not on the core license. Ask any partner for a quote built from a written scope listing each connection, its direction, its objects and its sync rules.
How long does an EspoCRM integration take to build?
Duration follows scope more than any single factor. A one-way push of leads from a website into EspoCRM is far smaller than a two-way sync of accounts, contacts, orders and activities with an ERP that already holds its own customer records. The main time drivers are the number of systems, the number of directions each data type flows, the quality of the source data, how many duplicate rules need agreement, and how long business owners take to approve field mappings. Testing against realistic data and getting sign-off from the teams who own each system often takes longer than the code. Ask for a timeline tied to a fixed list of connections and acceptance criteria, and confirm which dependencies sit with your team.
What must our internal team provide before integration work starts?
Three things block most projects: a named owner for each connected system, API access, and test data. Each system owner should decide which fields are authoritative, who may change records, and how conflicts are resolved. Your infrastructure team must provide a non-production EspoCRM instance, a way to create dedicated API users, and network paths between systems. Test data should include normal records, incomplete records, duplicates and known edge cases such as unusual characters or missing currency codes. Also confirm who approves production access and who receives alerts when a sync fails.
Can our in-house team build the EspoCRM API integration themselves?
Yes, if the team has experience with REST APIs, authentication, queueing and data quality work, and the integration has a clear scope. EspoCRM documents its REST API, dedicated API users with role-based permissions, and several authentication methods, so the building blocks are available. The risks are usually in the less visible parts: handling retries without creating duplicates, keeping permissions tight, testing upgrades, and documenting the sync so the next person can maintain it. Compare your team's capacity with the list of connections, then decide whether to build, buy support, or split the work, with your team owning the business rules and a partner covering the harder build areas.
Is HMAC authentication required for the EspoCRM REST API?
HMAC is not strictly required by the product, but it is the method the EspoCRM documentation describes as the most secure. The REST API supports API key, HMAC and basic authentication through dedicated API users. The documentation describes basic authentication as not recommended. For most integrations, HMAC is the better choice because each request is signed with a secret rather than sending a reusable credential in plain form. Whichever method you choose, create a separate API user per integration, grant it only the entity and field permissions it needs, rotate secrets on a schedule, and keep the connection on TLS. Confirm the exact setup for your EspoCRM version in the documentation before building.
How does EspoCRM handle webhooks and what should we check?
Webhooks let EspoCRM notify another system when records change, which is useful for pushing updates to an ERP, a messaging tool or a telephony service. Before relying on them, confirm which events your EspoCRM version can emit, how the receiving endpoint is secured, and how failed deliveries are retried. Design the receiving side to be idempotent, so a repeated event does not create a second record. Log each event with its identifier, store a dead-letter queue for failures, and set alerts on repeated errors. Where the source of truth is the other system, use webhooks as triggers and reconcile on a schedule rather than trusting every event to arrive once and in order.
How should sync errors and duplicates be handled?
Start by defining a single source of truth for each field and a matching rule for each object, such as email plus company name for contacts. EspoCRM's import tool supports Create Only, Create and Update, and Update Only modes, duplicate matching on chosen fields, and reverting imported records, which is useful for testing. For live integrations, store the external identifier on each record, use upserts keyed on that identifier, and queue failed requests for retry with backoff. Log every rejected payload with enough detail to replay it. Review duplicate candidates on a regular cadence, and agree with system owners who resolves each type of conflict.
How DeployOpen works on this
DeployOpen plans, implements, integrates, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure. For EspoCRM REST API integration, that means agreeing the systems, API users, permissions and error handling in writing before any connector is built, then testing and documenting the result so your team can run it.
How we scope
- Inventory every system that will read or write CRM records, including the website, ERP, email and telephony tools.
- Define the API users, roles and entity permissions each integration needs, so no connector runs with admin rights.
- Agree in writing which authentication method, webhook events and duplicate rules apply, and what the engagement excludes.
How we build
- Create dedicated API users with role-based permissions and configure HMAC or API key authentication according to the agreed design.
- Build webhooks and sync jobs with logging, retry behavior and a defined owner for each failed record queue.
- Test duplicate matching and error paths in a non-production instance before any live data is exchanged between systems.
How we hand over
- Deliver written documentation covering each endpoint, user, role, credential location and scheduled job in the integration.
- Walk your administrators through the error logs, the reprocessing steps and how to rotate API credentials safely.
- Provide a short runbook for diagnosing sync failures, so your team can work through common faults without rebuilding the connector.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, and the scope of each is agreed in writing.
- Re-check the integration when EspoCRM is upgraded, since API behavior and permissions should be verified against each new release.
- Confirm with DeployOpen during scoping which events are covered by a retainer and how change requests are priced.

