Docs

API Documentation

Virtual Staging API Documentation

Base URL: https://api.ideal.house
Version: v1
Updated: 2026-04-13


πŸ“– Overview

The Virtual Staging API allows you to redesign an empty or partially furnished room using AI.
You submit a room image URL and an optional text prompt, then retrieve the generated result asynchronously.

  1. Create a task β€” Submit imageUrl and optional prompt, then receive a taskId.
  2. Poll for results β€” Use taskId to query task status and get the output image.

πŸ” Authentication

All API requests must be authenticated using an API Key.

Include your API Key in the request header:

HeaderValue
APIKEYyour_api_key_here

⚠️ Keep your API Key secure. Do not expose it in client-side code or public repositories.


πŸ’° Credits Deduction

[!WARNING] πŸͺ™ 1 credit is deducted when a task is successfully created.
If the task ultimately fails, the deducted credit will be automatically refunded.
Insufficient credits will return error code 9051. πŸ“„ See Credits Deduction Reference.

OperationCredits Deducted
Virtual Staging task1 credit

πŸ“Œ API Endpoints


1. Create Virtual Staging Task

Creates a new virtual staging task and returns a unique taskId for polling.

Endpoint

POST /api/v1/virtualStaging/generate

Request Headers

HeaderRequiredDescription
APIKEYβœ… YesYour API authentication key
Content-Typeβœ… Yesapplication/json

Request Body

FieldTypeRequiredDescription
imageUrlstringβœ… YesURL of the source room image
promptstring❌ NoOptional prompt to guide style and furnishing
indoorTypeIdstring❌ NoOptional room type preset. See Indoor Type Options
indoorStyleIdstring❌ NoOptional interior style preset. See Indoor Style Options

🏠 Indoor Type Options

Value
Interior Design_Interior Scene_Living Room
Interior Design_Interior Scene_Dining Room
Interior Design_Interior Scene_Bed Room
Interior Design_Interior Scene_Home Office

🎨 Indoor Style Options

Value
Interior_Interior Style_Popular_Vs_Modern Minimal
Interior_Interior Style_Popular_Vs_Modern Luxury
Interior_Interior Style_Popular_Vs_Contemporary Warm
Interior_Interior Style_Popular_Vs_Builder Grade-New Construction
Interior_Interior Style_Popular_Vs_Luxury Airbnb-Short-Term Rental
Interior_Interior Style_Popular_Vs_Scandinavian
Interior_Interior Style_Popular_Vs_Traditional
Interior_Interior Style_Popular_Vs_Industrial
Interior_Interior Style_Popular_Vs_Modern Farmhouse

πŸ“₯ Request Examples

cURL

curl -X POST "https://api.ideal.house/api/v1/virtualStaging/generate" \
  -H "APIKEY: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/empty-living-room.jpg",
    "prompt": "Warm and modern living room styling",
    "indoorTypeId": "Interior Design_Interior Scene_Living Room",
    "indoorStyleId": "Interior_Interior Style_Popular_Vs_Modern Farmhouse"
  }'

Java (OkHttp)

import okhttp3.*;

import java.io.IOException;

public class VirtualStagingApiExample {

    private static final String BASE_URL = "https://api.ideal.house";
    private static final String API_KEY = "your_api_key_here";

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();

        String requestBody = """
                {
                    "imageUrl": "https://example.com/empty-bedroom.jpg",
                    "prompt": "Cozy contemporary bedroom",
                    "indoorTypeId": "Interior Design_Interior Scene_Bed Room",
                    "indoorStyleId": "Interior_Interior Style_Popular_Vs_Contemporary Warm"
                }
                """;

        Request request = new Request.Builder()
                .url(BASE_URL + "/api/v1/virtualStaging/generate")
                .addHeader("APIKEY", API_KEY)
                .addHeader("Content-Type", "application/json")
                .post(RequestBody.create(requestBody, MediaType.parse("application/json")))
                .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println("Response: " + response.body().string());
        }
    }
}

Python (requests)

import requests

BASE_URL = "https://api.ideal.house"
API_KEY  = "your_api_key_here"

headers = {
    "APIKEY": API_KEY,
    "Content-Type": "application/json"
}

payload = {
    "imageUrl": "https://example.com/empty-home-office.jpg",
    "prompt": "Minimal modern home office",
    "indoorTypeId": "Interior Design_Interior Scene_Home Office",
    "indoorStyleId": "Interior_Interior Style_Popular_Vs_Modern Minimal"
}

response = requests.post(
    f"{BASE_URL}/api/v1/virtualStaging/generate",
    headers=headers,
    json=payload
)

data = response.json()
task_id = data.get("data")
print(f"Task ID: {task_id}")

Node.js (axios)

const axios = require('axios');

const BASE_URL = 'https://api.ideal.house';
const API_KEY  = 'your_api_key_here';

async function createVirtualStagingTask() {
  try {
    const response = await axios.post(
      `${BASE_URL}/api/v1/virtualStaging/generate`,
      {
        imageUrl: 'https://example.com/empty-dining-room.jpg',
        prompt: 'Modern luxury dining room',
        indoorTypeId: 'Interior Design_Interior Scene_Dining Room',
        indoorStyleId: 'Interior_Interior Style_Popular_Vs_Modern Luxury'
      },
      {
        headers: {
          'APIKEY': API_KEY,
          'Content-Type': 'application/json'
        }
      }
    );

    const taskId = response.data.data;
    console.log('Task ID:', taskId);
    return taskId;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

createVirtualStagingTask();

πŸ“€ Response

Success Response

{
  "code": 0,
  "message": "success",
  "data": 1234567890123456789
}
FieldTypeDescription
codeinteger0 indicates success
messagestringResponse message
datalongThe unique task ID for polling results

2. Get Task Result

Retrieves the current status and output of a previously created virtual staging task.

Endpoint

GET /api/v1/virtualStaging/result

Request Headers

HeaderRequiredDescription
APIKEYβœ… YesYour API authentication key

Query Parameters

ParameterTypeRequiredDescription
taskIdlongβœ… YesThe task ID returned from the create task endpoint

πŸ“₯ Request Examples

cURL

curl -X GET "https://api.ideal.house/api/v1/virtualStaging/result?taskId=1234567890123456789" \
  -H "APIKEY: your_api_key_here"

Java (OkHttp)

import okhttp3.*;

import java.io.IOException;

public class VirtualStagingResultExample {

    private static final String BASE_URL = "https://api.ideal.house";
    private static final String API_KEY = "your_api_key_here";

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();
        long taskId = 1234567890123456789L;

        Request request = new Request.Builder()
                .url(BASE_URL + "/api/v1/virtualStaging/result?taskId=" + taskId)
                .addHeader("APIKEY", API_KEY)
                .get()
                .build();

        try (Response response = client.newCall(request).execute()) {
            System.out.println("Response: " + response.body().string());
        }
    }
}

Python (requests)

import requests
import time

BASE_URL = "https://api.ideal.house"
API_KEY  = "your_api_key_here"

headers = {
    "APIKEY": API_KEY
}

task_id = 1234567890123456789

while True:
    response = requests.get(
        f"{BASE_URL}/api/v1/virtualStaging/result",
        headers=headers,
        params={"taskId": task_id}
    )

    data = response.json()
    result = data.get("data", {})
    status = result.get("status")

    print(f"Status: {status}, Progress: {result.get('percentage')}%, Queue: {result.get('waitNumber')}")

    if status in ("Success", "Failed"):
        break

    time.sleep(3)

if status == "Success":
    output = result["output"]
    print("Result URL:", output["resultUrl"])
    print("Size:", output["width"], "x", output["height"])
else:
    print("Task ended with status:", status)

Node.js (axios)

const axios = require('axios');

const BASE_URL = 'https://api.ideal.house';
const API_KEY  = 'your_api_key_here';

async function pollResult(taskId) {
  const headers = { 'APIKEY': API_KEY };

  while (true) {
    const response = await axios.get(
      `${BASE_URL}/api/v1/virtualStaging/result`,
      {
        headers,
        params: { taskId }
      }
    );

    const result = response.data.data;
    const { status, percentage, waitNumber } = result;

    console.log(`Status: ${status} | Progress: ${percentage}% | Queue: ${waitNumber}`);

    if (['Success', 'Failed'].includes(status)) {
      if (status === 'Success') {
        console.log('Result URL:', result.output.resultUrl);
        console.log('Size:', result.output.width, 'x', result.output.height);
      } else {
        console.log('Task ended with status:', status);
      }
      break;
    }

    await new Promise(resolve => setTimeout(resolve, 3000));
  }
}

pollResult(1234567890123456789n);

πŸ“€ Response

Success Response (Task Completed)

{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Success",
    "waitNumber": 0,
    "percentage": 100,
    "input": {
      "imageUrl": "https://example.com/empty-room.jpg",
      "prompt": "modern country living room with warm neutral materials",
      "indoorTypeId": "Interior Design_Interior Scene_Living Room",
      "indoorStyleId": "Interior_Interior Style_Popular_Vs_Modern Farmhouse"
    },
    "output": {
      "resultUrl": "https://cdn.ideal.house/output/virtual_staging_result.jpg",
      "width": 1024,
      "height": 1024
    }
  }
}

Response (Task Processing / In Queue)

{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Processing",
    "waitNumber": 1,
    "percentage": 46,
    "input": {
      "imageUrl": "https://example.com/empty-room.jpg",
      "prompt": "coastal bedroom with soft light and natural textures",
      "indoorTypeId": "Interior Design_Interior Scene_Bed Room",
      "indoorStyleId": "Interior_Interior Style_Popular_Vs_Contemporary Warm"
    },
    "output": null
  }
}

Response (Task Failed)

{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Failed",
    "waitNumber": 0,
    "percentage": 100,
    "input": {
      "imageUrl": "https://example.com/empty-room.jpg",
      "prompt": "..."
    },
    "output": null
  }
}

Response Fields

FieldTypeDescription
idlongTask unique identifier
statusstringCurrent task status (see Task Status)
waitNumberintegerNumber of tasks ahead in queue (0 means currently processing)
percentageintegerTask completion percentage (0-100)
errorReasonstringFailure reason when status is Failed
inputobjectOriginal input parameters submitted for this task
input.imageUrlstringSource room image URL
input.promptstringUser prompt (if provided)
input.indoorTypeIdstringRoom type preset used (if provided)
input.indoorStyleIdstringInterior style preset used (if provided)
outputobjectGeneration result (available only when status is Success)
output.resultUrlstringURL of the generated virtual staging result image
output.widthintegerOutput image width in pixels
output.heightintegerOutput image height in pixels

πŸ“Š Task Status

StatusMeaning
UnprocessedTask is created and waiting in queue
ProcessingTask is currently running
SuccessTask completed successfully
FailedTask failed and no output was produced

❌ Error Responses

All error responses share the same JSON structure:

{
  "code": 5002,
  "message": "Invalid API Key",
  "data": null
}

Error Code Reference

CodeNameDescriptionSuggested Action
1001FAILEDRequest failed (generic error)Check the message field for specific details
1003INTERNAL_ERRORInternal server errorRetry after a short delay; contact support if it persists
1011PARAM_ERRORRequest parameter error (for example, missing imageUrl)Ensure imageUrl is provided and is a valid URL
5002API_KEY_INVALIDInvalid or missing API KeyEnsure the APIKEY header is present and correct
9010SCAN_TEXT_ERRORPrompt failed content moderationRevise the prompt to remove sensitive or prohibited content
9038PROHIBITED_CONTENTGenerated output image contains prohibited contentAdjust prompt/style/inputs and retry
9051COINS_NOT_ENOUGHInsufficient creditsTop up credits and retry

πŸ“„ For full common error definitions, see Error Code Reference.


β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                         β”‚
β”‚  Prepare:                                               β”‚
β”‚    - imageUrl (publicly accessible room image) [req]    β”‚
β”‚    - prompt (style guidance) [optional]                 β”‚
β”‚                                                         β”‚
β”‚  1. POST /api/v1/virtualStaging/generate               β”‚
β”‚     β†’ Receive taskId (1 credit deducted)               β”‚
β”‚                                                         β”‚
β”‚  2. Wait 3-5 seconds                                   β”‚
β”‚                                                         β”‚
β”‚  3. GET /api/v1/virtualStaging/result?taskId={taskId}  β”‚
β”‚     β†’ Check status                                     β”‚
β”‚                                                         β”‚
β”‚     status == "Unprocessed" or "Processing"            β”‚
β”‚       β†’ Continue polling every 3-5 seconds             β”‚
β”‚                                                         β”‚
β”‚     status == "Success"                                β”‚
β”‚       β†’ Read output.resultUrl / width / height         β”‚
β”‚                                                         β”‚
β”‚     status == "Failed"                                 β”‚
β”‚       β†’ Handle errorReason and error code              β”‚
β”‚       β†’ Credits are refunded automatically             β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚠️ Notes

  1. imageUrl must be a publicly accessible URL.
  2. For best results, upload clear room photos with minimal motion blur.
  3. Poll every 3-5 seconds to reduce unnecessary API traffic.
  4. If task status is Failed, the deducted credit is automatically refunded.

Β© Ideal House AI β€” All rights reserved.