CRM & Contacts
Manage your contact database (phonebook) and contact groups.
List Contacts
Get paginated list of contacts.
Query Parameters
| Parameter | Type | Constraints | Description |
|---|---|---|---|
page | number | Integer ≥ 1 (default 1) | Page index. |
pageSize | number | Integer 1–100 (default 20) | Rows per page. |
search | string | Substring (LIKE on name, company, mobiles) | Free-text filter. |
groupId | number | Maps to Category column | Only contacts in that group. |
Example
curl -G "https://www.HomaCRM.com/api/v1/external/crm/contacts" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Accept: application/json" \
--data-urlencode "page=1" \
--data-urlencode "pageSize=30" \
--data-urlencode "search=رضا" \
--data-urlencode "groupId=5"
Create Contact
Create a new contact.
Request Body
| Field | Type | Required | Valid values / constraints | Description |
|---|---|---|---|---|
mobile | string | Yes | Must normalize to 09XXXXXXXXX; duplicate Mobile per portal → 409 | Primary mobile. |
firstName | string | No | Stored as NVARCHAR | First name. |
lastName | string | No | — | Last name. |
email | string | No | — | Email. |
companyName | string | No | — | Company title. |
groupId | number | No | Integer; Category | Contact group. |
mobile2 | string | No | Same mobile rules as mobile if provided | Second mobile. |
mobile3 | string | No | — | Third mobile. |
phone | string | No | Landline / tel | Stored in Tell. |
nationalCode | string | No | — | National ID. |
address | string | No | — | Postal address. |
city | number | No | Portal city dictionary ID | City. |
province | number | No | Portal province dictionary ID | Province. |
notes | string | No | — | Tozihat field. |
Example
curl -X POST "https://www.HomaCRM.com/api/v1/external/crm/contacts" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Content-Type: application/json" \
-d '{
"mobile": "09121112233",
"firstName": "رضا",
"lastName": "کریمی",
"companyName": "فروشگاه نمونه آریا",
"email": "reza.karimi@example.com",
"mobile2": "09123334455",
"mobile3": "",
"phone": "02188776655",
"nationalCode": "0123456789",
"address": "تهران، خیابان ولیعصر، پلاک ۱۲۳، واحد ۴",
"city": 1001,
"province": 8,
"groupId": 5,
"notes": "مشتری وفادار؛ ترجیح تماس صبحها"
}'
Get Contact
Get a specific contact by ID.
Path
| Segment | Constraints | Description |
|---|---|---|
id | Positive integer (e.g. 55019) | ID in the portal customers table. |
Example
curl -X GET "https://www.HomaCRM.com/api/v1/external/crm/contacts/55019" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Accept: application/json"
Update Contact
Update contact fields. Only keys you send are applied.
Request Body (partial)
| Field | Type | Valid values / constraints | Description |
|---|---|---|---|
firstName | string | — | First name. |
lastName | string | — | Last name. |
companyName | string | — | Company. |
mobile | string | Digits normalized (prefer 09…) | Primary mobile. |
mobile2 | string | — | Second mobile. |
mobile3 | string | — | Third mobile. |
phone | string | — | Landline (Tell). |
email | string | — | Email. |
address | string | — | Address. |
groupId | number | Integer | Category / group. |
notes | string | — | Notes (Tozihat). |
isActive | boolean | true / false | Soft-active flag. |
nationalCode, city, and province are not updated by this endpoint (create only).
Example
curl -X PUT "https://www.HomaCRM.com/api/v1/external/crm/contacts/55019" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Content-Type: application/json" \
-d '{
"firstName": "رضا",
"lastName": "کریمی",
"companyName": "فروشگاه نمونه آریا (شعبه شمال)",
"mobile": "09121112233",
"mobile2": "09123334455",
"phone": "02188776655",
"email": "reza.karimi@example.com",
"address": "تهران، میدان تجریش، برومند ۹",
"groupId": 5,
"notes": "آخرین خرید: ۱۴۰۴/۰۲/۱۵",
"isActive": true
}'
Delete Contact
Delete (deactivate) a contact.
Example
curl -X DELETE "https://www.HomaCRM.com/api/v1/external/crm/contacts/55019" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Accept: application/json"
List Contact Groups
Get list of contact groups/categories.
Example
curl -X GET "https://www.HomaCRM.com/api/v1/external/crm/contacts/groups" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Accept: application/json"
Update Contact Group
Update an existing contact group. Scope: crm:groups:write.
Delete Contact Group
Delete a contact group. Use query moveMembersToGroupId to relocate members before deletion, or force=true to delete members without invoices (destructive). Scope: crm:groups:write.
Example
curl -X DELETE "https://www.HomaCRM.com/api/v1/external/crm/contacts/groups/6?moveMembersToGroupId=3" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Accept: application/json"
List Pipelines
Get sales pipelines with their stages. Call this before creating a deal to obtain valid pipelineId and stageId. Scope: crm:deals:read.
Example
curl -X GET "https://www.HomaCRM.com/api/v1/external/crm/pipelines" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Accept: application/json"
List Deals
Get paginated deals. Scope: crm:deals:read.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
pipelineId | number | Filter by pipeline |
stageId | number | Filter by stage |
status | string | Filter by status (e.g. open, won, lost) |
search | string | Text search on the title |
page, pageSize | number | Pagination (pageSize max 100) |
Create Deal
Create a new deal. Scope: crm:deals:write.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Deal title |
pipelineId | number | Yes | Pipeline ID (from List Pipelines) |
stageId | number | Yes | Stage ID within that pipeline |
amount | number | No | Deal value |
contactId | number | No | Linked contact |
Example
curl -X POST "https://www.HomaCRM.com/api/v1/external/crm/deals" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Content-Type: application/json" \
-d '{
"title": "قرارداد سالانه فروشگاه نمونه",
"pipelineId": 1,
"stageId": 12,
"amount": 250000000
}'
Update Deal
Update an existing deal. Scope: crm:deals:write.
Delete Deal
Soft-delete a deal. Returns 204 No Content. Scope: crm:deals:write.
List Leads
Get paginated sales leads. Supports search, page, pageSize. Scope: crm:leads:read.
Create Lead
Register a new lead. All fields are optional, but include at least one identity field (title, firstName, lastName, companyName, mobile, or email). Scope: crm:leads:write.
Example
curl -X POST "https://www.HomaCRM.com/api/v1/external/crm/leads" \
-H "Authorization: a1B2c3D4e5F6g7H8-i9J0k1L2m3N4o5P6-q7R8s9T0u1V2w3X4" \
-H "Content-Type: application/json" \
-d '{
"firstName": "مریم",
"lastName": "احمدی",
"mobile": "09351234567",
"notes": "آشنایی در نمایشگاه"
}'
Update Lead
Update an existing lead. Scope: crm:leads:write.
Delete Lead
Soft-delete a lead. Returns 204 No Content. Scope: crm:leads:write.