Back to top

RESTful API endpoints to manage photos

Headers

As this API is working with JSON every request must add the following headers:

Accept: application/json

And for requests with body:

Content-Type: application/json

Photos management

Resource Group

Photos upload

Upload photo
POST/public

Example URI

POST https://monolith.spotahome.com/api/photos/public
Request  Binary
HideShow
Headers
Content-Type: multipart/form-data; boundary=---boundary---
Authorization: aa.bb.cc
Body
---boundary---,
Content-Disposition: form-data; name="imageFile"; filename="/home/user/photo.jpg

---boundary---
Content-Disposition: form-data; name="propertyId"

123456
---boundary---
Request  By URL
HideShow
Headers
Content-Type: application/json
Authorization: aa.bb.cc
Body
{
  "imageUrl": "https://s3.amazon.com/photos-bucket/photo.jpg",
  "propertyId": "12345"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "imageUrl": {
      "type": "string"
    },
    "propertyId": {
      "type": "string"
    }
  },
  "required": [
    "imageUrl",
    "propertyId"
  ]
}
Response  201
HideShow
Headers
Location: /api/photos/public/8da003d43506937ee1975c58ab3c2d9578ef145f55a53e7826deb9a1
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Unauthorized user",
  "status": 401,
  "title": "Unauthorized",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  415
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The Content-Type * of the request is not currently supported.",
  "status": 415,
  "title": "Unsupported Media Type",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The request was well formed but was unable to be followed due to semantic errors",
  "status": 422,
  "title": "Unprocessable Entity",
  "type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
  "validationMessages": {
    "field": {
      "stringLength": "The input is less than 6 characters long"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "description": "sec10.html (string, required)"
    },
    "validationMessages": {
      "type": "object",
      "properties": {
        "field": {
          "type": "object",
          "properties": {
            "stringLength": {
              "type": "string"
            }
          },
          "required": [
            "stringLength"
          ]
        }
      },
      "description": "Contains a property for each field that failed validation."
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ]
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Internal Server Error",
  "status": 500,
  "title": "Internal Server Error",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}

Photos operations

Delete photo
DELETE/public/{id}

Example URI

DELETE https://monolith.spotahome.com/api/photos/public/8da003d43506937ee1975c58ab3c2d9578ef145f55a53e7826deb9a1
URI Parameters
HideShow
id
string (required) Example: 8da003d43506937ee1975c58ab3c2d9578ef145f55a53e7826deb9a1
Request
HideShow
Headers
Authorization: aa.bb.cc
Response  204
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Unauthorized user",
  "status": 401,
  "title": "Unauthorized",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The resource was not found",
  "status": 404,
  "title": "Not Found",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Internal Server Error",
  "status": 500,
  "title": "Internal Server Error",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}

Classify photo
PUT/public/{id}

Example URI

PUT https://monolith.spotahome.com/api/photos/public/8da003d43506937ee1975c58ab3c2d9578ef145f55a53e7826deb9a1
URI Parameters
HideShow
id
string (required) Example: 8da003d43506937ee1975c58ab3c2d9578ef145f55a53e7826deb9a1
Request
HideShow
Headers
Content-Type: application/json
Authorization: aa.bb.cc
Body
{
  "caption": "Living room",
  "taxonomy": "bedroom"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "caption": {
      "type": "string"
    },
    "taxonomy": {
      "type": "string",
      "enum": [
        "bedroom",
        "balcony",
        "terrace",
        "street-view",
        "living-room",
        "checked-by",
        "corridor",
        "kitchen",
        "bathroom",
        "ensuite-bathroom",
        "garden",
        "parking",
        "building",
        "guest-room",
        "tenants-living-room",
        "tenants-kitchen",
        "tenants-bathroom",
        "shower",
        "toilet",
        "view",
        "patio-terrace",
        "courtyard",
        "stairs",
        "loft",
        "storage",
        "entrance-hall",
        "swimming-pool",
        "other",
        "uncategorized",
        "residence-bedroom",
        "residence-studio",
        "residence-ensuite",
        "residence-bathroom",
        "residence-living-room",
        "residence-view-from-window",
        "residence-kitchen",
        "residence-corridor",
        "residence-entrance",
        "residence-hallway",
        "residence-checked-by",
        "residence-restaurant",
        "residence-cafeteria",
        "residence-bar",
        "residence-nightclub",
        "residence-games-hall",
        "residence-library",
        "residence-swimming-pool",
        "residence-gym",
        "residence-library-study-area",
        "residence-concierge",
        "residence-reception",
        "residence-common-area",
        "residence-lounge",
        "residence-quite-lounge",
        "residence-study-room",
        "residence-study-area",
        "residence-tv-room",
        "residence-cinema",
        "residence-entertainment-zone",
        "residence-outdoor-area",
        "residence-garden",
        "residence-laundry",
        "residence-recreation-room",
        "residence-first-aid-room",
        "residence-other"
      ]
    }
  },
  "required": [
    "caption",
    "taxonomy"
  ]
}
Response  204
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The request could not be understood by the server due to malformed syntax",
  "status": 400,
  "title": "Bad Request",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Unauthorized user",
  "status": 401,
  "title": "Unauthorized",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The resource was not found",
  "status": 404,
  "title": "Not Found",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Internal Server Error",
  "status": 500,
  "title": "Internal Server Error",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}

Photos operations multiple

Classify multiple photos
PUT/public/multiple

Example URI

PUT https://monolith.spotahome.com/api/photos/public/multiple
Request
HideShow
Headers
Content-Type: application/json
Authorization: aa.bb.cc
Body
{
  "photos": [
    {
      "photoId": "adf45d949a029545dcb13b5d6228c140eb54d755fba2c82b04a88424",
      "caption": "Living room",
      "taxonomy": "bedroom"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "photos": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "photoId": {
            "type": "string",
            "enum": [
              "adf45d949a029545dcb13b5d6228c140eb54d755fba2c82b04a88424"
            ]
          },
          "caption": {
            "type": "string",
            "enum": [
              "Living room"
            ]
          },
          "taxonomy": {
            "type": "string",
            "enum": [
              "bedroom",
              "balcony",
              "terrace",
              "street-view",
              "living-room",
              "checked-by",
              "corridor",
              "kitchen",
              "bathroom",
              "ensuite-bathroom",
              "garden",
              "parking",
              "building",
              "guest-room",
              "tenants-living-room",
              "tenants-kitchen",
              "tenants-bathroom",
              "shower",
              "toilet",
              "view",
              "patio-terrace",
              "courtyard",
              "stairs",
              "loft",
              "storage",
              "entrance-hall",
              "swimming-pool",
              "other",
              "uncategorized",
              "residence-bedroom",
              "residence-studio",
              "residence-ensuite",
              "residence-bathroom",
              "residence-living-room",
              "residence-view-from-window",
              "residence-kitchen",
              "residence-corridor",
              "residence-entrance",
              "residence-hallway",
              "residence-checked-by",
              "residence-restaurant",
              "residence-cafeteria",
              "residence-bar",
              "residence-nightclub",
              "residence-games-hall",
              "residence-library",
              "residence-swimming-pool",
              "residence-gym",
              "residence-library-study-area",
              "residence-concierge",
              "residence-reception",
              "residence-common-area",
              "residence-lounge",
              "residence-quite-lounge",
              "residence-study-room",
              "residence-study-area",
              "residence-tv-room",
              "residence-cinema",
              "residence-entertainment-zone",
              "residence-outdoor-area",
              "residence-garden",
              "residence-laundry",
              "residence-recreation-room",
              "residence-first-aid-room",
              "residence-other"
            ]
          }
        },
        "required": [
          "photoId",
          "caption",
          "taxonomy"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "photos"
  ]
}
Response  204
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The request could not be understood by the server due to malformed syntax",
  "status": 400,
  "title": "Bad Request",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Unauthorized user",
  "status": 401,
  "title": "Unauthorized",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "The resource was not found",
  "status": 404,
  "title": "Not Found",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "detail": "Internal Server Error",
  "status": 500,
  "title": "Internal Server Error",
  "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "detail": {
      "type": "string"
    },
    "status": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  },
  "required": [
    "detail",
    "status",
    "title",
    "type"
  ]
}

Generated by aglio on 27 Nov 2025