The BDM Universal API provides a standardized interface for all BDM modules. This framework enables:
https://bdmhub.com/api/v1
For authenticated users. Include in Authorization header:
Authorization: Bearer YOUR_TOKEN_HERE
Authenticate and receive access token
Request Body:
{
"email": "user@example.com",
"password": "secret123"
}
Response (200 OK):
{
"success": true,
"message": "Logged in successfully",
"data": {
"token": "1|abc123def456...",
"user": {
"id": 1,
"name": "John Doe",
"email": "user@example.com"
}
}
}
Revoke current access token
For service-to-service communication. Prefix token with bdm_
Authorization: Bearer bdm_YOUR_API_TOKEN_HERE
For external access. No Authorization header needed - token is in URL:
GET /api/guest/resource/{TOKEN}
Share module access with other users with role-based permissions.
List all permissions for authenticated user
Query Parameters:
page - Page number (default: 1)per_page - Items per page (default: 15)module_slug - Filter by moduleResponse (200 OK):
{
"success": true,
"data": [
{
"id": 1,
"owner_user_id": 5,
"shared_with_user_id": 10,
"module_slug": "accounting",
"role": "manager",
"status": "active",
"expires_at": "2026-10-27T00:00:00.000000Z",
"created_at": "2025-10-27T10:00:00.000000Z"
}
],
"meta": {
"current_page": 1,
"total": 1,
"per_page": 15
}
}
Share module access with another user
Request Body:
{
"email": "colleague@example.com",
"module_slug": "accounting",
"role": "manager",
"expires_at": "2026-12-31"
}
Available Roles:
owner - Full access (cannot be assigned)admin - Nearly full access, cannot manage permissionsmanager - Daily operations, approvals, reportingstaff - Operational tasks, limited editingviewer - Read-only accessChange user's role
{
"role": "admin"
}
Revoke user's access to module
Provide secure, limited access to specific resources for external users.
Validate token and get security requirements
Response (200 OK):
{
"success": true,
"data": {
"valid": true,
"requires_password": true,
"requires_verification": false,
"resource_type": "accounting_invoice",
"guest_email": "customer@example.com",
"permissions": ["view", "download", "pay"],
"view_limit": 10,
"views_remaining": 8
}
}
Submit password and/or verification code
{
"password": "secret123",
"verification_code": "123456"
}
Access the resource
Response (200 OK):
{
"success": true,
"data": {
"invoice": {
"number": "INV-2025-001",
"customer_name": "Acme Corp",
"total": 1500.00,
"status": "unpaid",
"due_date": "2025-11-27"
}
}
}
Create and manage API tokens for service-to-service authentication.
List all API tokens for authenticated user
Create new API token
Request Body:
{
"name": "Production API",
"scopes": ["accounting.*", "stock_control.view"],
"rate_limit_per_minute": 200,
"expires_at": "2026-12-31"
}
Scope Patterns:
*.* - Full access to all modulesaccounting.* - Full access to accounting module*.view - View access to all modulesaccounting.invoices.view - Specific resource actionResponse (201 Created):
{
"success": true,
"data": {
"id": 1,
"name": "Production API",
"token": "bdm_abc123def456...",
"scopes": ["accounting.*", "stock_control.view"]
}
}
⚠️ Important: Store the token securely. It won't be shown again!
Revoke API token
List invoices with pagination and filters
Query Parameters:
page - Page numberper_page - Items per pagesearch - Full-text searchfilter[status] - Filter by status (paid, unpaid, overdue)sort_by - Sort fieldsort_order - asc or descExample Request:
GET /api/v1/accounting/invoices?filter[status]=unpaid&sort_by=due_date
Create new invoice
{
"customer_name": "Acme Corp",
"customer_email": "billing@acme.com",
"items": [
{
"description": "Web Development",
"quantity": 40,
"unit_price": 100.00
}
],
"notes": "Payment terms: Net 30"
}
| Auth Type | Per Minute | Per Hour |
|---|---|---|
| Authenticated User | 100 | 5,000 |
| API Token | Configurable | Configurable |
| Guest Access | 20 | 100 |
| Anonymous | 10 | 50 |
All responses include rate limit information:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 87 X-RateLimit-Reset: 1698765432
{
"success": false,
"message": "Error description",
"errors": {
"field": ["Error message"]
},
"meta": {
"timestamp": "2025-10-27T10:30:00Z"
}
}
| Code | Meaning |
|---|---|
| 200 | Success - GET, PUT, PATCH |
| 201 | Created - POST |
| 204 | No Content - DELETE |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 422 | Validation Error |
| 429 | Rate Limit Exceeded |
| 500 | Internal Server Error |