# crm.userfield.settings.fields

URL: https://chugunov.pro/api-bitrix24/crm/universal/user-defined-fields/crm-userfield-settings-fields/
Проверено на Битрикс24 REST API, обновлено 11.09.2026 (ревизия источника fb39d6c).
Источник: официальная документация Битрикс24 (bitrix-tools/b24-rest-docs, лицензия MIT, © Bitrix). Справочник независимый, официальной документацией не является.

Получить описание полей настроек для типа пользовательского поля
Scope: `crm`
Кто может выполнять метод: любой пользователь

## Описание

Метод `crm.userfield.settings.fields` возвращает описание полей настроек для указанного типа пользовательского поля.

## Параметры

- `type` `string` — обязательный. Тип пользовательского поля. Значение из списка, который возвращает метод [crm.userfield.types](https://chugunov.pro/api-bitrix24/crm/universal/user-defined-fields/crm-userfield-types/)

## Ответ

HTTP-статус: 200

```json
{
    "result": {
        "DEFAULT_VALUE": {
            "type": "double",
            "title": "Значение по умолчанию"
        },
        "PRECISION": {
            "type": "int",
            "title": "Точность"
        }
    },
    "time": {
        "start": 1752132864.335154,
        "finish": 1752132864.366912,
        "duration": 0.03175783157348633,
        "processing": 0.002053976058959961,
        "date_start": "2025-07-10T10:34:24+03:00",
        "date_finish": "2025-07-10T10:34:24+03:00",
        "operating_reset_at": 1752133464,
        "operating": 0
    }
}
```

### Возвращаемые данные

- `result` `object`. Корневой элемент ответа с настройками поля. Итоговый перечень полей зависит от типа запрошенного поля
- `time` `time`. Информация о времени выполнения запроса

## Ошибки

HTTP-статус: 400

```json
{
    "error": "",
    "error_description": "Parameter 'type' is not specified or empty."
}
```

- `400` — Пустое значение. Parameter 'type' is not specified or empty

## Примеры запроса

### cURL (Webhook)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"type":"double"}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.userfield.settings.fields
```

### cURL (OAuth)

```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"type":"double","auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.userfield.settings.fields
```

### JS (TS)

```ts
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame } from '@bitrix24/b24jssdk'

declare const $b24: B24Frame

type UserfieldSettingsItem = {
  type: string
  title: string
}

// Shape of the payload returned in result (match the "response handling" section of the page)
type UserfieldSettingsResult = Record<string, UserfieldSettingsItem>

try {
  const response = await $b24.actions.v2.call.make<UserfieldSettingsResult>({
    method: 'crm.userfield.settings.fields',
    params: {
      type: 'double',
    },
    requestId: Text.getUuidRfc4122()
  })

  // The payload is available only on a successful response
  if (!response.isSuccess) {
    console.error(response.getErrorMessages().join('; '))
  } else {
    const result = response.getData()!.result
    console.info(Object.keys(result), result)
  }
} catch (error) {
  // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
  console.error(error)
}
```

### JS (UMD)

```html
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
  async function fetchUserfieldSettingsFields() {
    try {
      // Initialize the SDK inside a Bitrix24 frame
      const $b24 = await B24Js.initializeB24Frame()

      const response = await $b24.actions.v2.call.make({
        method: 'crm.userfield.settings.fields',
        params: {
          type: 'double',
        },
        requestId: B24Js.Text.getUuidRfc4122()
      })

      // The payload is available only on a successful response
      if (!response.isSuccess) {
        console.error(response.getErrorMessages().join('; '))
        return
      }

      const result = response.getData().result
      console.info(Object.keys(result), result)
    } catch (error) {
      // Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
      console.error(error)
    }
  }

  document.addEventListener('DOMContentLoaded', fetchUserfieldSettingsFields)
</script>
```

### Python

```python
from b24pysdk.errors import BitrixAPIError, BitrixSDKException

try:
    bitrix_response = client.crm.userfield.settings.fields(
        type="string",
    ).response
    result = bitrix_response.result
    print(result)
except BitrixAPIError as error:
    print(
        "Ошибка Bitrix API",
        f"error: {error.error}",
        f"error_description: {error.error_description}",
        sep="\n",
    )
except BitrixSDKException as error:
    print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
    print(f"Непредвиденная ошибка: {error}")
```

### PHP

```php
try {
    $response = $b24Service
        ->core
        ->call(
            'crm.userfield.settings.fields',
            [
                'type' => 'double'
            ]
        );

    $result = $response
        ->getResponseData()
        ->getResult();

    if ($result->error()) {
        error_log($result->error());
        echo 'Error: ' . $result->error();
    } else {
        echo 'Success: ' . print_r($result->data(), true);
    }

} catch (Throwable $e) {
    error_log($e->getMessage());
    echo 'Error fetching CRM userfield settings fields: ' . $e->getMessage();
}
```

### BX24.js

```js
BX24.callMethod(
    "crm.userfield.settings.fields",
    {
        type: "double"
    },
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.dir(result.data());
    }
);
```

### PHP CRest

```php
require_once('crest.php');

$result = CRest::call(
    'crm.userfield.settings.fields',
    [
        'type' => 'double'
    ]
);

echo '<PRE>';
print_r($result);
echo '</PRE>';
```

### Go

```go
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "crm.userfield.settings.fields", b24.Params{
	"type": "double",
}, b24.WithIdempotent())
if err != nil {
	return fmt.Errorf("crm.userfield.settings.fields: %w", err)
}

keys, ok := b24.Keys(res.Result)
if !ok {
	return fmt.Errorf("ожидался объект в ответе")
}
fmt.Println("полей в ответе:", len(keys))
```

Оригинал в официальной документации: https://apidocs.bitrix24.ru/api-reference/crm/universal/user-defined-fields/crm-userfield-settings-fields.html
