Dolibarr REST API: connect your shop, CRM or AI agent
Enable the Dolibarr REST API, give each user its own key and see where the core API stops. How to connect your online shop, CRM or AI assistant.
Companies that run Dolibarr often end up in the same place. Orders land in a shop, customer records live in a CRM, and a colleague copies the same addresses and line items into the ERP by hand. Three systems, one set of data, and a growing pile of corrections.
The Dolibarr REST API is the built-in way out of that loop. This article covers what the API does, how to switch it on, what a user key grants, and where the core API stops.
What the Dolibarr REST API is
The Dolibarr REST API is a web interface shipped inside the ERP core that lets another program read and write Dolibarr records over HTTP. Dolibarr is an open-source ERP and CRM written in PHP, and the API runs in the same installation as the rest of the application.
A REST API is a set of HTTP endpoints where each URL maps to a resource, such as a third party, an invoice or a product, and each request states what to do with it. Your shop, your CRM or an AI assistant sends a request, Dolibarr checks who is asking, applies the change and returns the record.
How to enable the API and get a key
The REST API is switched off until you enable the REST/API web services entry in the Dolibarr setup area, in the modules list. Until then, every call to the API fails, whatever credentials you send.
Each Dolibarr user has an API key in their own user record under Users & Groups, and requests send it as the DOLAPIKEY parameter or as a header. Calls go to /api/index.php/ on your instance, for example /api/index.php/thirdparties.
An API key is a per-user secret that identifies the program making the request. One key per integration keeps the logs readable and lets you revoke a single channel without disturbing the others.
What the key can and cannot do
An API key inherits the permissions of the user who owns it, so a key is not a global admin pass. If the owner cannot open invoices in the Dolibarr interface, the key cannot list or create them either.
This is where integrations often go wrong first. A connector that works in a test environment with an administrator key starts returning permission errors in production once it runs as a restricted user. Decide early which user each integration impersonates, and give that user only the modules and rights it needs; a shop pushing orders does not need supplier invoices. When a call fails on permissions, check the user's rights before rewriting the request.
Where the core API stops
The core API does not cover Dolibarr evenly: some modules expose many endpoints, others expose few or none. Dolibarr's API Explorer, under Tools, lists the endpoints that exist on that particular installation, and the list changes with the modules you have enabled. Read it before promising an integration: confirm the operations you need exist, not only the object.
When an endpoint is missing you have to write it yourself, as a custom module or a patch. That is legitimate work, and the cost is not only the first version. Custom endpoints are code that must keep pace with Dolibarr versions, so every upgrade is an opportunity for them to break. Budget for maintenance, not just delivery.
Three integration patterns
Dolibarr integrations usually take one of three shapes: a shop, a CRM or an AI agent.
Online shop
For an online shop the usual flow is synchronisation of products, stock and orders: orders become Dolibarr orders or invoices, and stock levels travel back. Retries matter more than clever code, because a shop that submits the same order twice must not create two invoices.
CRM
Against an external CRM the API usually carries third parties, contacts and activities. The awkward part is identity: you need a rule for deciding whether an incoming record is a new company or an existing one under another spelling.
AI agent
An AI assistant needs a tool interface, not a raw HTTP client. Something has to turn an agent's intent into API operations, apply the permissions of the right user and stop before a write.
When a module beats custom code
A maintained module is usually the cheaper route when an integration needs more than a handful of endpoints, or when you expect to upgrade Dolibarr regularly.
EasyAPI is a Dolibarr module built by EasySoft Tech S.L. that provides a REST API with idempotent calls and an MCP server, so AI agents can query and write to Dolibarr. Idempotency means a repeated request produces the same result as the first one, which is what makes safe retries possible after a timeout.
MCP, the Model Context Protocol, is a standard way for AI assistants to discover and call the tools a server exposes.
EasyAI is the AI assistant module from EasySoft Tech S.L. It reads and writes through EasyAPI with the permissions of the logged-in user, shows a confirmation card before writing, and requires EasyAPI installed; the two are sold separately. For the shop case, the post on syncing WooCommerce with Dolibarr follows the order flow, and the checklist for putting an online store on top of an ERP covers the preparation work (the checklist is in Spanish).
FAQ
Does Dolibarr have a REST API out of the box? Yes. It ships in the core but stays inactive until you enable the REST/API web services entry in the modules list.
Is a Dolibarr API key the same as an admin password? No. Each key belongs to a user and inherits that user's permissions, so a key owned by a restricted user cannot read or write records that user could not open in the interface.
Which endpoints exist on my installation? The API Explorer under Tools lists them for that installation, and the list depends on the modules you have enabled. Anything missing there has to be written as a custom endpoint.
Can an AI assistant write to Dolibarr through the API? It can, provided something gives it a controlled tool interface. EasyAI does this on top of EasyAPI, applying the logged-in user's permissions and asking for confirmation before a write.
If you are weighing custom endpoints against a maintained module, describe your case through the contact page: which system you are connecting, which records move and how often. EasySoft Tech S.L. has worked with Dolibarr since 2019, is based in Oviedo, Spain, and replies to enquiries within 24 hours.
