Documentation
© 2025 BDM Hub. All rights reserved.
Documentation v1.0
Complete REST API reference for integrating with BDM Plain CRM, including authentication, endpoints, and examples.
https://your-domain.com/api/crm
Bearer Token
1000 requests/hour
application/json
BDM Plain CRM uses Bearer token authentication. Include your API key in the Authorization header of every request.
Authorization: Bearer bdm_crm_your_api_key_here
Security Note: Never expose your API keys in client-side code or public repositories. Store them securely as environment variables.
/api/crm/overview
Get CRM statistics overview for dashboard widgets
{ "success": true, "data": { "contacts": { "total": 150, "active": 120, "prospects": 25, "customers": 95 }, "deals": { "total": 45, "open": 32, "value": 125000 }, "tasks": { "total": 28, "overdue": 5, "today": 8 } } }
/api/crm/contacts
Get paginated list of contacts with filtering
type
status
search
per_page
Create new contact
{ "first_name": "John", "last_name": "Doe", "email": "john@example.com", "phone": "+1234567890", "job_title": "CEO", "company_id": 1, "status": "prospect", "source": "website", "priority": "high" }
/api/crm/deals
Get paginated list of deals with filtering
contact_id
min_value
max_value
/api/crm/deals/{id}/status
Update deal status (commonly used for pipeline automation)
/api/crm/tasks
Get paginated list of tasks with filtering
priority
overdue
/api/crm/activities
Log new activity (used by other apps to track interactions)
{ "contact_id": 1, "type": "email_sent", "title": "Follow-up Email Sent", "description": "Sent pricing information", "source_app": "external-app", "metadata": { "email_subject": "Pricing Information", "campaign_id": "camp_123" } }
BDM Ecosystem Integration: These endpoints are specifically designed for seamless integration with other BDM applications.
/api/crm/integrations/mailer/contacts
Get contacts formatted for email campaigns
/api/crm/integrations/mailer/email-sent
Webhook to log email activity from BDM Mailer
GET /integrations/accounting/customers
POST /integrations/accounting/invoice-sent
GET /integrations/timelog/clients
POST /integrations/timelog/time-logged
/api/crm/webhook
General webhook endpoint for external integrations
{ "success": false, "message": "Error description", "errors": { "field_name": ["Validation error message"] } }
Default Rate Limit: API keys are limited to 1000 requests per hour by default. You can configure custom limits when creating API keys.
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 995 X-RateLimit-Reset: 1640995200
<?php // Create a new contact via API $apiKey = 'bdm_crm_your_api_key_here'; $baseUrl = 'https://yourdomain.com/api/crm'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $baseUrl . '/contacts'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ 'first_name' => 'John', 'last_name' => 'Doe', 'email' => 'john@example.com', 'status' => 'prospect' ])); $response = curl_exec($ch); if ($response !== false) { $data = json_decode($response, true); if ($data && isset($data['success']) && $data['success']) { echo "Contact created successfully!"; } else { echo "Error: " . ($data['message'] ?? 'Unknown error'); } } else { echo "cURL Error: " . curl_error($ch); } curl_close($ch); ?>
// Fetch CRM overview data async function getCrmOverview() { const apiKey = 'bdm_crm_your_api_key_here'; const baseUrl = 'https://yourdomain.com/api/crm'; try { const response = await fetch(`${baseUrl}/overview`, { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } }); const data = await response.json(); if (data.success) { console.log('Total contacts:', data.data.contacts.total); console.log('Open deals:', data.data.deals.open); } } catch (error) { console.error('Error:', error); } } getCrmOverview();
BDM Plain CRM API Documentation v1.0