Overview
⚠️ The following information might not be entirely correct. Please refer to the developers if you find out-of-date info on this page. ⚠️
The Flux CRM API allows both frontend components and external systems to interact with the platform through a wide range of endpoints. The API is designed to support operations related to customer management, contract creation, product and service tracking, employee management, and more. All API routes are defined in api.php and adhere to REST principles, with requests sent as GET, POST, PUT, or DELETE.
Base URL
All API requests should be made to the following base URL:
/api
Authentication
The Flux CRM API is protected via authentication, typically using Bearer Tokens. Clients must include the Authorization header with each request:
Authorization: Bearer <access_token>
Authentication is required for accessing most endpoints, with exceptions being made for public endpoints (if applicable).
General Guidelines
- Versioning: All API requests are versioned to maintain backward compatibility. The current version is:
/api/v1
-
Rate Limiting: Requests to the API are rate-limited to prevent abuse:
- Authenticated Requests: 100 requests per minute.
- Unauthenticated Requests: 10 requests per minute.
-
Response Format: All responses are returned in JSON format. A typical successful response looks like:
{
"status": "success",
"data": {...}
}
Error responses follow this structure:
{
"status": "error",
"message": "Error message",
"errors": {...}
}
- Error Codes:
200 OK: The request was successful.201 Created: A new resource was successfully created.400 Bad Request: Invalid input or missing data.401 Unauthorized: Authentication failed.403 Forbidden: Insufficient permissions.404 Not Found: The requested resource was not found.500 Internal Server Error: An unexpected error occurred.
Core Modules
The API is organized into various modules, each of which is responsible for handling specific aspects of the system. The core modules are:
- Customer Management: Endpoints related to creating, updating, and deleting customer information.
- Contract Management: Endpoints for managing customer contracts, linking products and services to contracts, and tracking contract statuses.
- Product and Service Management: Endpoints for managing the products and services offered by the company.
- Employee and Timesheet Management: Endpoints for tracking employee data, working hours, and vacation days.
- Notifications: Endpoints for managing user notifications related to system events.
- Financial Data and Payments: Endpoints for tracking payments, invoices, and accounting data.
Folder Structure for API Endpoints
The following folders are used to organize the documentation for specific endpoint groups:
- Customer Management:
/docs/api-documentation/customers - Contract Management:
/docs/api-documentation/contracts - Product and Service Management:
/docs/api-documentation/products-services - Employee Management:
/docs/api-documentation/employees - Notifications:
/docs/api-documentation/notifications - Payments and Accounting:
/docs/api-documentation/payments
Each folder contains detailed documentation of the relevant endpoints, including:
- Available HTTP methods (e.g.,
GET,POST,PUT,DELETE) - Required parameters and request bodies
- Example requests and responses
- Error handling and response codes
How to Use the API
-
Authenticate: Obtain a valid authentication token by logging in or using another authentication method. Include this token in the
Authorizationheader for all API requests. -
Send Requests: Use the API endpoints to perform operations such as creating a customer, managing contracts, or retrieving notifications.
-
Handle Responses: Check the response format for success or error messages and handle them appropriately in your application.
-
Rate Limit Monitoring: Ensure you stay within the rate limits to avoid being throttled by the system.