Users

Retrieve Users

Finding agents and linking external IDs

Get a list of your agency's agents, find a specific agent, or link an external ID for further synchronization.

Get Agent List

Returns all agents in your agency.

const response = await fetch('https://crm.rentix.md/api/v1/users', {
  headers: { 'Authorization': 'ApiKey YOUR_API_KEY' }
});

const { items } = await response.json();

// Find agents without external ID (for initial linking)
const unlinked = items.filter(user => !user.externalId);
console.log(`Agents without external ID: ${unlinked.length}`);
Response
{
  "items": [
    {
      "id": 1,
      "externalId": "agent-001",
      "name": "Ivan Petrov",
      "phone": "+373 22 123 456",
      "avatar": {
        "id": 123,
        "contentType": "image/jpeg",
        "variants": [
          { "url": "https://storage.../avatar_128.webp", "variantSize": "128" }
        ]
      },
      "description": "Experienced residential real estate agent...",
      "instagram": "https://instagram.com/ivan.petrov",
      "youtube": null,
      "tiktok": null,
      "settings": {
        "posting_type": "agent",
        "contact_phone": true,
        "contact_whatsapp": true,
        "contact_viber": false,
        "contact_telegram": true
      }
    }
  ]
}

Find Agent by ID

Use the Rentix internal ID.

const response = await fetch('https://crm.rentix.md/api/v1/users/1', {
  headers: { 'Authorization': 'ApiKey YOUR_API_KEY' }
});
const user = await response.json();

Find Agent by External ID

Use the ID from your CRM.

const response = await fetch('https://crm.rentix.md/api/v1/users/external/agent-001', {
  headers: { 'Authorization': 'ApiKey YOUR_API_KEY' }
});
const user = await response.json();

Connects a Rentix agent with a record in your CRM. After linking, you can use the external ID for profile updates and listing assignment.

const response = await fetch('https://crm.rentix.md/api/v1/users/1/link', {
  method: 'POST',
  headers: {
    'Authorization': 'ApiKey YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ externalId: 'agent-001' })
});

const result = await response.json();
console.log(`Agent ${result.id} linked to external ID: ${result.externalId}`);
Response
{
  "id": 1,
  "externalId": "agent-001",
  "linked": true
}

Removes the connection between a Rentix agent and external ID.

const response = await fetch('https://crm.rentix.md/api/v1/users/1/link', {
  method: 'DELETE',
  headers: { 'Authorization': 'ApiKey YOUR_API_KEY' }
});
Response
{
  "id": 1,
  "externalId": "agent-001",
  "unlinked": true
}

Scenario: Initial Linking

When integrating CRM, you need to connect existing Rentix agents with records in your system.

Node.js
// 1. Get all agents from Rentix
const response = await fetch('https://crm.rentix.md/api/v1/users', {
  headers: { 'Authorization': 'ApiKey YOUR_API_KEY' }
});
const { items: rentixAgents } = await response.json();

// 2. For each agent, find a match in CRM (e.g., by name or phone)
for (const agent of rentixAgents) {
  const crmRecord = await findInCrm(agent.phone); // your search function

  if (crmRecord && !agent.externalId) {
    // 3. Link external ID
    await fetch(`https://crm.rentix.md/api/v1/users/${agent.id}/link`, {
      method: 'POST',
      headers: {
        'Authorization': 'ApiKey YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ externalId: crmRecord.id })
    });

    console.log(`Linked: ${agent.name}${crmRecord.id}`);
  }
}

Common Errors

ErrorCauseSolution
User not foundAgent doesn't exist or not in your agencyCheck the agent ID
External ID already linkedThis external ID is already used by another agentUse a unique ID for each agent
User already has external IDAgent already has an external IDUnlink the current ID first
Copyright © 2026