---
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`

## Request

- Base URL: `https://open-api.guesty.com/v1`
- URL: `https://open-api.guesty.com/v1/properties-api/room-photos/photos/{photoId}/assign`
- Auth: API key in header `authorization`

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.dev/guesty/apis/guesty-open-api.md) - [All operations](https://skmtc.dev/guesty/apis/guesty-open-api/llms.txt) - [OpenAPI document](https://skmtc.dev/guesty/apis/guesty-open-api/revisions/3122b8618183?raw)
