Users
Update Profile
Syncing name, contacts, and agent description
Sync agent data from your CRM — name, description, social media, and contact settings.
Update Agent Profile
Identify the agent by externalId (from your CRM) or id (from Rentix).
const response = await fetch('https://crm.rentix.md/api/v1/users', {
method: 'PUT',
headers: {
'Authorization': 'ApiKey YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalId: 'agent-001',
name: 'Ivan Petrov',
description: 'Experienced real estate agent. Working with residential and commercial properties.',
instagram: 'https://instagram.com/ivan.petrov',
settings: {
contact_phone: true,
contact_whatsapp: true,
contact_telegram: true
}
})
});
const result = await response.json();
console.log(`Updated agent #${result.id}`);
curl -X PUT https://crm.rentix.md/api/v1/users \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "agent-001",
"name": "Ivan Petrov",
"description": "Experienced real estate agent. Working with residential and commercial properties.",
"instagram": "https://instagram.com/ivan.petrov",
"settings": {
"contact_phone": true,
"contact_whatsapp": true,
"contact_telegram": true
}
}'
$data = [
'externalId' => 'agent-001',
'name' => 'Ivan Petrov',
'description' => 'Experienced real estate agent. Working with residential and commercial properties.',
'instagram' => 'https://instagram.com/ivan.petrov',
'settings' => [
'contact_phone' => true,
'contact_whatsapp' => true,
'contact_telegram' => true
]
];
$ch = curl_init('https://crm.rentix.md/api/v1/users');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ApiKey YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Response
{
"id": 1,
"externalId": "agent-001",
"updated": true
}
Request Parameters
Identification
Specify one of the parameters:
| Field | Type | Description |
|---|---|---|
id | number | Rentix internal ID |
externalId | string | Your CRM ID (up to 255 characters) |
Pass
idorexternalId, not both at once.Profile
| Field | Type | Description |
|---|---|---|
name | string | Agent name |
description | string/object | Profile description |
avatar | object/null | Agent avatar (see below) |
avatar field format:
| Format | Example | Description |
|---|---|---|
| By URL | { "url": "https://..." } | Auto-import by URL |
| By internal ID | { "id": 123 } | Already uploaded file |
| Clear | null | Remove avatar |
Social Media
| Field | Format |
|---|---|
instagram | https://instagram.com/username |
youtube | https://youtube.com/... |
tiktok | https://tiktok.com/@username |
Contact Settings
Determine which contact methods are displayed on agent listings.
| Field | Description |
|---|---|
contact_phone | Show phone number |
contact_whatsapp | Show WhatsApp button |
contact_viber | Show Viber button |
contact_telegram | Show Telegram button |
{
"settings": {
"contact_phone": true,
"contact_whatsapp": true,
"contact_viber": false,
"contact_telegram": true
}
}
Multilingual Description
Specify description in multiple languages — the system will show the appropriate one based on user language.
{
"externalId": "agent-001",
"description": {
"ru": "Опытный агент по недвижимости. Работаю с жилой и коммерческой недвижимостью.",
"en": "Experienced real estate agent. Working with residential and commercial properties.",
"ro": "Agent imobiliar experimentat. Lucrez cu proprietăți rezidențiale și comerciale."
}
}
If you pass a string instead of an object, it will be used for all languages.
Bulk Update
Update multiple agents in a single request. Each operation must contain an op field:
const response = await fetch('https://crm.rentix.md/api/v1/users/bulk', {
method: 'POST',
headers: {
'Authorization': 'ApiKey YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
operations: [
{
op: 'upsert',
externalId: 'agent-001',
name: 'Ivan Petrov',
settings: { contact_whatsapp: true }
},
{
op: 'upsert',
externalId: 'agent-002',
name: 'Maria Ivanova',
settings: { contact_telegram: true }
}
]
})
});
const result = await response.json();
console.log(`Updated: ${result.summary.succeeded} of ${result.summary.total}`);
curl -X POST https://crm.rentix.md/api/v1/users/bulk \
-H "Authorization: ApiKey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operations": [
{
"op": "upsert",
"externalId": "agent-001",
"name": "Ivan Petrov",
"settings": { "contact_whatsapp": true }
},
{
"op": "upsert",
"externalId": "agent-002",
"name": "Maria Ivanova",
"settings": { "contact_telegram": true }
}
]
}'
$data = [
'operations' => [
[
'op' => 'upsert',
'externalId' => 'agent-001',
'name' => 'Ivan Petrov',
'settings' => ['contact_whatsapp' => true]
],
[
'op' => 'upsert',
'externalId' => 'agent-002',
'name' => 'Maria Ivanova',
'settings' => ['contact_telegram' => true]
]
]
];
$ch = curl_init('https://crm.rentix.md/api/v1/users/bulk');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ApiKey YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Response
{
"results": [
{ "op": "upsert", "externalId": "agent-001", "id": 1, "success": true },
{ "op": "upsert", "externalId": "agent-002", "id": 2, "success": true }
],
"summary": {
"total": 2,
"succeeded": 2,
"failed": 0
}
}
An error in one operation doesn't stop the others. Check success for each result:
Response with Error
{
"results": [
{ "op": "upsert", "externalId": "agent-001", "id": 1, "success": true },
{
"op": "upsert",
"externalId": "agent-002",
"id": null,
"success": false,
"error": {
"statusCode": 400,
"body": {
"error": "Invalid phone number format",
"error_code": "VALIDATION_ERROR"
}
}
}
],
"summary": { "total": 2, "succeeded": 1, "failed": 1 }
}
Upload Agent Avatar
The simplest way — pass the image URL directly when updating the profile:
Node.js
await fetch('https://crm.rentix.md/api/v1/users', {
method: 'PUT',
headers: {
'Authorization': 'ApiKey YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
externalId: 'agent-001',
avatar: { url: 'https://placehold.co/200x200/jpg?text=Avatar' }
})
});
If the file is already uploaded, specify its ID:
{
"externalId": "agent-001",
"avatar": { "id": 123 }
}
To remove the avatar, pass null:
{
"externalId": "agent-001",
"avatar": null
}
Common Errors
| Error | Cause | Solution |
|---|---|---|
User identifier required | Neither id nor externalId was passed | Add one of the identifiers |
Cannot use both id and externalId | Both identifiers were passed | Use only one |
User not found | Agent doesn't exist or not in your agency | Check the ID and make sure the agent was invited |
External ID already linked | This external ID is already used by another agent | Use a unique ID |