The LeadSmart API exposes a RESTful API with the following resource endpoints. All endpoints are prefixed with /api/v1
.Authentication#
Authentication endpoints for user login, registration, and token management.Method | Endpoint | Description |
---|
POST | /auth/login | User login |
POST | /auth/register | User registration |
POST | /auth/refresh-token | Refresh JWT access token |
POST | /auth/logout | User logout |
POST | /auth/reset-password | Request password reset |
PUT | /auth/reset-password | Update password with reset token |
For more detailed documentation on each endpoint, explore the nested directories.Users#
Endpoints for user management.Method | Endpoint | Description |
---|
GET | /auth/me | Get current user profile |
PUT | /auth/me | Update current user profile |
GET | /auth/users | List all users (admin only) |
GET | /auth/users/:id | Get user by ID (admin only) |
PUT | /auth/users/:id | Update user (admin only) |
DELETE | /auth/users/:id | Delete user (admin only) |
Companies#
Endpoints for company management.Method | Endpoint | Description |
---|
GET | /companies | List all companies |
POST | /companies | Create a new company |
GET | /companies/:id | Get company by ID |
PUT | /companies/:id | Update company |
DELETE | /companies/:id | Delete company |
Members#
Endpoints for managing company members.Method | Endpoint | Description |
---|
GET | /members | List all members for current company |
POST | /members | Add a member to current company |
GET | /members/:id | Get member by ID |
PUT | /members/:id | Update member |
DELETE | /members/:id | Remove member |
Company Roles#
Endpoints for role management within companies.Method | Endpoint | Description |
---|
GET | /company-roles | List all roles |
POST | /company-roles | Create a new role |
GET | /company-roles/:id | Get role by ID |
PUT | /company-roles/:id | Update role |
DELETE | /company-roles/:id | Delete role |
Clients#
Endpoints for client management.Method | Endpoint | Description |
---|
GET | /clients | List all clients |
POST | /clients | Create a new client |
GET | /clients/:id | Get client by ID |
PUT | /clients/:id | Update client |
DELETE | /clients/:id | Delete client |
Client Threads#
Endpoints for managing client conversations.Method | Endpoint | Description |
---|
GET | /client-threads | List all client threads |
POST | /client-threads | Create a new client thread |
GET | /client-threads/:id | Get thread by ID |
PUT | /client-threads/:id | Update thread |
DELETE | /client-threads/:id | Delete thread |
Agendas#
Endpoints for agenda management.Method | Endpoint | Description |
---|
GET | /agendas | List all agendas |
POST | /agendas | Create a new agenda |
GET | /agendas/:id | Get agenda by ID |
PUT | /agendas/:id | Update agenda |
DELETE | /agendas/:id | Delete agenda |
Appointments#
Endpoints for appointment management.Method | Endpoint | Description |
---|
GET | /appointments | List all appointments |
POST | /appointments | Create a new appointment |
GET | /appointments/:id | Get appointment by ID |
PUT | /appointments/:id | Update appointment |
DELETE | /appointments/:id | Delete appointment |
Plans and Plan Durations#
Endpoints for plan management.Method | Endpoint | Description |
---|
GET | /plans | List all plans |
POST | /plans | Create a new plan |
GET | /plans/:id | Get plan by ID |
PUT | /plans/:id | Update plan |
DELETE | /plans/:id | Delete plan |
GET | /plan-durations | List all plan durations |
POST | /plan-durations | Create a new plan duration |
GET | /plan-durations/:id | Get plan duration by ID |
PUT | /plan-durations/:id | Update plan duration |
DELETE | /plan-durations/:id | Delete plan duration |
Messaging#
Endpoints for WhatsApp messaging integration.Method | Endpoint | Description |
---|
GET | /messaging/instances | List all messaging instances |
POST | /messaging/instances | Create a new messaging instance |
GET | /messaging/instances/:id | Get messaging instance by ID |
POST | /messaging/send | Send a message |
Integrations#
Endpoints for third-party service integrations.Method | Endpoint | Description |
---|
GET | /integrations/google/calendar | Google Calendar integration |
POST | /integrations/google/calendar/webhook | Google Calendar webhook receiver |
GET | /chatwoot-accounts | List Chatwoot accounts |
POST | /chatwoot-accounts | Add Chatwoot account |
OpenAI Integration#
Endpoints for OpenAI integration.Method | Endpoint | Description |
---|
GET | /openai-cred | List OpenAI credentials |
POST | /openai-cred | Add OpenAI credentials |
GET | /openai-bot | List OpenAI bots |
POST | /openai-bot | Create an OpenAI bot |
Vectors#
Endpoints for vector management.Method | Endpoint | Description |
---|
GET | /vectors | List all vectors |
POST | /vectors | Create a new vector |
GET | /vectors/:id | Get vector by ID |
PUT | /vectors/:id | Update vector |
DELETE | /vectors/:id | Delete vector |
Admin#
Administrative endpoints.Method | Endpoint | Description |
---|
GET | /admin/health | API health check |
GET | /admin/statistics | System statistics |
All API responses follow a standard format:{
"success": true,
"data": { ... },
"message": "Operation successful"
}
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Error message"
}
}
Modificado em 2025-04-24 22:28:03