> ## 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 Creation API

> API documentation for the exterior creation service

# Exterior Creation API

The Exterior Creation service allows you to generate realistic visualizations of outdoor spaces from a designated area in an image.

## Generate an exterior creation

<ParamField path="POST /api/create_exterior/generate" />

This endpoint initiates a new generation to create an outdoor space in an area specified by a mask. This operation also creates a new project.

### Request Parameters

<ParamField body="user_id" type="string" required>
  The unique user identifier (UUID) that you can retrieve from your Developer Space
</ParamField>

<ParamField body="image_url" type="string" required>
  URL of the base image for creation (format: jpg, png)
</ParamField>

<ParamField body="mask_url" type="string" required>
  URL of the mask indicating the area where the exterior should be generated
</ParamField>

<ParamField body="room_type" type="string" required>
  Type of exterior to generate. Possible values: "TERRACE", "POOL", "PETANQUE"
</ParamField>

<ParamField body="width" type="number" required>
  Width of the image in pixels
</ParamField>

<ParamField body="height" type="number" required>
  Height of the image in pixels
</ParamField>

<ParamField body="webhook" type="string">
  The URL we call once the generation is complete
</ParamField>

### Response

<ResponseField name="generation_id" type="string">
  The unique generation identifier (UUID) to use with the retrieval API
</ResponseField>

<ResponseField name="remaining_photos" type="number">
  The number of photos remaining after this generation
</ResponseField>

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

### Request Example

```bash theme={null}
curl --request POST \
--url 'https://iacrea.com/api/create_exterior/generate' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "user_id": "uuid",
  "image_url": "https://example.com/image.jpg",
  "mask_url": "https://example.com/mask.png",
  "room_type": "TERRACE",
  "width": 1024,
  "height": 768
}'
```

### Response Example

```json theme={null}
{
  "generation_id": "uuid",
  "remaining_photos": 100,
  "project_id": "uuid"
}
```

## Generate an exterior variation

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

This endpoint allows you to generate a variation of a previously created exterior space.

### Request Parameters

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

<ParamField body="generation_id" type="string" required>
  The unique identifier of the previous generation
</ParamField>

<ParamField body="original_url" type="string" required>
  URL of the original image used for the previous generation
</ParamField>

<ParamField body="mask_url" type="string">
  Optional URL of a new mask. If not provided, the mask from the previous generation will be used
</ParamField>

<ParamField body="room_type" type="string" required>
  Type of exterior for this variation. Possible values: "TERRACE", "POOL", "PETANQUE"
</ParamField>

<ParamField body="webhook" type="string">
  The URL we call once the generation is complete
</ParamField>

### Response

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

### Request Example

```bash theme={null}
curl --request POST \
--url 'https://iacrea.com/api/create_exterior/generate-variation' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "user_id": "uuid",
  "generation_id": "uuid",
  "original_url": "https://example.com/image.jpg",
  "mask_url": "https://example.com/new-mask.png",
  "room_type": "POOL"
}'
```

### Response Example

```json theme={null}
{
  "generation_id": "uuid"
}
```

## Retrieve an exterior creation

<ParamField path="POST /api/create_exterior/get" />

This endpoint allows you to obtain the result of a previously performed generation.

### Request Parameters

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

<ParamField body="generation_id" type="string" required>
  The unique identifier of the generation to retrieve
</ParamField>

### Response

<ResponseField name="status" type="string">
  The generation status: "STARTING", "PROCESSING", "SUCCEEDED", "FAILED"
</ResponseField>

<ResponseField name="urls" type="array">
  An array containing the URLs of generated images (present only if status="SUCCEEDED")
</ResponseField>

<ResponseField name="variationNumber" type="number">
  The number of variations already performed on this project
</ResponseField>

### Request Example

```bash theme={null}
curl --request POST \
--url 'https://iacrea.com/api/create_exterior/get' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "user_id": "uuid",
  "generation_id": "uuid"
}'
```

### Response Example

```json theme={null}
{
  "status": "SUCCEEDED",
  "urls": ["https://generated-image-url"],
  "variationNumber": 0
}
```

**Important note:** In case of "FAILED" status, your photos are automatically refunded.
