POST/api/v4/locations/photos/remove

Remove photos from a location

Detaches one or more media files from a location by their media IDs.

Requires an API key. See Authentication for header format and key rotation.

Parameters

Body

NameTypeRequiredDescription
input.locationIdstringrequiredThe location's Base64-encoded Relay ID the photos belong to.
input.photoIdsarray of stringsrequiredMedia file IDs to detach from the location (as returned by the get-photos or upload endpoints).

Sample request

Ready-to-paste body. Replace placeholder IDs and values with yours.

{
  "input": {
    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",
    "photoIds": [
      "TWVkaWFGaWxlOjU4Nzg5MzI="
    ]
  }
}

Responses

200Photos removed. `removedCount` reports how many media files were detached.
{
  "data": {
    "removeLocationPhotos": {
      "clientMutationId": null,
      "removedCount": 1,
      "errors": null
    }
  }
}
401Unauthenticated, missing or invalid API key.

Detaches media from a location. Identify the files to remove by photoIds (the IDs returned by the get-photos or upload endpoints). The response's removedCount tells you how many files were actually detached, which lets you detect IDs that were already gone.

Use case: retire outdated storefront images. After a remodel, list the location's photos, pick the stale additional images, and pass their IDs in photoIds to take them down across publishers in one call.

Use case: undo a bad bulk upload. If an automated import attached the wrong assets, collect the offending media IDs from the upload response and remove them immediately, then re-upload the correct files.

Gotchas.

  • Only ADDITIONAL category photos are removable through the API. LOGO and COVER images cannot be deleted here, replace them via the upload endpoint instead.
  • Removing media detaches it from the location; it does not necessarily purge the file from the account media library.
  • A removedCount of 0 with errors: null means none of the supplied IDs were attached to that location.
curl -X POST 'https://listingsapi.com/api/v4/locations/photos/remove' \
  -H "Authorization: API $LISTINGSAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "input": {
      "locationId": "TG9jYXRpb246MTgwMDI4OQ==",
      "photoIds": [
        "TWVkaWFGaWxlOjU4Nzg5MzI="
      ]
    }
  }'