> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iacrea.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exterior Improvement API

> API documentation for the exterior improvement service

# Exterior Improvement API

The exterior improvement service allows you to virtually transform the appearance of buildings, gardens, terraces, and other outdoor spaces.

## Generate an exterior improvement

<ParamField path="POST /api/exterior/v2/generate" />

### Request Parameters

<ParamField body="user_id" type="string" required>
  The unique user identifier (UUID)
</ParamField>

<ParamField body="image_url" type="string" required>
  URL of the outdoor space image to transform
</ParamField>

<ParamField body="room_type" type="string" required>
  The type of outdoor space to improve. Accepted values: JARDIN, GAZON, POOL, BALCON, TERRACE.
</ParamField>

<ParamField body="keep_facade" type="boolean">
  If enabled, preserves the building facade (optional)
</ParamField>

<ParamField body="blue_sky" type="boolean">
  If enabled, adds a blue sky to the image (optional)
</ParamField>

<ParamField body="webhook" type="string">
  Webhook URL for notifications (optional)
</ParamField>

### Available values for room\_type

The following values are accepted for the `room_type` parameter:

* `JARDIN` - Garden with flowers and plants
* `GAZON` - Green lawn
* `POOL` - Garden with swimming pool
* `BALCON` - Balcony or small terrace
* `TERRACE` - Larger terrace

### Response

<ResponseField name="generation_id" type="string">
  The unique generation identifier (UUID)
</ResponseField>

<ResponseField name="remaining_photos" type="number">
  The number of photo credits remaining for the user
</ResponseField>

<ResponseField name="project_id" type="string">
  The unique project identifier (UUID)
</ResponseField>

### Request Example

```bash theme={null}
curl -X POST https://api.iacrea.ai/api/exterior/v2/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "123e4567-e89b-12d3-a456-426614174000",
    "image_url": "https://example.com/exterior.jpg",
    "room_type": "JARDIN",
    "keep_facade": true,
    "blue_sky": true
  }'
```

### Response Example

```json theme={null}
{
  "generation_id": "123e4567-e89b-12d3-a456-426614174001",
  "remaining_photos": 9,
  "project_id": "123e4567-e89b-12d3-a456-426614174002"
}
```

## Generate a variation

<ParamField path="POST /api/exterior/v2/generate-variation" />

This API allows you to generate variations from a previous result.

### Request Parameters

<ParamField body="user_id" type="string" required>
  The unique user identifier (UUID)
</ParamField>

<ParamField body="generation_id" type="string" required>
  The identifier of the previous generation you want to create a variation of
</ParamField>

<ParamField body="room_type" type="string" required>
  The type of outdoor space to improve. Accepted values: JARDIN, GAZON, POOL, BALCON, TERRACE.
</ParamField>

<ParamField body="keep_facade" type="boolean">
  If enabled, preserves the building facade (optional)
</ParamField>

<ParamField body="blue_sky" type="boolean">
  If enabled, adds a blue sky to the image (optional)
</ParamField>

<ParamField body="webhook" type="string">
  Webhook URL for notifications (optional)
</ParamField>

### Response

<ResponseField name="generation_id" type="string">
  The unique identifier of the new generation (UUID)
</ResponseField>

### Request Example

```bash theme={null}
curl -X POST https://api.iacrea.ai/api/exterior/v2/generate-variation \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "123e4567-e89b-12d3-a456-426614174000",
    "generation_id": "123e4567-e89b-12d3-a456-426614174001",
    "room_type": "POOL",
    "keep_facade": false,
    "blue_sky": true
  }'
```

### Response Example

```json theme={null}
{
  "generation_id": "123e4567-e89b-12d3-a456-426614174003"
}
```

## Retrieve an exterior improvement

<ParamField path="POST /api/exterior/v2/get" />

### Request Parameters

<ParamField body="user_id" type="string" required>
  The unique user identifier (UUID)
</ParamField>

<ParamField body="generation_id" type="string" required>
  The unique generation identifier (UUID) returned by the `/api/exterior/v2/generate` or `/api/exterior/v2/generate-variation` endpoint
</ParamField>

### Response

The endpoint returns the generation status and the URLs of the resulting images when processing is complete.

<ResponseField name="status" type="string">
  Generation status: "starting", "in\_progress", "succeeded", "failed"
</ResponseField>

<ResponseField name="output_url" type="string">
  URL of the transformed image (only present if status="succeeded")
</ResponseField>

### Request Example

```bash theme={null}
curl -X POST https://api.iacrea.ai/api/exterior/v2/get \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "123e4567-e89b-12d3-a456-426614174000",
    "generation_id": "123e4567-e89b-12d3-a456-426614174001"
  }'
```

### Response Example

```json theme={null}
{
  "status": "succeeded",
  "output_url": "https://storage.iacrea.ai/output/123e4567-e89b-12d3-a456-426614174001.jpg"
}
```
