# Furnish

For an automatic staging without mask and more advanced technology, we recommend to use the [Smart Staging V2 endpoint](/endpoints/smart-staging-v2.md).

<div><figure><img src="/files/F64lLxOsyrMNqghAJZRS" alt=""><figcaption><p>Before</p></figcaption></figure> <figure><img src="/files/9KxtFzN8uqOGKkRSCzA7" alt=""><figcaption><p>After</p></figcaption></figure></div>

### Endpoint

<mark style="color:green;">`POST`</mark> `https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{API\_KEY}} |

#### Request Body

| Name                                          | Type                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| url<mark style="color:red;">\*</mark>         | String (URL)           | <p>Image URL of the room to be redesigned.</p><p>Ex: <a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/raw-images%2F7aa0df81-854a-4676-9bf0-026492c3cc4d.jpeg?alt=media&#x26;token=a259551b-0c01-4268-a069-20117c124ede">Base Image</a></p>                                                                                                                                                        |
| mask                                          | String (URL)           | <p>Custom mask image URL of the area to furnish.<br>Ex: <a href="https://firebasestorage.googleapis.com/v0/b/gepettoai.appspot.com/o/mask%2F77fe7e96-5a4a-40eb-8364-bdb7b91dee27.jpeg?alt=media&#x26;token=c8f97323-18b7-4281-b2ae-8220c3ee3b66">Mask Image</a><br></p><p>⚠️ The mask should have the same dimension as the base image <code>url</code> parameter.<br><br>If set, <code>preserveWindows</code> is ignored</p> |
| roomId<mark style="color:red;">\*</mark>      | String                 | <p>The room ID that can be fetched on the <a href="https://docs.gepettoapp.com/endpoints/get-rooms">Get Rooms</a> endpoint.<br><br><mark style="color:$danger;">Cannot be used simultaneouly with <strong>furnitureId</strong></mark></p>                                                                                                                                                                                     |
| furnitureId<mark style="color:red;">\*</mark> | String                 | <p>The furniture ID that can be fetched on the<a data-mention href="/pages/tVum1xHYTYStxg6W3rEh">/pages/tVum1xHYTYStxg6W3rEh</a> endpoint<br><br><mark style="color:$danger;">Cannot be used simultaneouly with <strong>roomId</strong></mark></p>                                                                                                                                                                            |
| styleId<mark style="color:red;">\*</mark>     | String                 | The style ID that can be fetched on the [Get Styles ](https://docs.gepettoapp.com/endpoints/get-styles)endpoint.                                                                                                                                                                                                                                                                                                              |
| webhook                                       | String (URL)           | <p>(optional) Webhook <strong>POST</strong> URL to send the result on completion.<br><br>If not provided, the request will wait for the result.</p>                                                                                                                                                                                                                                                                           |
| preserveWindows                               | Boolean (true / false) | <p>(optional but highly recommend to set true)</p><p><br>Tells explicitly to not touch windows, doors, french doors and bay windows and thus not modify the view.</p>                                                                                                                                                                                                                                                         |

{% tabs %}
{% tab title="200: OK If webhook is not set" %}

```json
{
  "base64": "<base64 encoded image>",
  "status": "success"
}
```

{% endtab %}

{% tab title="200: OK If webhook is provided" %}

```json
{
  "status": "pending",
  "id": "xxxxxxxxxxxxxx", // You can use that id with Get Job
  "styleId": "your_style",
  "roomId": "your_room",
  "mode": "furnish"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

### Code Examples

{% tabs %}
{% tab title="CURL" %}

```bash
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "preserveWindows": true
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: JSON.stringify({
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
    "styleId": "demeures",
    "roomId": "living_room",
    "preserveWindows": true
  })
};

const response = await fetch("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish", requestOptions)
const body = await reponse.json();
console.log(body)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish"

payload = json.dumps({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "preserveWindows": True
})
headers = {
  'Authorization': 'Bearer {{API_KEY}}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'Authorization' => 'Bearer {{API_KEY}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "demeures",
  "roomId": "living_room",
  "preserveWindows": True
}';
$request = new Request('POST', 'https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish"
  method := "POST"

  payload := strings.NewReader(`{
    "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
    "styleId": "demeures",
    "roomId": "living_room",
    "preserveWindows": true
}`)

  client := &http.Client {}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{API_KEY}}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "json"
require "net/http"

url = URI("https://europe-west1-gepettoai.cloudfunctions.net/v1/furnish")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer {{API_KEY}}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg",
  "styleId": "scandinave",
  "roomId": "living_room",
  "preserveWindows": true
})

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/YIYdI76u6LSd2s0BESMa" alt=""><figcaption><p>Empty room (before)</p></figcaption></figure>

<figure><img src="/files/1EoWFiRQLFe4IWFd0Zr7" alt=""><figcaption><p>Room furnish with scandinave style (after furnish + upscale)</p></figcaption></figure>

<figure><img src="/files/BCXl0oo1AV5mQpVTVCxS" alt=""><figcaption><p>Room furnish with retro style (after furnish + upscale)</p></figcaption></figure>

<figure><img src="/files/LTctbsdIPOVqJITI4YBm" alt=""><figcaption><p>Empty room (before)</p></figcaption></figure>

<figure><img src="/files/jROTXuknEfjXsUIMSnof" alt=""><figcaption><p>Mask of the space to furnish</p></figcaption></figure>

<figure><img src="/files/aMCPempiPVfpF9zVEt0p" alt=""><figcaption><p>Room with haussmann style (after furnish + upscale)</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gepettoapp.com/endpoints/furnish.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
