Get a list of registered user field types userfieldtype.list
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Scope:
placementWho can execute the method: administrator
The method retrieves a list of user field types registered by the application. It returns a list of field types with pagination.
No parameters.
Code Examples
How to Use Examples in Documentation
cURL (Webhook)
cURL (OAuth)
JS (TS)
JS (UMD)
Python
PHP
BX24.js
PHP CRest
Go
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/userfieldtype.list
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}' \
https://**put_your_bitrix24_address**/rest/userfieldtype.list
// 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
// Shape of each UserFieldTypeItem returned in result[]
type UserFieldTypeItem = {
USER_TYPE_ID: string
HANDLER: string
TITLE: string
DESCRIPTION: string
}
// userfieldtype.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
try {
const response = await $b24.actions.v2.call.make<UserFieldTypeItem[]>({
method: 'userfieldtype.list',
params: {
start: 0,
},
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('User field types count:', result.length, result)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- 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 listUserFieldTypes() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
// userfieldtype.list returns a single page (max 50 records). For the whole result set
// use a list helper: $b24.actions.v2.callList.make() returns every record as one
// array, $b24.actions.v2.fetchList.make() yields them in chunks (async generator).
// NOTE: the list helpers do not accept `order` (it is excluded from their params, so
// passing it is a TS error) — keep this call.make + `start` variant when sort matters.
const response = await $b24.actions.v2.call.make({
method: 'userfieldtype.list',
params: {
start: 0,
},
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('User field types count:', result.length, result)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', listUserFieldTypes)
</script>
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
try:
bitrix_response = client.userfieldtype.list(
start=0,
).response
result = bitrix_response.result
print(result)
except BitrixAPIError as error:
print(
"Bitrix API error",
f"error: {error.error}",
f"error_description: {error.error_description}",
sep="\n",
)
except BitrixSDKException as error:
print(f"Bitrix SDK error: {error.message}")
except Exception as error:
print(f"Unexpected error: {error}")
try {
$userFieldTypesResult = $serviceBuilder->getPlacementScope()->userFieldType()->list();
$userFieldTypes = $userFieldTypesResult->getUserFieldTypes();
foreach ($userFieldTypes as $userFieldType) {
print("Description: " . $userFieldType->DESCRIPTION . "\n");
print("Handler: " . $userFieldType->HANDLER . "\n");
print("Title: " . $userFieldType->TITLE . "\n");
print("User Type ID: " . $userFieldType->USER_TYPE_ID . "\n");
}
} catch (Throwable $e) {
print("Error: " . $e->getMessage());
}
BX24.callMethod(
'userfieldtype.list',
{},
function(result)
{
if(result.error())
console.error(result.error());
else
console.log(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'userfieldtype.list',
[]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
// client and ctx are already created — see the Go SDK section
res, err := client.Core().Call(ctx, "userfieldtype.list", nil, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("userfieldtype.list: %w", err)
}
var items []struct {
UserTypeID string `json:"USER_TYPE_ID"`
Handler string `json:"HANDLER"`
Title string `json:"TITLE"`
Description string `json:"DESCRIPTION"`
}
if err := json.Unmarshal(res.Result, &items); err != nil {
return fmt.Errorf("parse response: %w", err)
}
for _, it := range items {
fmt.Println(it.UserTypeID, it.Handler)
}
// Total and Next are filled in by list methods; for a full
// list traversal, use client.Core().Pages and Scan.
if res.Total != nil {
fmt.Println("total:", *res.Total)
}
Response Handling
HTTP status: 200
{
"result": [
{
"USER_TYPE_ID": "my_custom_type_2",
"HANDLER": "http:\/\/test.com\/test2.php",
"TITLE": "test title 2",
"DESCRIPTION":"test desc 2"
},
{
"USER_TYPE_ID": "my_custom_type_1",
"HANDLER": "http:\/\/test.com\/test1.php",
"TITLE": "test title 1",
"DESCRIPTION": "test desc 1"
},
{
"USER_TYPE_ID": "test_user_type",
"HANDLER": "http:\/\/test.com\/test.php",
"TITLE": "test title",
"DESCRIPTION": "test desc"
}
],
"total": 3,
"time": {
"start": 1724423274.842117,
"finish": 1724423275.558021,
"duration": 0.7159039974212646,
"processing": 0.0018908977508544922,
"date_start": "2024-08-23T16:27:54+02:00",
"date_finish": "2024-08-23T16:27:55+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Root element of the response |
|
total |
Number of processed records |
|
time |
Information about the execution time of the request |