Image endpoints for a listing your org owns. Images aren’t covered by
the audience field they’re visible to anyone who can see the
listing.
Upload
POST /public/v1/sales-lease-exchange/images/{listing_id}
The audience field is not accepted on listing images audience
applies to documents only.
File rules
- Max size: 50 MB.
- Allowed types: JPEG, PNG, WEBP, GIF.
- One file per call.
Storage path
{SUPABASE_URL}/storage/v1/object/public/teardowns-media/listings/<listing_id>/images/<8-hex>_<filename>
Response
200 OK:
{
"url": "https://.../teardowns-media/listings/<id>/images/abcd1234_engine.jpg",
"filename": "engine.jpg",
"size": 234567,
"content_type": "image/jpeg"
}
The URL is appended to listing.images[] automatically.
curl -X POST "$base_url/public/v1/sales-lease-exchange/images/$listing_id" \
-H "Authorization: Bearer $api_key" \
-H "X-Organization-Id: $org_id" \
-F "file=@/absolute/path/to/engine.jpg"
import requests
with open("engine.jpg", "rb") as f:
resp = requests.post(
f"{base_url}/public/v1/sales-lease-exchange/images/{listing_id}",
headers={"Authorization": f"Bearer {api_key}", "X-Organization-Id": org_id},
files={"file": f},
)
resp.raise_for_status()
Delete by URL
DELETE /public/v1/sales-lease-exchange/images/{listing_id}/by-url?url=<encoded-url>
Removes a single image URL from images[]. Best-effort deletes the
underlying storage file. Idempotent.
Query parameters
Response
200 OK:
encoded_url=$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1]))" "$IMG_URL")
curl -X DELETE "$base_url/public/v1/sales-lease-exchange/images/$listing_id/by-url?url=$encoded_url" \
-H "Authorization: Bearer $api_key" \
-H "X-Organization-Id: $org_id"
Common errors
| Status | error_code | Why |
|---|
| 400 | (no code) | File empty, or content type isn’t an image |
| 400 | file_too_large | Over 50 MB |
| 404 | (no code) | Listing isn’t yours or doesn’t exist |
| 502 | storage_unavailable | Supabase Storage upstream issue retry |
See also