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

# Create Product Attribute

> Create a custom product attribute via the WISEPIM API. Define field type, validation rules, and options for text, number, select, and other attribute formats.

Create a new attribute for products.

### Body Parameters

<ParamField body="code" type="string" required>
  Unique identifier for the attribute
</ParamField>

<ParamField body="label" type="string" required>
  Display label for the attribute
</ParamField>

<ParamField body="project" type="integer" required>
  Project ID
</ParamField>

<ParamField body="attribute_type" type="string" required>
  Type of attribute. One of: text, textarea, number, decimal, date, datetime, boolean, select, multiselect, color, image, file
</ParamField>

<ParamField body="is_required" type="boolean" default="false">
  Whether the attribute is required
</ParamField>

<ParamField body="options" type="array">
  Array of options for select/multiselect types
</ParamField>

<ParamField body="validation_rules" type="object">
  Validation rules for the attribute
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "code": "color",
    "label": "Color",
    "project": 1,
    "attribute_type": "select",
    "is_required": true,
    "options": ["red", "blue", "green"],
    "validation_rules": {
      "min_selections": 1,
      "max_selections": 1
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": 1,
    "code": "color",
    "label": "Color",
    "attribute_type": "select",
    "created_at": "2024-01-01T12:00:00Z"
  }
  ```
</ResponseExample>
