📖 Introduction

DoliPulse provides a REST API and webhook system that allows you to integrate Dolibarr ERP/CRM with external applications, services, and workflows.

🚀 Getting Started

🔗 Base URL

All API endpoints are relative to the base URL below.

/dolipulse/api/

🔒 Authentication

DoliPulse uses API key-based authentication.

Send your API key in the X-API-Key header with every request:

# cURL
curl -X GET "https://your-dolibarr.com/dolipulse/api/thirdparties" \ -H "X-API-Key: dol-your-api-key-here" \ -H "Content-Type: application/json"
// PHP
$ch = curl_init('https://your-dolibarr.com/dolipulse/api/thirdparties'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-API-Key: dol-your-api-key-here', 'Content-Type: application/json' ]); $response = curl_exec($ch);
// JavaScript (fetch)
fetch('https://your-dolibarr.com/dolipulse/api/thirdparties', { headers: { 'X-API-Key': 'dol-your-api-key-here', 'Content-Type': 'application/json' }})
# Python
import requests; headers = {'X-API-Key': 'dol-your-api-key-here', 'Content-Type': 'application/json'}; response = requests.get('https://your-dolibarr.com/dolipulse/api/thirdparties', headers=headers)

Permissions

API keys have granular permissions.

Rotate your API keys regularly.

📋 API Endpoints

The following tables list all available API endpoints organized by category.

🤖 AI Agent Rutinleri

Agent rutinleri, yapay zeka destekli işlemleri otomatikleştirmek ve akıllı iş akışları oluşturmak için kullanılan özel API uç noktalarıdır.

GET /api/index.php/dolipulse/agent/session
Yeni bir agent oturumu başlatır veya mevcut oturumu getirir.
// Örnek istek
curl -X GET "https://dolibarr-adresiniz.com/dolipulse/api/agent/session" \
-H "X-API-Key: dol-api-anahtarınız"

// Başarılı yanıt
{"success":true,"data":{"session_id":"sess_abc123","created":"2026-06-20T10:00:00Z","expires":"2026-06-20T11:00:00Z"}}
POST /api/index.php/dolipulse/agent/chat
Agent'a bir prompt/mesaj gönderir ve yanıt alır. Doğal dil işleme ile veri sorgulama, rapor oluşturma, işlem yapma.
// Örnek istek
curl -X POST "https://dolibarr-adresiniz.com/dolipulse/api/agent/chat" \
-H "X-API-Key: dol-api-anahtarınız" \
-H "Content-Type: application/json" \
-d '{"session_id":"sess_abc123","message":"Bu ayki ödenmemiş faturaları listele","context":{"module":"invoices","action":"list_unpaid"}}'

// Başarılı yanıt
{"success":true,"data":{"reply":"Bu ay toplam 23 adet ödenmemiş fatura bulunuyor.","action_taken":"query","results_count":23}}
POST /api/index.php/dolipulse/agent/memory
Agent'ın bağlam hafızasını yönetir. Oturumlar arası bilgi taşıma, kullanıcı tercihlerini saklama.
// Örnek istek
curl -X POST "https://dolibarr-adresiniz.com/dolipulse/api/agent/memory" \
-H "X-API-Key: dol-api-anahtarınız" \
-d '{"session_id":"sess_abc123","action":"store","key":"last_report","value":"monthly_sales_2026_06","ttl":86400}'

// Başarılı yanıt
{"success":true,"data":{"stored":true,"key":"last_report","expires_at":"2026-06-21T10:00:00Z"}}
POST /api/index.php/dolipulse/agent/workflows
Agent tabanlı çok adımlı iş akışlarını başlatır ve yönetir.
// Örnek istek
curl -X POST "https://dolibarr-adresiniz.com/dolipulse/api/agent/workflows" \
-H "X-API-Key: dol-api-anahtarınız" \
-d '{"session_id":"sess_abc123","trigger":"new_customer_onboarding","params":{"company_name":"Acme Corp"}}'

// Başarılı yanıt
{"success":true,"data":{"workflow_id":"wf_456","status":"started","steps":[{"step":1,"action":"create_thirdparty","status":"completed"},{"step":2,"action":"send_welcome_email","status":"pending"}]}}
POST /api/index.php/dolipulse/agent/delegation
Bir görevi başka bir agent'a veya kullanıcıya devreder.
// Örnek istek
curl -X POST "https://dolibarr-adresiniz.com/dolipulse/api/agent/delegation" \
-H "X-API-Key: dol-api-anahtarınız" \
-d '{"session_id":"sess_abc123","task":"approve_invoice_42","delegate_to":"user_admin","priority":"high"}'

// Başarılı yanıt
{"success":true,"data":{"delegation_id":"del_789","status":"pending","assigned_to":"user_admin","notified":true}}
GET /api/index.php/dolipulse/agent/recommendations
AI destekli öneriler ve içgörüler alın.
// Örnek istek
curl -X GET "https://dolibarr-adresiniz.com/dolipulse/api/agent/recommendations" \
-H "X-API-Key: dol-api-anahtarınız" \
-d '{"session_id":"sess_abc123","context":"dashboard","limit":5}'

// Başarılı yanıt
{"success":true,"data":[{"type":"stock_alert","message":"Ürün #45 stokta sadece 12 adet kaldı.","priority":"high"},{"type":"cashflow","message":"Önümüzdeki 7 günde 45.000 TL tahsilat bekleniyor.","priority":"medium"}]}

💻 Code Examples

Practical examples showing how to use the API for common tasks.

📈 Response Format

All API responses follow a consistent JSON structure.

Successful Response: {"success": true, "data": {}|[], "pagination": {"page": 1, "limit": 50, "total": 250}}
Error Response: {"success": false, "error": {"code": 404, "message": "Resource not found"}}
HTTP Status Codes: 200, 201, 204, 400, 401, 403, 404, 429, 500

📄 Pagination & Filtering

List endpoints support pagination, sorting, and filtering through query parameters.

Example: GET /thirdparties?page=2&limit=20&sort=nom&order=ASC&search=acme

Webhooks

Real-time event notifications to your HTTP endpoints.

🔧 Overview

Webhooks provide real-time event-driven communication.

📄 Available Events

Subscribe to any combination of these events:

📦 Webhook Payload

All webhook deliveries follow this JSON structure:

{"event":"thirdparty.create","timestamp":1718700000,"entity":1,"data":{"id":42,"ref":"CUST001","nom":"Acme Corporation"}}

🔒 Signature Verification

Every webhook includes an X-DoliPulse-Signature header. Verify it to ensure the request came from DoliPulse:

// PHP
$secret = 'your-webhook-secret'; $payload = file_get_contents('php://input'); $signature = $_SERVER['HTTP_X_DOLIPULSE_SIGNATURE']; $expected = hash_hmac('sha256', $payload, $secret); if (hash_equals($expected, $signature)) { http_response_code(200); } else { http_response_code(403); }
// Node.js
const crypto = require('crypto'); const secret = 'your-webhook-secret'; const payload = JSON.stringify(req.body); const signature = req.headers['x-dolipulse-signature']; const expected = crypto.createHmac('sha256', secret).update(payload).digest('hex');
# Python
import hmac, hashlib; secret = b'your-webhook-secret'; payload = request.get_data(); signature = request.headers.get('X-DoliPulse-Signature'); expected = hmac.new(secret, payload, hashlib.sha256).hexdigest()

🔄 Retry Policy

If your endpoint does not respond with a 2xx status within 10 seconds, DoliPulse retries using exponential backoff:

    After 3 consecutive failures, the event is moved to a Dead Letter Queue.

    💡 Best Practices

      🛠 Webhook Management via API

      Error Handling

      The API returns standard HTTP status codes with descriptive error messages.

      Rate Limiting

      API access is rate-limited to ensure fair usage and system stability.

      Rate Limit: 300 requests per minute per API key

      Rate limit information is included in response headers:

        FAQ & Troubleshooting

        Home