---
title: "Assign a Photo to a Space"
method: PUT
path: "/properties-api/room-photos/photos/{photoId}/assign"
tags: ["Room Photos"]
---

# Assign a Photo to a Space

`PUT /properties-api/room-photos/photos/{photoId}/assign`

Assigns the selected photo to a space.

## Path parameters

- `photoId` string, required

## Request body

- object
  - `spaceId` string, required — Space Id to assign room photo to
  - `propertyId` string, required — The Guesty ID of the property to which the room photo should be assigned.

## Response `200`

Returns a list of all property room photo mappings, including photo ID, space ID and photo URL.

- object
  - `propertyId` string
  - `roomPhotos` object[] — An array containing a list of all property room photo mappings, including photo ID, space ID and photo URL.
    - `_id` string
    - `accountId` string
    - `spaceId` string
    - `photoId` string
    - `photoUrl` string

## Other responses

- `403` — Unauthorized Request.
- `404` — Property not found.

---

[API](https://skmtc.net/guesty/apis/guesty-open-api.md) · [All operations](https://skmtc.net/guesty/apis/guesty-open-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/guesty/guesty-open-api/revisions/7c62644070f2/schema)
