> For the complete documentation index, see [llms.txt](https://docs.archisketch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.archisketch.com/guide/dev-en/api-sdk/api-integration/3d-product-integration/parametric.md).

# Register Parametric Component

A parametric component is an advanced component type that lets users dynamically configure parameters like dimensions and colors. Unlike general components, users can directly adjust these parameter values within the Archisketch editor.

You must include the `X-API-KEY` in the header of all API requests. Refer to the ["How to Use the API" ](/guide/dev-en/api-sdk/how-to-use.md)guide for instructions on how to issue it.

```http
X-API-KEY: {x-api-key}
```

## Create Parametric Component

**POST** `/api/v1/parametric`

{% stepper %}
{% step %}

### Prepare Required Information

In addition to general component information, a parametric component requires a parameter list and a composition list.

| Field              | Type    | Required | Text                                                                              |
| ------------------ | ------- | -------- | --------------------------------------------------------------------------------- |
| name               | string  | ✅        | Name                                                                              |
| parametricType     | string  | ✅        | Parametric type (`assembly`, `parametric-modeling`)                               |
| translatedNames    | array   | ✅        | Multilingual names                                                                |
| dimension          | object  | ✅        | Dimensions                                                                        |
| parameters         | array   | ✅        | Parameter list                                                                    |
| compositions       | array   | ✅        | Composition list                                                                  |
| images             | array   | ✅        | Image URL list                                                                    |
| isFinal            | boolean |          | Whether it is a final part (can be placed directly in the editor)                 |
| isPersonal         | boolean |          | Whether it belongs to a personal library                                          |
| modelingId         | string  |          | Modeling ID                                                                       |
| parametricModeling | object  |          | Parametric modeling details (used when `parametricType` is `parametric-modeling`) |
| {% endstep %}      |         |          |                                                                                   |

{% step %}

### Send Request

```json
POST /api/v1/parametric
X-API-KEY: {x-api-key}

{
  "name": "Parametric Sofa",
  "parametricType": "assembly",
  "translatedNames": [
    { "code": "en", "value": "Parametric Sofa" },
    { "code": "ko", "value": "파라메트릭 소파" }
  ],
  "dimension": {
    "mm": { "width": 0, "depth": 0, "height": 0 }
  },
  "images": [],
  "isFinal": true,
  "editorSetting": {
    "editorType": "STANDING_ITEM",
    "dimensionLock": { "width": false, "depth": false, "height": false }
  },
  "parameters": [
    {
      "displayName": "Width",
      "referenceName": "W",
      "type": "BASIC",
      "valueInfo": {
        "usage": "NUMBER",
        "value": "900",
        "optionType": "RANGE",
        "options": { "min": "100", "max": "2400", "stepSize": "1" }
      },
      "priority": 0
    }
  ],
  "compositions": [],
  "parametricModeling": null
}
```

{% endstep %}

{% step %}

### Check Response

Please save the generated parametric component ID. It will be used later for adding or updating parameters.

```json
{
  "result": "SUCCESS",
  "data": {
    "componentId": "pmc_abc123"
  }
}
```

{% endstep %}
{% endstepper %}

## Update Parametric Component

**PUT** `/api/v1/parametric/components/{id}`

The Request Body structure is identical to that of the creation endpoint.

| Parameter | Type   | Required | Description  |
| --------- | ------ | :------: | ------------ |
| id        | string |     ✅    | Component ID |

## Manage Parameters

### Get Parameter List

**GET** `/api/v1/parametric/components/{componentId}/parameters`

```http
GET /api/v1/parametric/components/pmc_abc123/parameters
X-API-KEY: {x-api-key}
```

### Add Parameters

**POST** `/api/v1/parametric/components/{componentId}/parameters`

| Field      | Type  | Required | Description                  |
| ---------- | ----- | :------: | ---------------------------- |
| parameters | array |     ✅    | List of parameters to create |

### Update Parameter

**POST** `/api/v1/parametric/components/parameters/{parameterId}`

| Field                 | Type    | Required | Description               |
| --------------------- | ------- | -------- | ------------------------- |
| displayName           | string  | ✅        | Display name              |
| referenceName         | string  | ✅        | Reference name            |
| type                  | string  | ✅        | Parameter type            |
| valueInfo             | object  | ✅        | Value information         |
| priority              | integer | ✅        | Priority                  |
| description           | string  |          | Description               |
| hideCondition         | string  |          | Hide condition expression |
| enterpriseParameterId | string  |          | Enterprise parameter ID   |

### Delete Single Parameter

**DELETE** `/api/v1/parametric/components/parameters/{parameterId}`

### Delete Multiple Parameters

**DELETE** `/api/v1/parametric/components/parameters`

| Field        | Type  | Required | Description                     |
| ------------ | ----- | :------: | ------------------------------- |
| parameterIds | array |     ✅    | List of parameter IDs to delete |
