Skip to content

Media synchronization ​

Property media is managed through separate endpoints rather than as top-level property fields and requires media:write. Discover media field slugs through GET /property-schema; fields managed by these endpoints have read_only_reason: managed_via_media_api.

All media endpoints download remote HTTP(S) URLs. Do not send local file paths, bearer tokens in URLs, or URLs that require Residenda to reproduce your private authentication.

Choose how to add media ​

Attach when you only add media ​

POST /properties/{property}/images adds unseen source URLs and reports duplicates. Existing media is never removed or reordered. Individual URL failures can coexist with successful additions.

Synchronize when you send the complete media list ​

PUT /properties/{property}/images makes media previously imported through the API match the supplied URL order. It removes imported media whose source URL is absent, while preserving dashboard uploads after the ordered imported items. Repeating a completed request produces the same collection, provided no newer collection has been sent.

Add media ​

json
{
  "field_slug": "photos",
  "urls": [
    "https://images.example.com/listings/42/front.jpg",
    "https://images.example.com/listings/42/kitchen.jpg"
  ]
}
sh
curl --fail-with-body --silent --show-error \
  --request POST \
  --header "Authorization: Bearer ${RESIDENDA_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data @media.json \
  "${RESIDENDA_API}/properties/${PROPERTY_ID}/images"

The endpoint returns 200 after processing. Inspect both arrays even when the HTTP request succeeds:

json
{
  "message": "Images processed",
  "attached": [
    {
      "id": 501,
      "url": "https://images.example.com/listings/42/front.jpg",
      "status": "attached"
    }
  ],
  "errors": []
}

Repeating a URL returns status: duplicate instead of importing it again. A remote download failure appears in errors with the stable code remote_media_processing_failed; internal exception details are not returned.

Synchronize a complete ordered list ​

Use this operation when every request contains the complete media list in the order it should appear:

json
{
  "field_slug": "photos",
  "urls": [
    "https://images.example.com/listings/42/kitchen.jpg",
    "https://images.example.com/listings/42/front.jpg",
    "https://images.example.com/listings/42/garden.jpg"
  ]
}
sh
curl --fail-with-body --silent --show-error \
  --request PUT \
  --header "Authorization: Bearer ${RESIDENDA_TOKEN}" \
  --header 'Content-Type: application/json' \
  --data @media-sync.json \
  "${RESIDENDA_API}/properties/${PROPERTY_ID}/images"

Duplicate input URLs are collapsed. Existing media with matching source URLs is reused, missing items are downloaded, and previously imported items absent from the request are removed. Media uploaded through the dashboard is preserved after the ordered imported items.

An explicit "urls": [] removes all API-imported media in that field while retaining dashboard uploads. Omitted or null URLs are invalid; never turn an unknown source collection into an empty list. This applies to PUT only; POST still requires at least one URL.

Residenda downloads every new file before removing or reordering existing media. If a download fails, the endpoint returns 422 and leaves the existing media unchanged. Repeating a successful request returns the same order and media IDs with deleted_count: 0.

The media endpoint does not support Idempotency-Key. An old request or retry can replace a newer collection, so serialize writes and do not advance to newer input while an earlier request has an uncertain outcome. A GET shows the current collection, not whether an older request is still running.

Stable source URLs

Use the same stable URL each time for the same file. A changed URL is treated as a different file and may be downloaded again.

See the Media operations in the API Reference for deletion endpoints and complete response schemas, and Reliability and errors before adding automatic retries.

Residenda developer documentation