Skip to content
AlterEstate

Upload property photos

Adds the cover photo and the gallery photos of a property that already exists.

Create a property does not accept files. After that call returns a uid, upload the cover and the gallery with the two requests below. The cover is the featured image on cards and the public listing. The gallery is the rest of the photos.

PATCHhttps://secure.alterestate.com/api/v1/properties/photos/featured/{uid}/

Send Authorization: Token your_api_key_here. Account token. Server-side only: never send it from browser or mobile app code.


FieldTypeDescription
uidrequiredstringProperty uid from Create a property or List properties. Example: cid 292960, uid JSORJ9S5AY. Example: JSORJ9S5AY.

FieldTypeDescription
featured_imagerequiredfileThe cover photo. One JPEG, PNG or WebP. A later call with a new file replaces the cover. Example: cover.jpg.

PATCH
curl --request PATCH \
  --url 'https://secure.alterestate.com/api/v1/properties/photos/featured/JSORJ9S5AY/' \
  --header 'Authorization: Token your_api_key_here' \
  --header 'Accept: application/json' \
  --form 'featured_image=@cover.jpg;type=image/jpeg'

200 OK
{
  "id": 12011,
  "uid": "JSORJ9S5AY",
  "slug": "modern-apartment-in-naco-292960",
  "design": 1,
  "featured_image": "https://d2p0bx8wfdkjkb.cloudfront.net/static/properties/example/featured.jpg"
}
400 Bad Request
{
  "error": "Este archivo no es una imagen JPG, PNG o WebP válida."
}
404 Not Found
{
  "detail": "Not found."
}
POSThttps://secure.alterestate.com/api/v1/properties/photos/{uid}/

Send Authorization: Token your_api_key_here. Account token. Server-side only: never send it from browser or mobile app code.


FieldTypeDescription
uidrequiredstringProperty uid. The same value used in the featured-image URL. Example: JSORJ9S5AY.

FieldTypeDescription
gallerynumberGallery number. Send 2, the value the dashboard uses for listing photos. Example: 2.
image0requiredfileFirst gallery photo. JPEG, PNG or WebP. This does not replace the cover. Example: photo-1.jpg.
image1fileNext gallery photo. Continue with image2, image3, and so on, with no gaps. Maximum 10 photos per request. Send more in another request. Example: photo-2.jpg.

POST
curl --request POST \
  --url 'https://secure.alterestate.com/api/v1/properties/photos/JSORJ9S5AY/' \
  --header 'Authorization: Token your_api_key_here' \
  --header 'Accept: application/json' \
  --form 'gallery=2' \
  --form 'image0=@photo-1.jpg;type=image/jpeg' \
  --form 'image1=@photo-2.jpg;type=image/jpeg'

201 Created
[
  {
    "id": 88421,
    "uid": "PH0T0UID01",
    "parent": "JSORJ9S5AY",
    "gallery": 2,
    "order": 3,
    "title": "",
    "description": "",
    "image": "https://d2p0bx8wfdkjkb.cloudfront.net/static/properties/example/gallery-1.jpg"
  }
]
400 Bad Request
{
  "error": "Este archivo no es una imagen JPG, PNG o WebP válida."
}
404 Not Found
{
  "detail": "Not found."
}

PhotoRequestWhat it changes
Featured imagePATCH /api/v1/properties/photos/featured/{uid}/The cover. One file in featured_image. Sending it again replaces the cover.
GalleryPOST /api/v1/properties/photos/{uid}/The other photos. Files image0, image1, … are appended. Existing gallery photos stay.

Accepted files

RuleLimit
FormatJPEG, PNG or WebP. The stored file is JPEG.
Size15 MB per file.
DimensionsAt most 10000 px on each side, and at most 40 megapixels.
Gallery batchAt most 10 photos per request, named image0 through image9 with no gaps. Send more photos in another request; there is no limit per property.
RejectedSVG, GIF, PDF, HTML, scripts, archives and any other type.

Status codes

StatusMeaning
200The cover was saved. The body includes featured_image.
201The gallery photos were saved. The body is the property’s gallery, not only the new files.
400A file, the field names or gallery is invalid. error explains which rule failed.
401The account token is missing or invalid.
404No property with that uid belongs to this agency.
  • Use the account token from POST /api/v1/login/. The public aetoken cannot upload files.
  • The property must belong to the agency of that token.
  • A file that is not a JPEG, PNG or WebP returns 400 and is not stored. The original filename is not kept.
  • Other 400 messages are "La imagen supera el tamaño máximo de 15 MB." and "La imagen supera las dimensiones máximas permitidas (10000 px por lado)."
  • The property uid is in the URL. gallery is optional. Send 2 for the listing gallery. Omit it and the photos are still attached to the property.
  • An upload from outside the AlterEstate dashboard is stored as a support log on that property. The log records the cover or the gallery, the outcome and the number of photos. It does not store the file.

Frequently asked questions

How do I set the featured image?

PATCH /api/v1/properties/photos/featured/{uid}/ with multipart field featured_image set to one JPEG, PNG or WebP. That file becomes the cover. Call it again to replace the cover.

How do I add gallery photos?

POST /api/v1/properties/photos/{uid}/ with gallery set to 2 and the files in image0, image1, and so on. The uid in the URL is the property. Those photos are added after the ones already there. They do not replace the cover.

Can I upload an SVG, a PDF or a script?

No. Only JPEG, PNG and WebP are accepted, up to 15 MB and 10000 px per side. Anything else returns 400 and is not stored.

Last updated . Questions? Emaildev@alterestate.com.