Chatwhizz Client Group & Team External API

BaseUrl: /
Token key in Request header: api_token (copy it from Admin panel > API Config)
Request body: JSON with header Content-Type: application/json (form-encoded also accepted)
Response: { "status": 1 or 0, "data": ... } — status 0 means the request was rejected and data holds the reason
Token errors: HTTP 401 { "status": 0, "message": "No Token Provided" | "Invalid Token" | "Token Expired" }
Users: team members and consultants are referenced by email and must be active users of the organisation (not clients or operators)
Team List API

Teams created from the admin panel or through this API. Teams a user creates for themselves are not listed.

Request TypeGET
Request URLbaseUrl + auth/team/list
Expected Output :
{
    "status": 1,
    "data": [{
        "name": "Sales Team",
        "uniqueId": "sales-team",        // use this to update/delete the team or add it to a client group
        "members": [{
            "name": { "firstName": "John", "lastName": "Doe" },
            "email": "john@example.com"
        }],
        "createdAt": "2026-10-09T10:15:37.377Z",
        "updatedAt": "2026-10-09T10:15:37.377Z"
    }]
}
Create Team API
Request TypePOST
Request URLbaseUrl + auth/team/add
Required Fields (In body parameter) :
nameteam name, up to 100 characters
memberslist of user emails, e.g. ["john@example.com", "jane@example.com"] or "john@example.com,jane@example.com"
Optional Fields :
uniqueIdunique id of the team in the organisation. Generated from the name when left out. Saved in lowercase, with spaces and symbols turned into "-" (e.g. "Sales Team" becomes "sales-team")
Payload Example :
{
    "name": "Sales Team",
    "uniqueId": "sales-team",
    "members": ["john@example.com", "jane@example.com"]
}
Expected Output :
{
    "status": 1,
    "data": { ...team, same shape as Team List }
}
Errors (status 0) :
"Users not found: a@example.com, b@example.com"   // email is not an active user of the organisation
"Team name is required (max 100 characters)"
"Unique Id is required"                           // name/uniqueId has no letters or digits
"Select at least one user"                        // members is empty
"Unique Id already exists"
Update Team API

Only the fields you send change. Sending members replaces the whole member list.

Request TypePUT
Request URLbaseUrl + auth/team/update
Required Fields (In body parameter) :
uniqueIdcurrent unique id of the team to update
Optional Fields :
namenew team name
newUniqueIdnew unique id
membersnew list of user emails (replaces the current members)
Payload Example :
{
    "uniqueId": "sales-team",
    "name": "Sales Team India",
    "newUniqueId": "sales-team-india",
    "members": ["john@example.com", "ravi@example.com"]
}
Expected Output :
{
    "status": 1,
    "data": { ...team, same shape as Team List }
}
Errors (status 0) :
"Team not found"
"Users not found: a@example.com"
"Unique Id already exists"                        // newUniqueId is taken by another team
"Some selected users are not allowed"             // a current member is no longer active; send members
Delete Team API

Client groups already created with this team keep their members.

Request TypeDELETE
Request URLbaseUrl + auth/team/delete
Required Fields (In body or query string) :
uniqueIdunique id of the team, e.g. baseUrl + auth/team/delete?uniqueId=sales-team
Expected Output :
{
    "status": 1,
    "data": "Team deleted"
}
Errors (status 0) :
"Team not found"
Create Client Group API

Members come from three lists that are merged: clients, consultants and teams. A user found in more than one list is added once. Each team is replaced by its members at the time of the request; later changes to the team do not change the group. A group needs at least 2 members.

Request TypePOST
Request URLbaseUrl + auth/client-group/add
Required Fields (In body parameter) :
groupNamename of the client group
Optional Fields :
clients

list of client objects. Each client has these fields:

firstNamerequired
emailrequired. An email that is not yet a client creates (or converts) a client account, which counts against the plan's user limit.
lastNameoptional
sendAccountEmailoptional. true mails the new client their login details.
whatsappNumberoptional. Full number with country code, digits only, no "+", e.g. "919876543210". Makes the client a WhatsApp client. Needs WhatsApp set up for client groups (WhatsApp addon with a Consultant Chat number). A group can have only one WhatsApp client, and a WhatsApp client can belong to only one group.
countryCoderequired with whatsappNumber, e.g. "+91". whatsappNumber must start with these digits.
consultantslist of emails of active users to add as consultants
teamslist of team unique ids; all members of each team are added as consultants
showSenderNametrue or false, show sender names to clients (default true)
Payload Example :
{
    "groupName": "Acme Corp",
    "clients": [{
        "firstName": "Jo",
        "lastName": "Smith",
        "email": "jo@acme.com",
        "whatsappNumber": "919876543210",
        "countryCode": "+91",
        "sendAccountEmail": true
    }],
    "consultants": ["john@example.com"],
    "teams": ["sales-team", "support-team"],
    "showSenderName": true
}
Expected Output :
{
    "status": 1,
    "data": "Client group created successfully",
    "groupId": "6706578c9f1b2c0012ab34cd"     // id of the new client group
}
Error Output :

Errors come back with an HTTP error status and status 0; data holds the reason.

{
    "status": 0,
    "data": "jo@acme.com is already a WhatsApp client of group \"Acme Corp\"",
    "groupId": "6706578c9f1b2c0012ab34cd"     // only on this error: the group the client already chats in over WhatsApp
}
Errors :
HTTP statusdata
400"Group name is required"
"clients must be a list"
"Each client needs firstName and a valid email"
"Duplicate client email"
"A group can have only one WhatsApp client"
"whatsappNumber must be the full number starting with countryCode"
"A group needs at least 2 members"
402"you add only 2 new clients" (plan user limit left for new clients)
"You have reached your plan limit"
403"WhatsApp is not set up for client groups"
"jo@acme.com is blocked by admin"
404"Organisation not found"
"Users not found: a@example.com" (consultant email is not an active user)
"Teams not found: sales-team"
409"jo@acme.com is already a WhatsApp client of group "Acme Corp"" (also returns groupId; sent only when the email and the WhatsApp number both match that client)
"jo@acme.com and the WhatsApp number belong to different users"
"WhatsApp number 919876543210 is already registered with another email"
"jo@acme.com is already registered with another WhatsApp number"
"jo@acme.com is registered for user or operator" (a client email belongs to a user/operator)
500"Something went wrong"
Update Client Group API

Rename an existing group, change its sender-name setting, or add and remove clients and consultants. The group is picked by the groupId returned when it was created. Removals run first. Consultants already in the group are skipped, so a team can overlap the group. A client already in the group is rejected. Removing an email that is not a member does nothing. Send at least one of the optional fields.

Request TypePUT
Request URLbaseUrl + auth/client-group/update
Required Fields (In body parameter) :
groupIdid of the client group (the groupId from Create Client Group)
Optional Fields (send at least one) :
groupNamenew name of the client group
showSenderNametrue or false, show sender names to clients
activetrue or false. Set to false to disable (block) the client group; set to true to re-enable it.
addConsultantslist of emails of active users to add as consultants
removeConsultantslist of user emails to remove
addTeamslist of team unique ids; all members of each team are added as consultants
addClients

list of client objects to add. Same rules as Create Client Group. Each client has these fields:

firstNamerequired
emailrequired. An email not yet registered creates a new client account, which counts against the plan's user limit.
lastNameoptional
sendAccountEmailoptional. true mails the new client their login details.
whatsappNumberoptional. Full number with country code, digits only, no "+", e.g. "919876543210". Makes the client a WhatsApp client. Rejected when the group already has a WhatsApp client (one removed in the same request does not count).
countryCoderequired with whatsappNumber, e.g. "+91". whatsappNumber must start with these digits.
removeClientslist of client emails to remove
Payload Example :
{
    "groupId": "6706578c9f1b2c0012ab34cd",
    "groupName": "Acme Corp (EU)",
    "addConsultants": ["john@example.com"],
    "removeConsultants": ["old@example.com"],
    "addTeams": ["support-team"],
    "addClients": [{ "firstName": "Jo", "email": "jo@acme.com", "sendAccountEmail": true }],
    "removeClients": ["former-client@acme.com"]
}
Expected Output :
{
    "status": 1,
    "data": {
        "groupId": "6706578c9f1b2c0012ab34cd",
        "active": true,      // current active status of the group (false when disabled)
        "added": 2,           // members added (duplicates skipped)
        "removed": 1          // members removed
    }
}
Errors (status 0) :
"Valid groupId is required"
"Client group not found"
"Nothing to update"                               // none of the optional fields sent
"Group name is required"                          // groupName sent empty
"Users not found: a@example.com"                  // an add/remove email is not a user of the org
"Teams not found: sales-team"
"addClients must be a list"
"Each client needs firstName and a valid email"
"Duplicate client email"
"jo@acme.com is already in the group"
"A group can have only one WhatsApp client"
"jo@acme.com is registered for user or operator"
"jo@acme.com is blocked by admin"
the other WhatsApp errors listed under Create Client Group ("already a WhatsApp client of group" also returns groupId)
"you add only 2 new clients"
HTTP 400 when the plan's user limit is already reached
Client Group Details API

One client group with its settings and members, split into consultants and clients. The group is picked by the groupId returned when it was created.

Request TypeGET
Request URLbaseUrl + auth/client-group/details
Required Field (In query parameter)
groupIdid of the client group (the groupId from Create Client Group)
Expected Output :
{
    "status": 1,
    "data": {
        "groupId": "6706578c9f1b2c0012ab34cd",
        "groupName": "Acme Corp",
        "showSenderName": true,
        "active": true,                    // false when the group is blocked
        "createdBy": null,                 // { name, email } of the user who made it; null when made by the admin panel or this API
        "createdAt": "2026-10-09T10:15:37.377Z",
        "updatedAt": "2026-10-09T10:15:37.377Z",
        "consultants": [{
            "name": { "firstName": "John", "lastName": "Doe" },
            "email": "john@example.com",
            "chatStatus": true,            // false when the member is restricted from chatting
            "addedAt": "2026-10-09T10:15:37.377Z",
            "addedBy": null,               // { name, email } of the user who added them, if any
            "isAdmin": false               // group admin
        }],
        "clients": [{
            "name": { "firstName": "Jo", "lastName": "Smith" },
            "email": "jo@acme.com",
            "chatStatus": true,
            "addedAt": "2026-10-09T10:15:37.377Z",
            "addedBy": null,
            "whatsappNumber": "919876543210",
            "countryCode": "+91",
            "isWhatsappClient": true,      // chats with the group over WhatsApp
            "optedOut": false              // WhatsApp client opted out of messages
        }]
    }
}
Errors (status 0) :
"Valid groupId is required"
"Client group not found"
Client Details API

One client of the organisation, found by email.

Request TypeGET
Request URLbaseUrl + auth/client/details
Required Field (In query parameter)
emailemail of the client
Expected Output :
{
    "status": 1,
    "data": {
        "name": { "firstName": "Jo", "lastName": "Smith" },
        "email": "jo@acme.com",
        "whatsappNumber": "919876543210",  // "" when the client has no WhatsApp number
        "countryCode": "+91",
        "blocked": false,                  // true when blocked by admin
        "createdAt": "2026-10-09T10:15:37.377Z",
        "updatedAt": "2026-10-09T10:15:37.377Z"
    }
}
Errors (status 0) :
"Valid email is required"
"Client not found"                   // no client with this email (users and operators are not clients)
Update Client API

Change a client's name, email or WhatsApp number. The client is picked by its current email. Fields left out keep their current value. The new name also shows in every group the client is in. Send at least one of the optional fields.

Request TypePUT
Request URLbaseUrl + auth/client/update
Required Fields (In body parameter) :
emailcurrent email of the client
Optional Fields (send at least one) :
firstNamenew first name; cannot be empty
lastNamenew last name
newEmailnew email; must not belong to another account of the organisation
whatsappNumberFull number with country code, digits only, no "+", e.g. "919876543210". Needs WhatsApp set up for client groups. Send "" to remove the number; the client then stops being a WhatsApp client in every group.
countryCoderequired with whatsappNumber, e.g. "+91". whatsappNumber must start with these digits.
Payload Example :
{
    "email": "jo@acme.com",
    "firstName": "Joanna",
    "lastName": "Smith",
    "newEmail": "joanna@acme.com",
    "whatsappNumber": "919876543210",
    "countryCode": "+91"
}
Expected Output :
{
    "status": 1,
    "data": "Client updated successfully"
}
Errors (status 0) :
"Valid email is required"
"Nothing to update"                                 // none of the optional fields sent
"Client not found"
"First name is required"
"Invalid user name"                                 // name contains HTML tags
"newEmail is not a valid email"
"WhatsApp is not set up for client groups"
"whatsappNumber must be the full number starting with countryCode"
"Email ID Already Exist"
"WhatsApp Number Already Exist"