Deputy / نمایندگان
API endpoints for portal deputies (نمایندگان). These endpoints are only available to portals registered as deputies in the system.
Note: All deputy endpoints require a valid API token from a portal that has deputy status enabled.
Create Portal
Create new portals under your deputy management. Shahkar verification is performed automatically.
POST
/deputy/portal/create
Create new portal with automatic Shahkar verification.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | Yes | First name (Persian) |
lastName | string | Yes | Last name (Persian) |
mobile | string | Yes | Mobile number (09XXXXXXXXX) |
email | string | Yes | Email address |
nationalCode | string | Yes | 10-digit national code |
edition | string | Yes | "sms" or "full" |
skipShahkar | boolean | No | Skip Shahkar verification (default: false) |
Response
| Field | Type | Description |
|---|---|---|
portalCode | number | New portal code |
username | string | Admin username |
password | string | Admin password |
shahkarVerified | boolean | Whether Shahkar was verified |
Example
curl -X POST "https://www.HomaCRM.com/api/v1/external/deputy/portal/create" \
-H "Authorization: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstName": "علی",
"lastName": "محمدی",
"mobile": "09121234567",
"email": "ali@example.com",
"nationalCode": "1234567890",
"edition": "sms"
}'
Note: Shahkar service validates that the national code belongs to the mobile number owner.
If verification fails, portal will not be created.
Sub-Portal Management
List Sub-Portals
GET
/deputy/portals
Get list of all portals under your management.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
pageSize | number | 20 | Items per page (max 100) |
search | string | - | Search by code, name, mobile |
status | string | all | Filter: active, inactive, all |
Get Portal Details
GET
/deputy/portals/{code}
Get detailed information about a sub-portal.
Update Portal
PUT
/deputy/portals/{code}
Update sub-portal information (limited fields).
Request Body
| Field | Type | Description |
|---|---|---|
title | string | Portal title |
companyName | string | Company name |
ownerFirstName | string | Owner first name |
ownerLastName | string | Owner last name |
email | string | Email address |
isActive | boolean | Active status |
Note: National code and mobile number cannot be changed.
Get Portal Credit
GET
/deputy/portals/{code}/credit
Get SMS credit balance for a sub-portal.
Get Portal Stats
GET
/deputy/portals/{code}/stats
Get statistics for a sub-portal (SMS, contacts, activity).
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
period | string | 30d | Time period: 7d, 30d, 90d, all |
Deputy Statistics
Overall Stats
GET
/deputy/stats
Get overall statistics for your deputy network.
Response
| Field | Type | Description |
|---|---|---|
deputyCode | number | Your deputy code |
totalPortals | number | Total sub-portals |
activePortals | number | Active sub-portals |
inactivePortals | number | Inactive sub-portals |
totalSmsCredit | number | Total SMS credit across all |
portalsCreatedThisMonth | number | New portals this month |
topPortals | array | Top 5 portals by credit |