/api/v4/locations/photos/removeRemove photos from a location
Detaches one or more media files from a location by their media IDs.
Parameters
Body
| Name | Type | Required | Description |
|---|---|---|---|
| input.locationId | string | required | The location's Base64-encoded Relay ID the photos belong to. |
| input.mediaIds | array of strings | optional | Media file IDs to detach from the location (as returned by the get-photos or upload endpoints). |
| input.photoUrls | array of strings | optional | Alternatively, the public URLs of the media to detach. |
Sample request
Ready-to-paste body. Replace placeholder IDs and values with yours.
{
"input": {
"locationId": "TG9jYXRpb246MTgwMDI4OQ==",
"mediaIds": [
"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 mediaIds (the IDs returned by the get-photos or upload endpoints) or by photoUrls. 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 mediaIds 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
ADDITIONALcategory photos are removable through the API.LOGOandCOVERimages 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
removedCountof0witherrors: nullmeans 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": "<input.locationId>",
"input.mediaIds": "<input.mediaIds>",
"input.photoUrls": "<input.photoUrls>"
}'