The Express backend serves a JSON API on port 4000. Sign in to get a JWT, then send it as Authorization: Bearer <token> on every other request.
Authentication
| Method | Endpoint | Description |
|---|
| POST | /api/auth/signup | Create an account |
| POST | /api/auth/login | Sign in and receive a token |
| GET | /api/auth/me | Get the current user |
Leads
| Method | Endpoint | Description |
|---|
| GET | /api/leads | List leads |
| POST | /api/leads | Create a lead |
| PATCH | /api/leads/:id | Update a lead |
| DELETE | /api/leads/:id | Delete a lead |
| POST | /api/leads/import | Import leads from CSV |
Campaigns, calls and scripts
| Method | Endpoint | Description |
|---|
| GET | /api/campaigns | List campaigns |
| POST | /api/campaigns | Create a campaign |
| GET | /api/call-logs | List call logs |
| POST | /api/call-logs | Log a call |
| GET | /api/scripts | List call scripts |
Example
curl -X POST http://localhost:4000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"your-password"}'
curl http://localhost:4000/api/leads -H "Authorization: Bearer <token>"
The exact request and response fields are defined in backend/src/routes/ in the repository.