Media

Manage Files

How to retrieve, delete, and link media files with external IDs

After uploading media files, you can retrieve their information, delete them, and manage external IDs.

Get File Information

By ID

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

const media = await response.json();
console.log(media);

By External ID

const response = await fetch('https://crm.rentix.md/api/v1/media/external/apt-001-photo-1', {
  headers: {
    'Authorization': 'ApiKey YOUR_API_KEY'
  }
});

const media = await response.json();
console.log(media);

Response

{
  "id": 123,
  "externalId": "apt-001-photo-1",
  "size": 245000,
  "contentType": "image/jpeg",
  "optimization": "success",
  "blurhash": "L7HuX^zY1z-6ADx?0z2@1Io#{yV_",
  "originalUrl": "https://storage.../original.jpg",
  "variants": [
    { "url": "https://storage.../128.webp", "variantSize": "128", "size": 4074 },
    { "url": "https://storage.../512.webp", "variantSize": "512", "size": 32850 },
    { "url": "https://storage.../1024.webp", "variantSize": "1024", "size": 98500 }
  ]
}
FieldDescription
idInternal file ID
externalIdYour CRM ID (if provided)
sizeOriginal size in bytes
contentTypeFile MIME type
optimizationOptimization status
blurhashString for generating placeholder
originalUrlURL of original file
variantsOptimized versions of different sizes

Delete File

Deletion frees up space and removes the file from all listings where it was used.

By ID

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

const result = await response.json();
console.log(result); // { deleted: true }
Response
{
  "deleted": true
}

By External ID

const response = await fetch('https://crm.rentix.md/api/v1/media/external/apt-001-photo-1', {
  method: 'DELETE',
  headers: {
    'Authorization': 'ApiKey YOUR_API_KEY'
  }
});

const result = await response.json();
console.log(result); // { deleted: true, mediaId: 123 }
Response
{
  "deleted": true,
  "mediaId": 123
}
Deletion is irreversible. If the file is linked to listings, it will be unlinked from them.

Manage External ID

If a file was uploaded without an external ID, you can add it later:

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

const result = await response.json();
console.log(result); // { mediaId: 123, externalId: 'apt-001-photo-1', linked: true }
Response
{
  "mediaId": 123,
  "externalId": "apt-001-photo-1",
  "linked": true
}
const response = await fetch('https://crm.rentix.md/api/v1/media/123/link', {
  method: 'DELETE',
  headers: {
    'Authorization': 'ApiKey YOUR_API_KEY'
  }
});

const result = await response.json();
console.log(result); // { mediaId: 123, externalId: 'apt-001-photo-1', unlinked: true }
Response
{
  "mediaId": 123,
  "externalId": "apt-001-photo-1",
  "unlinked": true
}

Optimization Statuses

After upload, a file goes through optimization. Check the optimization field:

StatusDescriptionAction
pendingQueuedWait
in_progressProcessingWait
successReadyCan use
failedErrorUpload a different file

When linking to a listing, the system automatically waits for optimization to complete.


Common Errors

ErrorCauseSolution
External ID already linkedID is already used by another fileUse a unique ID
File already has external IDFile already has an external IDUnlink the current one first
File not foundFile doesn't exist or belongs to another agencyCheck the ID
Copyright © 2026