CRMax Core documentation
Everything you need to install, configure and run your free, self-hosted CRM.
Overview
CRMax Core is a complete CRM in one small application: contacts and companies, each contact's emails and the replies to them, a deal pipeline with a sales forecast, tasks, lead-capture forms, email campaigns and workflow automation, saved views and a report builder, with two-factor sign-in and an audit log for your team. It is written in plain PHP with a SQLite database, so there is no framework, no Composer, no build step and no external services. You host it yourself, you own the data, and it is open-source under the MIT licence.
Requirements
- PHP 8.1 or newer with the
pdo_sqliteandcurlextensions (both are standard on nearly every host). - Any web server: Apache, nginx, Caddy, or PHP's own built-in server.
- Write access for the web server to the
data/folder.
Install
- Download the latest release and unzip it, or clone the repository.
- Upload the folder to your server (it works at the web root or in a subfolder).
- Make sure the web server can write to
data/(it is created automatically if missing). - Open the folder in your browser.
Try it locally in one command
unzip crmax-core.zip && cd crmax-core
php -S localhost:8000
# then open http://localhost:8000
Apache
Works out of the box. The bundled data/.htaccess blocks web access to the database.
nginx
location / { try_files $uri $uri/ =404; }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
location ^~ /data/ { deny all; return 404; }
First run
The first time you open CRMax Core it shows a short setup form. The first account you create becomes the administrator. The SQLite database installs itself on that first request - there is nothing else to configure to start. You can add the rest of your team afterwards in Settings.
Sending email (SMTP)
CRMax Core sends campaigns, workflow emails, emails written on a contact's page and form notifications through your own mail server. Go to Settings → Email accounts and add your provider's SMTP details, then use the Test button to confirm it works.
| Field | Example |
|---|---|
| SMTP host | smtp.yourprovider.com |
| Port / security | 587 with STARTTLS, or 465 with SSL |
| Username / password | your mailbox login |
| From email / name | the address campaigns are sent from |
Background jobs (cron)
Workflows and campaign sending run from a scheduled task. Add one line to cron so it runs every minute:
* * * * * php /path/to/crmax-core/cron.php >/dev/null 2>&1
Then tell the CRM its web address. Copy config.sample.php to config.php if you have none, and add:
return [
'base_url' => 'https://crm.example.com', // or https://example.com/crm when it lives in a subfolder
];
On the command line there is no web request to learn the address from. Without base_url, the unsubscribe and open-tracking links in campaign and workflow email sent by cron point at localhost and do not work. Run php cron.php once by hand to check: it prints a warning if the address is missing. Settings → Background jobs shows when cron last ran, and admins see a warning on every page while those links are broken.
Prefer HTTP? Set a cron_key in config.php and schedule a request to https://your-crm/cron.php?key=YOUR_KEY every minute. Call it at the CRM's public address, because that is the address the links in the email use.
Each run moves every workflow run that is due on to its next wait, and sends queued campaign email. One run takes 200 workflow steps at most; what is left is picked up by the next run.
php cron.php by hand to move them along while testing.AI (bring your own key)
AI features - such as drafting a campaign email from a short brief - are optional. In Settings → AI, paste your own Anthropic API key to turn them on. No key is included and nothing calls out unless you add one. A saved key shows as a row of stars: leave them to keep it, type over them to replace it, or tick Remove the saved key.
Team & roles
Invite colleagues in Settings → Team. There are two roles: Admin (full access, including settings and team) and Member (everything except settings). Everyone shares the same organisation's data.
Your own account. Each person changes their own password, sets up two-factor sign-in and signs out their other sessions on their account page: admins find it in Settings, members under Account in the menu.
Removing someone. Remove in Settings → Team first shows what that person owns and asks who takes over their contacts, companies, deals and tasks - another team member, or nobody, which leaves them unassigned. Everything moves in one step, the person taking over gets one email, and the person removed is taken out of lead routing.
Two-factor sign-in
With two-factor sign-in a password is not enough on its own: signing in also takes a 6-digit code from an authenticator app on the person's phone. Any app that does time-based codes works - Google Authenticator, Microsoft Authenticator, Authy and most password managers.
Turning it on. Everyone does this for their own account: Settings → Your account → Set up two-factor sign-in (members find it under Account in the menu). Scan the QR code with the app, type the code it shows, and it is on. The QR code is drawn by the CRM itself, so the secret in it never leaves your server. If the app cannot scan it, the same key is shown as text under the code, to type in by hand.
Recovery codes. Turning it on shows ten recovery codes, once. Each one signs you in a single time when the phone is not to hand. Keep them somewhere that is not that phone. The account page shows how many are left and makes new ones, and the old ones then stop working.
Signing in asks for the password, then the code. Until the code is accepted nothing in the CRM opens. A code works once. Codes from the 30 seconds either side are accepted, in case the phone's clock is a little out. Wrong codes are counted: six from one address, or eight against one account, lock the code step for ten minutes.
A new phone. The account page sets it up again from the start. The old phone keeps working until the new one is confirmed.
Requiring it. In Settings → Security an admin can tick "Require two-factor sign-in for everyone". Anyone who has not set it up is then taken to the set-up page the next time they open the CRM, and can use nothing else until it is done. You need it on your own account first. While it is required, nobody can turn theirs off. The API token is not a sign-in and is not affected.
When someone is locked out
- They lost their phone but have a recovery code: they sign in with it and set up the new phone.
- They have neither: an admin clicks Reset two-factor next to their name in Settings → Team. They are signed out everywhere and sign in with their password alone.
- Nobody can do that, because the only admin is the one locked out or has forgotten their password: run this on the server, in the CRM's folder.
php recover.php # lists the accounts
php recover.php 2fa-off you@example.com # turns two-factor sign-in off for that account
php recover.php password you@example.com # gives it a new random password, printed once
recover.php only runs from the command line; a browser gets "not found". Whoever can run commands on the server can already read the whole database, so it opens nothing new. What it does is written to the audit log as "Command line".
Other sessions. Your account page has Sign out my other sessions: every other browser and device signed in as you is signed out, and this one stays. Changing your password, and turning two-factor sign-in on or off, do the same.
data/crm.sqlite file. Keep data/ private and treat backups of it as you would passwords.Audit log
Settings → Security → Open the audit log (admins only) lists what was done, by whom, when and from which address, newest first:
- sign-ins, failed sign-ins (with the email address that was typed) and sign-outs;
- password changes, every two-factor change, and the API token being regenerated;
- team members added and removed, and what happened to the records of someone removed;
- changes to the organization, lead routing, email accounts and AI settings - that they changed, never a password or a key;
- every delete, with what was deleted, and companies merged;
- replies logged on a contact, and emails taken off a contact's Emails card;
- bulk assign, bulk tag and bulk delete, and CSV imports and exports with the number of rows;
- every change of owner or assignee, with who had it before, and campaigns sent.
Changes made through the API are recorded as "API", and what recover.php does as "Command line". Filter the log by kind, person, date or words, and download what the filter shows as CSV.
The log cannot be edited or cleared in the app. Lines are kept for 12 months and then removed, by cron.php or the next time the log is opened. It records addresses (IP) and the email address typed at a failed sign-in, so tell your team it exists if your local rules ask for that. The log starts when you install or update to 1.3: nothing is made up about what happened before.
Lead routing
Settings → Lead routing (admins only) decides who gets a new contact that arrives through a form, the API or a CSV import:
| Rule | What happens |
|---|---|
| Leave new leads unassigned | The default, and how earlier versions behaved |
| Give every new lead to one person | That person owns every new lead |
| Share them out in turn (round-robin) | Each new lead goes to the next person you ticked, whichever way it came in. Two leads arriving at the same moment never get the same turn |
A contact someone adds by hand is theirs unless they choose another owner. A lead who is already a contact keeps their owner. A CSV can name the owner itself in an owner column (a team member's email address or name) and the API takes owner_id; both win over the rule.
Assignment emails. When something is given to someone - a contact, company, deal or task, or a new lead routed to them - they get an email with a link to it, sent through your default email account. Nothing is sent until an email account is connected, nobody is emailed about something they give to themselves, and a bulk assign or a CSV import sends one summary instead of an email per contact. To switch these emails off, untick the box under Lead routing. The same box covers the email a contact's owner gets when a reply from their contact is logged.
Timezone, currency and install lock
Choose the organisation's timezone in Settings → Organization; dates, due dates and reports use it. To fix it for the whole server instead, set 'timezone' => 'Australia/Sydney' in config.php; that setting wins. Amounts show as $1,234.00 USD: 'currency' => 'AUD' changes the code after the amount and 'currency_symbol' the sign before it. On a public server, 'allow_install' => false stops a stranger creating the first account before you do: visitors see "Not set up yet" until you remove the line to create your own account. 'track_clicks' => false leaves the links in campaign email as written and counts no clicks (see Campaigns).
Contacts & CSV
Contacts are searchable and taggable, and each has notes, tasks, an Emails card and a full activity timeline. Use Import CSV to bring contacts in - columns recognised include first_name, last_name, email, phone, company, address and tags (comma separated). Existing contacts are matched by email, so re-importing updates rather than duplicates. Export CSV downloads the list as it is showing (see Lists & saved views); the Import box has a link to every contact in the import's own columns. Type a company on a contact (or import one) and the contact is linked to that company's record, which is created if it does not exist yet.
That file of every contact has an owner column, and an import can carry one (see Lead routing). Bulk actions: tick contacts on the list and a bar appears at the bottom of the window to assign them to someone, add a tag to them, or delete them in one go. Deleting asks first, and takes each contact's notes, tasks and history with it.
Emails & replies
A contact's page has an Emails card: the conversation with that person, both ways.
What is kept. Every email sent to the contact from that card, and every email a workflow sends them: the subject, the words, who sent it and when. Replies are kept when somebody logs them (below). Campaigns are not on the card: they are sent to many people at once and have their own counts. Only text is kept, up to 20,000 characters an email: no attachments, no HTML. The card shows the 60 newest emails.
Logging a reply. A reply to an email sent from the CRM lands in your own mailbox, because that is the address the email came from. Open the contact, choose Log a reply you received, and paste it in. The earlier emails quoted underneath are left out (untick the box to keep them), and you can say when it arrived and which of your emails it answers. Then:
- it is on the card and on the contact's timeline ("Reply received");
- the contact's owner is emailed what was written, unless they logged it themselves. This follows the same switch as assignment emails, under Lead routing;
- workflows that start on "A reply is received" start, and workflows set to stop when the contact replies stop (see Workflows).
Answering. Each email on the card has a Reply link. It fills in the subject and, when the email being answered has a Message-ID, the answer names it, so the contact's mail program keeps the two together. Every email sent from the CRM has one, and so does a reply that was sent in through the API with its message_id.
Removing. An email can be taken off the card. A reply that was logged by mistake goes from the timeline as well. The copy of an email that was sent is removed, but the email was sent, so "Email sent" stays on the timeline. Both are written to the audit log.
Having replies logged for you
The CRM does not read your mailbox. A script that does (a mail rule, a forwarding service, a few lines run by cron) can send each reply in through the API:
curl -X POST https://your-crm/api.php/messages \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"email":"dana@example.com","subject":"Re: Your quote","body":"Yes, please go ahead.",
"message_id":"<CAF12@mail.example.com>","in_reply_to":"<5f3c9a...@your-crm>"}'
The contact is found by contact_id, by email, or by in_reply_to: the Message-ID of the email being answered, which finds the contact even when they answer from another address. Give message_id and the same reply sent in twice is kept once. Mail from somebody who is not a contact is refused, so nothing but your contacts' replies can get in.
In lists and workflows
Contacts have three more fields to filter, sort and show as columns (see Lists & saved views): Last reply, Last email to them and Waiting for their reply, which is Yes when the last email to them is newer than their last reply. "Waiting for their reply is Yes" as a saved view is the list of people to chase, and a workflow's If can test the same fields.
Lists & saved views
Contacts, Companies, Deals and Tasks are lists that all work the same way. Deals have a list as well as the board: the List button on the pipeline opens it, and a deal's name in the list opens that deal on the board.
| On every list | What it does |
|---|---|
| Filters | Press Filters, add a filter, press Apply. A filter is a field, a test and a value: "Value is more than 5000", "Expected close is this quarter", "Owner is me", "Tags include vip". A record is shown when every filter holds. Text is compared without regard to upper and lower case |
| Dates that move | A date can be fixed ("is before 1 March") or move with the calendar: "is this quarter", "is in the last 30 days", "is before today". A view saved today is still right next quarter |
| Columns and sorting | Columns chooses what the table shows. A click on a column heading sorts by it; a second click turns the order round |
| Save view | Keeps the filters, the columns and the sort order under a name. A view is yours alone until you tick Share with the team. The list remembers the view you last chose until you sign out |
| Export CSV | Downloads the list as it is showing: the same records in the same order, every page of them, with the columns on screen |
| Pages | Long lists come 100 records to a page |
"Me" in a filter means whoever is looking, so one shared view shows each person their own records. Whoever saved a view can change or delete it, and an admin can also change or delete a shared one. Every list comes with standard views: for deals, Open deals, Closing this quarter, Past their close date, Won, Lost and All deals; for tasks, the four tabs. The search box and the Mine / Everyone / Unassigned choice narrow whatever view is showing and are not part of a saved view.
Custom fields. Whatever a form collected beyond the standard fields can be filtered on, shown as a column and sorted by on the contacts list.
Where else a view works. A saved view can be the audience of a campaign, a condition on a workflow (on what starts it, or as the test of an If step) and the start of a report. A view of contacts stands for those contacts. A view of companies, deals or tasks stands for the contacts linked to them: the people at those companies, the contact on each deal or task. A view that a draft campaign or a workflow uses cannot be deleted until that is changed.
Owners & assignment
Every contact, company and deal has an owner, and every task an assignee. Choose them on the contact form and the contact page, in the deal and company editors, and when you add a task. On a task, click the round badge with someone's initials to pass it to someone else.
The contacts list, the pipeline board, the task list and the dashboard each have a filter - Everyone, Mine, Unassigned or one person. It is remembered per page until you sign out, and what you add while it is on starts out with the person being shown.
Companies
A company record brings together everyone you know at a business, every deal with them and their combined activity. Companies appear automatically as you add them to contacts, or add one directly under Companies with a website, phone, industry, address, owner and notes. Matching is by name and ignores upper and lower case, so "Acme Pty Ltd" and "acme pty ltd" are the same company.
- Rename a company and the name updates on all of its contacts.
- Merge a duplicate into another company: its people and deals move across.
- Delete a company and its people and deals are kept, just no longer linked.
- Import CSV works for companies too (columns:
name,website,domain,phone,address,industry,notes), and the Import box links to every company in those columns. Export CSV downloads the list as it is showing.
Pipeline & deals
Create one or more pipelines with your own stages (edit them any time). Add deals and drag cards between stages. Click a deal to open its editor:
| Field | What it is for |
|---|---|
| Value and stage | How much the deal is worth and where it sits on the board |
| Expected close | The date you expect a decision. Overdue dates are flagged on the card, and the forecast groups deals by this month |
| Win probability | Leave it blank to use the stage's default, or set your own percentage for this deal |
| Company and contact | Who the deal is with. A new deal takes its contact's company unless you choose another |
| Owner and notes | Who in your team is running it, and anything worth remembering |
Under Edit stages you can give each stage a default win probability; left blank, the stages are spread evenly. Column headers show the count, the total value and the weighted value in each stage. Mark a deal Won or Lost to take it off the board - a lost deal can record why. Closed deals are listed under the board and can be reopened.
The List button shows every deal in every pipeline as a table, with what the deals on the page add up to and their weighted value. Filter it, sort it, save views of it and export it like any other list (see Lists & saved views).
Reports
Reports → New report builds a report from four choices: the records (contacts, companies, deals or tasks), filters (the same ones as on a list), what to group by (owner, stage, pipeline, status, source, tag, company, industry, or a month: added, closed, expected to close, due) and what to measure. Every kind of record can be counted. Deals can also be added up, averaged, weighted by win probability, or turned into a win rate: the deals won out of those won and lost. The result shows as bars or as a table, and downloads as CSV.
Save a report to keep it. Tick Share with the team to let everyone open it, and Show on the dashboard to pin it there for everyone who can see it. The Report button on any list starts a report from the records that list is showing. Five reports come ready-made: Forecast by month, Pipeline by owner, Win rate by source, Overdue tasks by owner, and Campaign results. Change one and save it under a name of your own.
Below the list of reports, Reports gives an overview that starts with a sales forecast: every open deal counts for its value multiplied by its win probability, grouped by the month it is expected to close. Deals without a close date, and deals whose date has passed, are shown separately so nothing is hidden. Next to it are your win rate, average won deal, average days to close and the most common reasons deals were lost, followed by new contacts by month, lead sources, pipeline by stage and email results.
Forms
Build a lead-capture form in Forms by adding fields (give a field the key first_name, last_name, email, phone or company to map it onto a contact). Share the public link, or embed the form on your website:
<iframe src="https://your-crm/f.php?s=your-form" style="width:100%;max-width:520px;height:560px;border:0"></iframe>
Every submission becomes a contact and is recorded against the form. Tick Email me each submission to get notified, and a submission can trigger a workflow.
Campaigns
Write a campaign, pick who it goes to (all contacts, a single tag, or a saved view), choose which email account to send from, and send. Merge tags like {{first_name}} and {{company}} are filled in per contact. Opens and clicks are tracked and every email carries a one-click unsubscribe link; unsubscribed contacts and contacts without an email address are skipped automatically. The editor shows how many contacts an audience reaches as you choose it. Delivery happens in the background via cron.
Clicks are counted by pointing each link at the CRM, which notes the click and sends the reader straight on. Things to know:
- Only links with a fixed
http://orhttps://address are tracked. A link that holds a merge tag, amailto:link and the unsubscribe link are left exactly as written. - The CRM only ever sends a reader on to an address that was stored for that campaign when it was sent, and only for a link it signed itself. A link that was changed goes nowhere.
- A reader counts once under Clicks however often they click, and the campaign page lists each link with all its clicks. A click also counts as an open, because many mail apps never load the tracking image.
- Mail scanners that open links to check them are counted like any reader, so read the numbers as a guide.
- Links are tracked only when the CRM knows a public address for itself (see Background jobs). On a trial at
localhostthey are left as written, so they still open. - Deleting a campaign keeps its stored links, so the links in email already sent go on working.
- To switch click tracking off, put
'track_clicks' => falseinconfig.php.
Workflows
A workflow runs a list of steps for a contact when something happens. Workflows → New workflow builds one. It starts paused - activate it when it is ready. Steps run from the cron job.
| Trigger | Starts the workflow when |
|---|---|
| A contact is created | A contact is added by hand, by a form, by an import or through the API |
| A form is submitted | Any form, or the one you choose |
| A tag is added | The contact gains any tag, or the one you name |
| A contact is given to an owner | Anyone, or the person you choose: by hand, in bulk, by lead routing or through the API |
| A deal is created, won or lost | In any pipeline, or the one you choose. The workflow runs for the contact on the deal |
| A task is completed | The workflow runs for the contact the task is about |
| A reply is received | A reply from the contact is logged on their page, or sent in through the API (see Emails & replies) |
A deal or a task with no contact starts nothing. Any trigger can be limited to the contacts in a saved view: choose it under Only for contacts in the saved view. The contact has to be in the view at the moment the trigger happens. In a filter there, "me" means the person who saved the view.
| Step | What it does |
|---|---|
| Wait | Pause for a number of minutes, hours or days |
| Wait until | Pause until the next time it is a given time on a working day, on any day or on a named weekday, in your timezone. Later the same day counts when that time has not passed yet |
| If | Test the contact. When the test fails, skip the next steps (you say how many) or end the workflow |
| Send email | Email the contact (merge tags work), with an unsubscribe link. A contact who has unsubscribed or has no email address is passed over. What was sent is kept on the contact's Emails card |
| Add tag | Tag the contact |
| Create task | Add a follow-up task, due in N days, for the contact's owner |
| Create deal | Open a deal for the contact in a pipeline and stage, with a value. It belongs to the contact's owner and company |
| Update field | Set the first name, last name, phone, company, address, source or a custom field. Leave the value empty to clear it. The email address cannot be changed, because contacts are matched on it |
| Assign owner | Give the contact to one person, or to several people in turn. The new owner gets the usual assignment email |
| Notify a team member | Email the contact's owner, or a person you choose. The contact's details and a link to the contact are added to what you write |
| Stop | End the workflow for the contact |
What an If can test
- A field of the contact - every field and test the Contacts filters have: tags (include, do not include), any field empty, equal to or containing something, custom fields, the owner, unsubscribed, when they last replied, whether you are waiting for their reply.
- An open deal - in any pipeline, or in one pipeline at or past a stage.
- A deal won lately - in the last so many days.
- The last campaign sent to them - whether they opened it, or clicked a link in it. Someone who was never sent a campaign has done neither.
- A saved view - whether the contact is in it.
Each of the last four can be turned round ("has no open deal", "did not open"). A field test has its own opposites ("is not", "do not include").
Branches
The steps under an If are the ones it can skip, and the editor indents them. To do one thing for some contacts and another for the rest, end the first group with a Stop:
1 If Tags include "vip", otherwise skip the next 2 steps
2 Notify the contact's owner
3 Stop
4 Wait 2 days
5 Send email
A VIP gets steps 2 and 3. Everyone else goes from step 1 to step 4.
Stop early. A workflow can also end, whatever step a contact is at, when the contact has a tag you name, wins a deal after entering, replies after entering, or unsubscribes. That is checked before every step. The CRM knows about a reply once it is logged or sent in through the API (see Emails & replies).
Merge tags work in emails, task titles, deal names, field values and notifications: {{first_name}}, {{last_name}}, {{name}}, {{email}}, {{phone}}, {{company}}, {{owner}} and {{org}}, and in a workflow started by a deal or a task also {{deal}}, {{deal_value}} and {{task}}.
Try it on a contact
On a saved workflow's page, type a contact's name or email address to see the path they would take if the workflow started for them now: which way each If goes, what would be sent and to whom. Nothing is sent and nothing is changed. A wait is not waited out, so the steps after it are tried against the contact as they are today.
Run history
The History button shows what a workflow did, contact by contact: every step that ran, how each test went, and why an email was not sent. It also lists the times the workflow did not start for a contact, and why. A contact's own page lists the workflows they have been through. The history is kept for 30 days.
How runs behave
- A run takes every step up to its next wait in one pass of cron.
- A contact is never in the same workflow twice at once.
- Pausing a workflow stops it taking contacts in. Contacts who are part-way through carry on.
- If you change the steps while contacts are part-way through, each carries on from the same step number in the new list.
- Workflows can start each other: a tag that one adds, a deal it creates or an owner it sets starts the workflows that listen for that. They never start each other in a circle.
- A workflow holds 50 steps at most, and one run is stopped after 200 steps. A step that fails is tried again ten minutes later, and after five failures the run is stopped. The history says so in each case.
- A task or a deal made by a workflow sends nobody an email. Add a Notify step if someone should hear.
- When a team member is removed, steps and triggers that named them name whoever takes over their records.
Search
The box at the top of the sidebar looks through contacts, companies and deals at once: a name, an email address, a phone number, a company or a deal. It shows the first 20 of each, with a link to the full list for more.
REST API
Create a token in Settings → REST API and send it as a Bearer header.
curl -H "Authorization: Bearer <token>" https://your-crm/api.php/contacts
curl -H "Authorization: Bearer <token>" https://your-crm/api.php/me
# create or update a contact (de-duplicated by email)
curl -X POST https://your-crm/api.php/contacts \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"first_name":"Dana","email":"dana@example.com","tags":["web"],"source":"api"}'
# create a deal, then mark it won
curl -X POST https://your-crm/api.php/deals \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"name":"Website rebuild","value":4800,"company":"Acme Pty Ltd","close_date":"2027-03-31"}'
curl -X POST https://your-crm/api.php/deals/12 \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"status":"won"}'
| Endpoint | Returns |
|---|---|
GET /me | Organisation name, app version + counts |
GET /contacts?q=&owner_id=&limit= | List / search contacts; owner_id narrows the list to one owner (0 = unassigned) |
GET /contacts/{id} | A single contact |
POST /contacts | Create or update (by email). company links or creates the company; tags replaces the tags (leave it out to keep them); owner_id sets the owner (0 for nobody) - without it a new contact follows the lead routing rule and an existing one keeps its owner |
GET /companies?q=&limit= | List / search companies |
GET /companies/{id} | A single company |
POST /companies | Create or update (by name) |
GET /deals?status=&owner_id= | Deals: open (default), won, lost or all; owner_id narrows the list to one owner |
GET /deals/{id} | A single deal |
POST /deals | Create a deal: name, plus optional value, stage, pipeline_id, contact_id, company, close_date, probability, owner_id, notes |
POST /deals/{id} | Update a deal - only the fields you send change. status takes open, won or lost |
GET /messages?contact_id=&limit=, GET /messages/{id} | A contact's emails, both ways, newest first, or one of them |
POST /messages | Log an email with its contact: a reply that arrived in your mailbox (the default), or with "direction": "out" an email you sent from somewhere else. Say whose it is with contact_id, the contact's email, or in_reply_to (the Message-ID of an email sent from the CRM). Also subject, body (text), message_id, at (when it arrived; now if left out) and trim_quoted (false keeps the earlier emails quoted under it). Answers 201, or 200 with "duplicate": true when an email with that message_id is already kept, and 404 when no contact matches |
GET /pipelines | Pipelines, their stages and each stage's win probability |
GET /users, GET /users/{id} | The team: id, name and role for each person, to make sense of owner_id. Read-only, and no email addresses |
Contacts, companies and deals carry owner_id (0 = unassigned). A write that gives a contact or a deal to someone emails that person, as it does in the app; add "notify": false to the body to skip the email, for example when syncing many records.
A reply logged with POST /messages does what a reply logged by hand does: it goes on the contact's timeline, the contact's owner is emailed, and workflows that listen for a reply start or stop. "notify": false skips the email to the owner. There is an example under Emails & replies.
Add-ons
An add-on extends CRMax Core without changing its files, so updating stays a plain file replace. Put it in addons/<name>/addon.php; it registers callbacks with addon_on() for events (a contact is deleted, a team member is added), extra cards on the dashboard, contact page and Settings, sidebar items, and a few rules. The hooks are listed in the README. Add-ons run with the app's full access to the database, so install only ones you trust.
Backups
Everything lives in data/crm.sqlite. Copy that file to back up, and replace it to restore. Because SQLite runs in WAL mode, either copy crm.sqlite, crm.sqlite-wal and crm.sqlite-shm together, or stop traffic first.
Security
- Keep
data/out of the web root, or rely ondata/.htaccess(Apache) or the nginxdenyrule above. From version 1.1 the app writes that.htaccessfile itself if it is missing. If you installed 1.0 from a git clone on Apache, upgrade, then check thathttps://your-crm/data/crm.sqliteis refused. - Always run behind HTTPS in production - session cookies are marked secure automatically over HTTPS.
- CSRF protection, login rate-limiting and HTML sanitisation of saved content are built in.
- Turn on two-factor sign-in, at least for admins, and consider requiring it for everyone.
- The audit log shows who signed in and what was changed, exported or deleted.
- Links in campaign email pass through
l.php. It redirects only to addresses stored when the campaign was sent, and only for links it signed, so it cannot be used to send people somewhere else. - Filters, sort orders and columns are checked against a fixed list of fields before they reach the database, and every value a person types is bound, never pasted into a query.
- A backup of
data/crm.sqliteholds everything, including what two-factor sign-in relies on. Store backups as carefully as the live file.
Updating
Download the newer release and replace the application files, keeping your data/ folder (and config.php if you created one). The database applies any schema changes automatically on the next request. Upgrades only ever add tables and columns, so nothing you have is changed or removed - but copy data/crm.sqlite somewhere safe first, as you would before any upgrade.
1.0 to 1.1: every company name already typed on a contact becomes a company record and the contacts are linked to it. Deals already won or lost get a closed date, and open deals start with their stage's default win probability.
1.1 to 1.2 (this also brings the 1.1.1 fixes). The database gains who created each task and a few indexes. Things to know:
- If cron runs from the command line, add
base_urltoconfig.php(see Background jobs). In 1.1.0 the unsubscribe links in email sent by cron pointed atlocalhostand did not work. - Once an email account is connected, people are emailed when a contact, company, deal or task is given to them. Switch that off under Lead routing if you do not want it.
- Earlier versions removed a team member without asking what should happen to their records, which left them owned by nobody you could see. The update marks those records unassigned: find them with the Unassigned filter and hand them to someone with the bulk Assign action. In the API their
owner_idnow reads0. - Lead routing starts as "leave new leads unassigned", so forms, the API and CSV import behave as before until you choose a rule.
- Workflows that start when a tag is added now run (in 1.1.0 they never started), so look over any active ones first. A task created by a workflow now goes to the contact's owner.
- Updating a contact through the API without
tags, or importing a CSV without a tags column, no longer clears the contact's tags. Workflow emails now carry an unsubscribe link. - The timezone chosen in Settings now takes effect. The contacts CSV export has one more column at the end,
owner.
1.2.0 to 1.2.1: nothing in your data changes. On Linux servers, 1.2.0 showed every amount with 262145 in front of it (26214541,000.00 instead of $41,000.00), because PHP on most Linux systems already has a constant with the name 1.2.0 used for the currency sign. The amounts stored in the database were always right, and Windows servers were not affected. Replace the files and amounts show correctly again. The currency_symbol setting in config.php keeps its name; an add-on that reads the constant CURRENCY_SYMBOL should call money() instead.
1.2 to 1.3: the database gains what two-factor sign-in needs on each account, and the audit log. Nothing existing changes: nobody is signed out by the update, every account starts with two-factor sign-in off, and passwords work as before. Things to know:
- There are four new files:
twofa.php,audit.php,qr.phpandrecover.php. Upload all of them. - Two-factor sign-in is there for anyone who wants it, and is not required until an admin says so under Settings → Security.
- Members now have an Account link in the menu, for their password, two-factor sign-in and sessions. Until 1.3 only admins had a link to that page.
- Changing your password now signs out your other sessions.
- The audit log starts empty and records from the update on.
- Fixed: someone signed out elsewhere, or back after two weeks away, could meet "Bad request (CSRF)" on their first try at signing in again.
- Fixed in Settings → AI: saving the form with the stars still in the key field stored the stars as the key, and an empty field removed it. Now the stars, or an empty field, keep the key and a tick box removes it. If AI drafting stopped working after you saved that form, paste your key in again.
- The contact and company CSV files are written and read as plain CSV: a backslash is just a backslash. On PHP 8.4 the old way could put a warning line inside an exported file.
- API: nothing changes. Every field 1.0 to 1.2 returned is still there with the same meaning.
1.3 to 1.4: the database gains three tables (saved views, saved reports, campaign links) and two click counters. Nothing existing changes: nobody is signed out, every list opens on the same records as before, and campaigns sent before the update keep their numbers. Things to know:
- There are six new files:
_views.php,_reports.php,deals.php,report.php,search.phpandl.php. Upload all of them: the app does not start without_views.phpand_reports.php. - The Export CSV button on Contacts and Companies now downloads the list as it is showing, with the columns on screen. The file the import reads (every record, in the import's columns) is a link in the Import box; its address,
contacts.php?export=1, has not changed. - Lists show 100 records to a page, where they used to show the first 500 and stop.
- The search box on Contacts also finds a first and last name typed together. A
%or_typed into a search box is now a plain character. - Campaigns sent from now on count clicks. Campaigns sent before the update show no clicks, because their links were not tracked. A click also counts as an open.
- Fixed: an open could be counted twice when a mail app loaded the tracking image twice at the same moment.
- Tasks: the four tabs are the same lists as before, and the address
tasks.php?f=donestill works. - New and optional:
track_clicksinconfig.php. - API: nothing changes. Every field 1.0 to 1.3 returned is still there with the same meaning.
1.4 to 1.5: the database gains the workflow run history and a step counter on each run. Nothing existing changes: nobody is signed out, a workflow made before the update has the same steps and runs them in the same order, and a contact who is part-way through one carries on from the step they were at. Things to know:
- There is one new file,
_workflows.php. Upload it: the app does not start without it. - A run now takes every step up to its next wait in one pass of cron. Until 1.5 it took one step per pass, so three steps in a row took three minutes.
- The run history starts empty. Runs from before the update are listed without their steps.
- In a workflow email, what a merge tag stands for is now put in as text. A company called "A & B" used to go in as raw HTML.
- A contact's timeline now says "Workflow email" only when the email was sent. It used to say so even when no email account was connected or the mail server refused the message. The run history gives the reason.
- Saving a workflow that is limited to a saved view which has since been deleted keeps the limit (it takes nobody in). It used to drop the limit without saying so, and the workflow then took everyone in.
- The editor has a Delete this workflow button. Deleting a workflow also removes its run history.
- The new triggers do nothing until you make a workflow that uses them.
- API: nothing changes. Every field 1.0 to 1.4 returned is still there with the same meaning.
1.5 to 1.6: the database gains one table, for the emails kept with each contact, and two dates on each contact. Nothing existing changes: nobody is signed out, and every contact, workflow and list is as it was. Things to know:
- There is one new file,
_messages.php. Upload it: the app does not start without it. - The Emails card starts empty. Emails sent before the update were never kept, only noted on the timeline, and they stay there. From the update on, each email sent from a contact's page or by a workflow is kept with its words.
- "Last email to them" is filled in from each contact's timeline, so people you emailed before the update count as waiting for a reply until one is logged. "Last reply" starts empty.
- The "Send an email" card on a contact is now part of the Emails card. It works as before.
- The switch for assignment emails, under Lead routing, now also covers the email a contact's owner gets when a reply from their contact is logged.
- The Message-ID an email goes out under is now kept with the email on the contact's card. Nothing to do: it is what lets a reply be matched to the email it answers.
- The new trigger and the new "stop when the contact replies" rule do nothing until a workflow uses them.
- API: one new endpoint,
/messages. Every field 1.0 to 1.5 returned is still there with the same meaning.
Frequently asked questions
Is it really free?
Do I need a database server like MySQL?
data/crm.sqlite). There is nothing to install or configure.Where is my data stored, and who can see it?
How does it send email?
Does it send my data to an AI provider?
Can my whole team use it?
Does it have two-factor sign-in?
Can I see who changed or deleted something?
Can I save a filtered list and use it again?
Can I build my own reports?
Does it track clicks in campaign emails?
config.php switches it off. See Campaigns.Can a workflow do different things for different contacts?
How do I find out why a contact did not get a workflow email?
Can I see the emails I have exchanged with a contact?
Does it read the replies in my mailbox?
Can I use it for my business / commercially?
How do I back up and restore?
data/crm.sqlite to back up; put it back to restore. See Backups for the WAL note.