DELETE
Delete a photo

Overview

Removes the embedded photo identified by photoId from the caller’s current-home listing. Returns the updated listing. The server enforces a minimum of one photo per listing: attempting to delete the last remaining photo returns 400 VALIDATION_FAILED. The client should add a replacement first (via POST /current-home/me/photos) and then delete. If the deleted photo was the cover, the next remaining photo by orderIndex becomes the new cover automatically. The remaining photos keep their orderIndex values — there is no compaction; the client can call Reorder photos afterwards if it wants a contiguous 0..N-1 sequence. The underlying object in DigitalOcean Spaces is not deleted by this endpoint. Storage-side cleanup of orphaned objects is part of the Phase 7 retention sweep.

Authentication

Bearer <accessToken> required. Scope: user.

Path parameters

Query parameters

None.

Request body

None.

Response — 200 OK

Returns the updated Home object. photos no longer contains the deleted entry.

Error responses

Example error — 400

Side effects

  • $pulls the matching subdocument out of current_homes.photos[].
  • If the deleted photo was the cover, the next photo by orderIndex is promoted to isCover: true in the same write.
  • updatedAt is bumped.
  • The underlying Spaces object is not removed (Phase 7 cleanup sweep).
  • No match.recompute is triggered.

See also

curl