Contacts API
Full contact management scoped to a firm. Each contact supports multiple phones, emails, addresses, and free-form tags. Includes bulk operations and seamless background CSV importing.
When to use this module
- Add or edit contacts → CRUD endpoints (
POST /contact/create,PUT /contact/update) - Organize contacts with labels → tagging endpoints (
PUT /contact/add-or-remove-tags) - Import contacts from spreadsheet → CSV import (
POST /contact/import/upload) - Send WhatsApp messages → contacts provide recipient data (phone numbers)
All Endpoints
| Method | Route | Auth | Description |
|---|---|---|---|
| POST | /api/V1/Contact/create | Create a new contact | |
| GET | /api/V1/Contact/get/{id} | Get contact by ID | |
| POST | /api/V1/Contact/getall | Paginated contact list (filter, sort, tag filter) | |
| PUT | /api/V1/Contact/update | Update contact + nested children (phones, emails, addresses) | |
| DELETE | /api/V1/Contact/delete | Soft-delete a single contact | |
| DELETE | /api/V1/Contact/bulkdelete | Bulk soft-delete by list of IDs | |
| GET | /api/V1/Contact/search | Search contacts (mode: whatsapp filters by phone) | |
| PUT | /api/V1/Contact/add-or-remove-tags | Add/remove tags on one contact | |
| PUT | /api/V1/Contact/bulk-add-or-remove-tags | Bulk tag operations across multiple contacts | |
| GET | /api/V1/Contact/tags/search | Search existing tag names in the firm | |
| POST | /api/V1/Contact/import/upload | Queue CSV import job (returns 202 Accepted) |
/api/V1/Contact/create
Add a new contact to your firm's database. This endpoint is powerful because you can include all of their phone numbers, email addresses, and postal addresses in just one single request.
Request Body
{
"firstName": "John",
"lastName": "Smith",
"gender": "Male",
"isActive": true,
"profilePic": "https://url.to.pic/john.png",
"phones": [
{ "phone": "9876543210", "phoneCC": "+91", "type": 1, "isPrimary": true }
],
"emails": [
{ "email": "john@company.com", "type": 1, "isPrimary": true }
],
"addresses": [
{
"type": 1,
"line1": "123 Main St",
"line2": "Suite 400",
"landmark": "Near Central Park",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"pinCode": "400001"
}
],
"tags": ["VIP", "Lead"]
}Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string(50) | required | Contact's first name |
lastName | string(50) | required | Contact's last name |
gender | string | optional | Male / Female / Other |
isActive | bool | optional | Defaults to true |
profilePic | string | optional | Azure Blob URL of profile picture |
phones | array | optional | List of phone entries; only one can be isPrimary |
emails | array | optional | List of email entries; only one can be isPrimary |
addresses | array | optional | List of postal addresses |
tags | string[] | optional | List of free-form tags |
/api/V1/Contact/getall
Retrieve your contacts in a neat, organized list. You can easily filter by tags, search by name, and sort the results exactly how you need them.
Request Body
{
"page": 1,
"pageSize": 20,
"searchTerm": "",
"sortBy": "firstName",
"sortDesc": false,
"tags": []
}Request Parameters
| Field | Type | Description |
|---|---|---|
page | int | 1-based page number |
pageSize | int | Number of records per page (max 100) |
searchTerm | string | Free-text search across name, email, phone |
sortBy | string | Field to sort by (e.g. firstName, lastName) |
sortDesc | bool | Descending sort when true |
tags | string[] | Filter to contacts having ALL listed tags |
/api/V1/Contact/search
Instantly find the right contacts. You can even filter specifically for contacts who have a valid phone number, making it perfectly suited for your WhatsApp campaigns.
?searchTerm=john&mode=whatsapp to restrict results to contacts with phone numbers. Omit mode for a general name/email search./api/V1/Contact/bulkdelete
Safely removes multiple contacts at once. The contacts are hidden from your active list and search results, but their historical data is kept safe in the background.
Request Body
{
"ids": [
"3fa85f64-5717-4562-b3fc-2c963f66afa6",
"7cb2a123-1234-5678-abcd-ef9876543210"
]
}/api/V1/Contact/add-or-remove-tags
Organize your contacts by adding or removing custom tags. You can create new tags on the fly—just type whatever label helps you categorize them best! Use /bulk-add-or-remove-tags to update multiple contacts at once.
Request Body
{
"contactId": "guid-here",
"tagsToAdd": ["VIP", "Lead"],
"tagsToRemove": ["Prospect"]
}Tag Search
Easily search through all the tags you've created. This is perfect for building autocomplete drop-downs in your own application.
/api/V1/Contact/import/upload
Quickly import a large list of contacts using a CSV file. You'll first upload your file through the File Upload section to get a unique file ID. Then, use this endpoint to start the import process in the background.
CSV Import Flow
Response (HTTP 202)
{
"isSuccess": true,
"data": null,
"message": "Import queued successfully"
}