---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.1
alternate:
  - https://yandex.ru/dev/metrika/en/management/openapi/schema/createAttributes.md
  - https://yandex.ru/dev/metrika/ru/management/openapi/schema/createAttributes.md
  - href: ru/management/openapi/schema/createAttributes.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/metrika/ru/llms.txt

<!-- source: ru/management-src/Upravlenie-dannymi-o-klientah-i-zakazah-iz-CRM/createAttributes.md -->
<div class="openapi">

# Создание атрибутов

<!-- markdownlint-disable-file -->

Создает атрибуты клиентов и заказов. При создании пользовательских атрибутов не используйте идентификаторы системных атрибутов.
Чтобы получить список идентификаторов системных атрибутов, используйте метод [GET /cdp/api/v1/counter/{counterId}/schema/attributes](https://yandex.ru/dev/metrika/ru/management-src/Upravlenie-dannymi-o-klientah-i-zakazah-iz-CRM/getAttributes.md).

{% cut "Пример тела запроса" %}

```json translate=no
--data '{
        "attributes": [
            {
                "name": "dates_of_meetings",
                "type_name": "date",
                "multivalued": true,
                "humanized": "Даты обращений в магазин"
            },
            {
                "name": "age",
                "type_name": "numeric",
                "multivalued": false,
                "humanized": "Возраст"
            },
            {
                "name": "first_seen",
                "type_name": "date",
                "multivalued": false,
                "humanized": "Первый заказ"
            }
        ]
    }'
```

{% endcut %}


## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/schema/attributes
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_counterId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Идентификатор счетчика.
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_entity_type_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Принадлежность атрибутов.
Возможные значения:
- `CONTACT` — принадлежность контактам.
- `COMPANY` — принадлежность компаниям.
- `ORDER` — принадлежность заказам.
- `SIMPLE_ORDER` — принадлежность простым заказам.


_Example:_{.json-schema-reset .json-schema-example} `CONTACT`
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "attributes": [
    {
      "name": "example",
      "multivalued": true,
      "humanized": "example"
    }
  ]
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_attributes_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [Attribute](#entity-Attribute)[]

Атрибуты списка.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "name": "example",
    "multivalued": true,
    "humanized": "example"
  }
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### Attribute {#entity-Attribute}

Описание объекта `Attribute`.

#|
|| **Name** | **Description** ||
||

_multivalued_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

Определяет, может ли атрибут иметь несколько значений.
{.table-cell}
||
||

_name_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Идентификатор атрибута.

_Min length:_{.json-schema-reset .json-schema-assertion} `1`

_Max length:_{.json-schema-reset .json-schema-assertion} `255`

_Pattern:_{.json-schema-reset .json-schema-assertion} `^[\w-:]+$`

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_humanized_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Название атрибута.

_Min length:_{.json-schema-reset .json-schema-assertion} `0`

_Max length:_{.json-schema-reset .json-schema-assertion} `4096`

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "multivalued": true,
  "humanized": "example"
}
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "success": true
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_success_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean

Результат выполнения операции.

_Default:_{.json-schema-reset .json-schema-value} `true`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>
<!-- endsource: ru/management-src/Upravlenie-dannymi-o-klientah-i-zakazah-iz-CRM/createAttributes.md -->

[*Deprecated]: No longer supported, please use an alternative and newer version.