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

# Create attribute

> Create a single attribute or bulk upsert multiple attributes.

Create one attribute by sending `key`, `label`, and `type`. Re-posting the same `key` updates the attribute and returns **200** (first create returns **201**). For sync workflows, send an `attributes` array to upsert up to 500 attributes per request.

## Request body (single)

<ParamField body="key" type="string" required>
  Stable key (letters, digits, underscores; must start with a letter).
</ParamField>

<ParamField body="label" type="string" required>
  Human-readable label.
</ParamField>

<ParamField body="type" type="string" required>
  One of: `text`, `number`, `url`, `email`, `date`, `boolean`, `richtext`, `enum`, `tags`, `image`, `images`, `file`, `files`, `json`.
</ParamField>

<ParamField body="enum_values" type="array">
  Allowed values when `type` is `enum`.
</ParamField>

<ParamField body="tags_values" type="array">
  Suggested values when `type` is `tags`.
</ParamField>

<ParamField body="description" type="string">
  Optional description.
</ParamField>

## Request body (bulk)

<ParamField body="attributes" type="array" required>
  Array of attribute objects (same fields as single create). Max 500 per request.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://hub.banditshq.com/api/v1/attributes" \
    -H "Authorization: Bearer lasso_..." \
    -H "Content-Type: application/json" \
    -d '{
      "key": "color",
      "label": "Color",
      "type": "enum",
      "enum_values": ["Red", "Blue"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Single create (201) theme={null}
  {
    "id": "a1b2c3d4-...",
    "key": "color",
    "label": "Color",
    "type": "enum",
    "enum_values": ["Red", "Blue"],
    "tags_values": null,
    "boolean_config": null,
    "description": null,
    "validation": null,
    "is_reviewed": false,
    "source_id": null,
    "external_id": null,
    "source_synced_at": null,
    "created_at": "2026-06-21T10:00:00.000Z",
    "updated_at": "2026-06-21T10:00:00.000Z"
  }
  ```
</ResponseExample>
