Users

Create and Update

Creating agents and syncing profiles via API

Create new agents or sync existing profiles from your CRM — name, phone, description, social media, and contact settings. The endpoint uses upsert: if externalId is new — an agent is created, if it exists — updated.

Create an Agent

Send externalId, name, and phone to create a new agent in your agency:

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',
    phone: '+37322123456'
  })
});

const result = await response.json();
console.log('Created agent #' + result.id);
Response
{
  "id": 1,
  "externalId": "agent-001",
  "created": true
}
When creating an agent via API, all contact channels (phone, WhatsApp, Viber, Telegram) are enabled by default. The phone number is normalized to international format automatically.

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}`);
Response
{
  "id": 1,
  "externalId": "agent-001",
  "updated": true
}

Request Parameters

Identification

Specify one of the parameters:

FieldTypeDescription
idnumberRentix internal ID
externalIdstringYour CRM ID (up to 255 characters)
Pass idorexternalId, not both at once.

Profile

FieldTypeDescription
namestringAgent name (3–255 characters)
phonestringPhone number in international format (required for new agents)
descriptionstring/objectProfile description
avatarobject/nullAgent avatar (see below)

avatar field format:

FormatExampleDescription
By URL{ "url": "https://..." }Auto-import by URL
By internal ID{ "id": 123 }Already uploaded file
ClearnullRemove avatar

Social Media

FieldFormat
instagramhttps://instagram.com/username
youtubehttps://youtube.com/...
tiktokhttps://tiktok.com/@username

Contact Settings

Determine which contact methods are displayed on agent listings.

FieldDescription
contact_phoneShow phone number
contact_whatsappShow WhatsApp button
contact_viberShow Viber button
contact_telegramShow 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 Operations

Process multiple agents in a single request. Each operation must contain an op field:

OperationDescription
upsertCreate or update an agent
linkLink external ID to an existing agent
unlinkUnlink external ID
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}`);
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 }
}
{
  "operations": [
    { "op": "link", "id": 5, "externalId": "agent-005" },
    { "op": "unlink", "externalId": "agent-old" }
  ]
}

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

ErrorCauseSolution
User identifier requiredNeither id nor externalId was passedAdd one of the identifiers
Cannot use both id and externalIdBoth identifiers were passedUse only one
User not foundAgent doesn't exist or not in your agencyCheck the ID and make sure the agent was invited
External ID already linkedThis external ID is already used by another agentUse a unique ID
Copyright © 2026