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: placement

Who can execute the method: administrator

The method userfieldtype.list returns the user field types that the application registered with the method userfieldtype.add. For each type, the method returns the code, the handler address, the name, and the description.

A field of such a type is displayed in the CRM item card, and its content is loaded by the application handler. The general workflow is described in the article Custom Field Types.

Use the method to retrieve the type code USER_TYPE_ID before calling userfieldtype.update or userfieldtype.delete.

The method works only in the context of an application

Method Parameters

Name
type

Description

start
integer

Offset for pagination. The method returns no more than 50 records per call. To retrieve the next page, pass the next value from the previous response: 50 for the second page, 100 for the third. For details, see the article Features of List Methods

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"start":0,"auth":"**put_access_token_here**"}' \
        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).
        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).
              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',
            { start: 0 },
            function(result)
            {
                if(result.error())
                    console.error(result.error());
                else
                    console.log(result.data());
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'userfieldtype.list',
            ['start' => 0]
        );
        
        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
type

Description

result
array

List of registered user field types (detailed description). If the application has not registered any types, the list is empty

next
integer

Offset for the next page. Pass the value in the start parameter to retrieve the next 50 records. The key is present in the response only if there are records left

total
integer

Total number of types registered by the application

time
time

Information about the execution time of the request

Element of the result Array

The field values are set by the application when registering the type with the method userfieldtype.add.

Name
type

Description

USER_TYPE_ID
string

Short type code passed at registration. It is accepted by userfieldtype.update and userfieldtype.delete. The full type code for creating a field is built as rest_<APP_ID>_<USER_TYPE_ID>, as described in the article Custom Field Types

HANDLER
string

Address of the type handler. Bitrix24 loads this address in a frame inside the field

TITLE
string

Name of the type in the administrative interface for configuring user fields

DESCRIPTION
string

Description of the type in the administrative interface for configuring user fields

Error Handling

HTTP Status: 403

{
            "error": "WRONG_AUTH_TYPE",
            "error_description": "Current authorization type is denied for this method Application context required"
        }
        

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Status

Code

Description

Meaning

403

WRONG_AUTH_TYPE

Current authorization type is denied for this method Application context required

The method was called outside the application context, for example via a webhook

403

ACCESS_DENIED

Access denied!

The method was called by a user without administrator permissions

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open it on an on-premise installation, disable the "Temporary closure of the public part of the site" option. Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning