بازگشت به فهرست

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

FieldTypeRequiredDescription
firstNamestringYesFirst name (Persian)
lastNamestringYesLast name (Persian)
mobilestringYesMobile number (09XXXXXXXXX)
emailstringYesEmail address
nationalCodestringYes10-digit national code
editionstringYes"sms" or "full"
skipShahkarbooleanNoSkip Shahkar verification (default: false)

Response

FieldTypeDescription
portalCodenumberNew portal code
usernamestringAdmin username
passwordstringAdmin password
shahkarVerifiedbooleanWhether 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

ParameterTypeDefaultDescription
pagenumber1Page number
pageSizenumber20Items per page (max 100)
searchstring-Search by code, name, mobile
statusstringallFilter: 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

FieldTypeDescription
titlestringPortal title
companyNamestringCompany name
ownerFirstNamestringOwner first name
ownerLastNamestringOwner last name
emailstringEmail address
isActivebooleanActive 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

ParameterTypeDefaultDescription
periodstring30dTime period: 7d, 30d, 90d, all

Deputy Statistics

Overall Stats

GET /deputy/stats

Get overall statistics for your deputy network.

Response

FieldTypeDescription
deputyCodenumberYour deputy code
totalPortalsnumberTotal sub-portals
activePortalsnumberActive sub-portals
inactivePortalsnumberInactive sub-portals
totalSmsCreditnumberTotal SMS credit across all
portalsCreatedThisMonthnumberNew portals this month
topPortalsarrayTop 5 portals by credit

HomaCRM External API

For support, create a ticket via /support/tickets endpoint.