Leadsmart
    Leadsmart
    • API Reference
    • Docs
      • LeadSmart API Documentation
      • Services
      • Middleware
      • Integrations
      • Database
      • Architecture
    • Authentication
      • Register
        POST
      • Update User
        PATCH
      • Login
        POST
      • Logout
        POST
      • Reset Password
        POST
      • Change Email
        POST
      • Request Password Reset
        POST
      • Request Email Change
        POST
      • Verify Email
        GET
    • Companies
      • Create Company
        POST
      • Join Company
        POST
      • Get All User Company
        GET
      • Get user Company
        GET
      • Update Company
        PATCH
      • Deactivate Company
        PATCH
      • Activate Company
        PATCH
      • Reset Invite Code
        PATCH
    • Members
      • Create a Member
        POST
      • Get All Member
        GET
      • Get Single Member
        GET
      • Update Member
        PATCH
      • Deactivate Member
        PATCH
      • Activate Member
        PATCH
    • Agendas
      • Create Company Agenda
      • Get All Agendas
      • Get Single Agenda
      • Get Agenda with Appoint
      • Get Available Slots
      • Update Agenda
      • Delete Agenda
      • Activate Agenda
      • Create Agenda Integration
      • Delete Agenda Integration
    • Appointments
      • Create Appointment
      • Get All Appointments
      • Get Appointment
      • Add Members
      • Delete Members
      • Update Appointment
      • Update Date
    • Plans
      • Get Single Plan
      • Get All Plans
      • Create Plan
      • Delete Plan
      • Update Plan
    • Plans Duration
      • Get Single Plan Duration
      • Create Plan Duration
      • Delete Plan Duration
      • Update Plan Duration
    • Company Roles
      • Get Single Company Role
      • Get All Company Roles
      • Create Company Role
      • Delete Company Role
      • Update Company Role
    • Clients
      • Get All Clients
      • Create Client
      • Get Client By Id
      • Update Client
      • Delete Client
    • Client Threads
      • Get All By Client
      • Get All By Instance
      • Create Client Thread
      • Get Client By Id
      • Update Client
      • Delete Client Thread
    • Admin
      • Get All Plans Duration
      • Get All Plans
      • Create Plan
      • Get All Members
      • Get All Companies
    • Chatwoot Accounts
      • Get Chatwoot Account
      • Update Chatwoot Account
      • Delete Chatwoot Account
      • Create Chatwoot Account
    • Integrations
      • Tokens
        • Fetch All Tokens
        • Fetch Token
        • Update Token
        • Remove Token
      • Google
        • Create Auth URL
        • Regenerate Auth URL
        • Renew Google Webhook
      • External Calendar
        • Create External Event
        • Update External Event
        • Delete External Event
        • Validate Calendar Id
        • Fetch External Calendars
    • Messaging
      • Instances
        • Create Instance
        • Get All Instance
        • Get Instance
        • Update Instance
        • Connect Instance
        • Disconnect Instance
        • Activate Instance
        • Deactivate Instance
      • Message
        • Send Message
    • AI Keys
      • Get All AI Keys
      • Get AI Keys By ID
      • Create AI Key
      • Update AI Key
      • Delete AI Key
    • Agent Prompts
      • Get All Agent Prompts
      • Get Agent Prompt By ID
      • Create Agent Prompt
      • Update Agent Prompt
      • Delete Agent Prompt
    • Agent Configuration
      • Get All Agent Configurations
      • Get Agent Configuration By ID
      • Create Agent Configuration
      • Update Agent Configuration
      • Delete Configuration Prompt
    • Agent Prompt Versions
      • Get All Agent Prompt Versions
      • Get Agent Prompt Version By ID
      • Create Agent Prompt Version
      • Update Agent Prompt Version
      • Delete Agent Prompt Version

    API Reference

    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.
    MethodEndpointDescription
    POST/auth/loginUser login
    POST/auth/registerUser registration
    POST/auth/refresh-tokenRefresh JWT access token
    POST/auth/logoutUser logout
    POST/auth/reset-passwordRequest password reset
    PUT/auth/reset-passwordUpdate password with reset token
    For more detailed documentation on each endpoint, explore the nested directories.

    Users#

    Endpoints for user management.
    MethodEndpointDescription
    GET/auth/meGet current user profile
    PUT/auth/meUpdate current user profile
    GET/auth/usersList all users (admin only)
    GET/auth/users/:idGet user by ID (admin only)
    PUT/auth/users/:idUpdate user (admin only)
    DELETE/auth/users/:idDelete user (admin only)

    Companies#

    Endpoints for company management.
    MethodEndpointDescription
    GET/companiesList all companies
    POST/companiesCreate a new company
    GET/companies/:idGet company by ID
    PUT/companies/:idUpdate company
    DELETE/companies/:idDelete company

    Members#

    Endpoints for managing company members.
    MethodEndpointDescription
    GET/membersList all members for current company
    POST/membersAdd a member to current company
    GET/members/:idGet member by ID
    PUT/members/:idUpdate member
    DELETE/members/:idRemove member

    Company Roles#

    Endpoints for role management within companies.
    MethodEndpointDescription
    GET/company-rolesList all roles
    POST/company-rolesCreate a new role
    GET/company-roles/:idGet role by ID
    PUT/company-roles/:idUpdate role
    DELETE/company-roles/:idDelete role

    Clients#

    Endpoints for client management.
    MethodEndpointDescription
    GET/clientsList all clients
    POST/clientsCreate a new client
    GET/clients/:idGet client by ID
    PUT/clients/:idUpdate client
    DELETE/clients/:idDelete client

    Client Threads#

    Endpoints for managing client conversations.
    MethodEndpointDescription
    GET/client-threadsList all client threads
    POST/client-threadsCreate a new client thread
    GET/client-threads/:idGet thread by ID
    PUT/client-threads/:idUpdate thread
    DELETE/client-threads/:idDelete thread

    Agendas#

    Endpoints for agenda management.
    MethodEndpointDescription
    GET/agendasList all agendas
    POST/agendasCreate a new agenda
    GET/agendas/:idGet agenda by ID
    PUT/agendas/:idUpdate agenda
    DELETE/agendas/:idDelete agenda

    Appointments#

    Endpoints for appointment management.
    MethodEndpointDescription
    GET/appointmentsList all appointments
    POST/appointmentsCreate a new appointment
    GET/appointments/:idGet appointment by ID
    PUT/appointments/:idUpdate appointment
    DELETE/appointments/:idDelete appointment

    Plans and Plan Durations#

    Endpoints for plan management.
    MethodEndpointDescription
    GET/plansList all plans
    POST/plansCreate a new plan
    GET/plans/:idGet plan by ID
    PUT/plans/:idUpdate plan
    DELETE/plans/:idDelete plan
    GET/plan-durationsList all plan durations
    POST/plan-durationsCreate a new plan duration
    GET/plan-durations/:idGet plan duration by ID
    PUT/plan-durations/:idUpdate plan duration
    DELETE/plan-durations/:idDelete plan duration

    Messaging#

    Endpoints for WhatsApp messaging integration.
    MethodEndpointDescription
    GET/messaging/instancesList all messaging instances
    POST/messaging/instancesCreate a new messaging instance
    GET/messaging/instances/:idGet messaging instance by ID
    POST/messaging/sendSend a message

    Integrations#

    Endpoints for third-party service integrations.
    MethodEndpointDescription
    GET/integrations/google/calendarGoogle Calendar integration
    POST/integrations/google/calendar/webhookGoogle Calendar webhook receiver
    GET/chatwoot-accountsList Chatwoot accounts
    POST/chatwoot-accountsAdd Chatwoot account

    OpenAI Integration#

    Endpoints for OpenAI integration.
    MethodEndpointDescription
    GET/openai-credList OpenAI credentials
    POST/openai-credAdd OpenAI credentials
    GET/openai-botList OpenAI bots
    POST/openai-botCreate an OpenAI bot

    Vectors#

    Endpoints for vector management.
    MethodEndpointDescription
    GET/vectorsList all vectors
    POST/vectorsCreate a new vector
    GET/vectors/:idGet vector by ID
    PUT/vectors/:idUpdate vector
    DELETE/vectors/:idDelete vector

    Admin#

    Administrative endpoints.
    MethodEndpointDescription
    GET/admin/healthAPI health check
    GET/admin/statisticsSystem statistics

    Request and Response Format#

    All API responses follow a standard format:
    {
      "success": true,
      "data": { ... },
      "message": "Operation successful"
    }
    For error responses:
    {
      "success": false,
      "error": {
        "code": "ERROR_CODE",
        "message": "Error message"
      }
    }
    Modificado em 2025-04-24 22:28:03
    Próxima página
    LeadSmart API Documentation
    Built with