Update Process Element rpa.item.update

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

Who can execute the method: a user allowed to edit stage items or change the item stage, or the element author allowed to start the workflow

DEPRECATED

The development of this method has been halted. Please use Smart scripts as an alternative functionality.

This method updates the element with the identifier id in the process with the identifier typeId.

The method checks permissions in the following order.

  1. The user must be able to view the element. All Bitrix24 employees can view elements; they are not available to extranet users. Without view access, the method returns an error and does not return the element data. The error code depends on the request:

    • RPA_ITEM_MOVE_ACCESS_DENIED — the request contains stageId
    • RPA_ITEM_MODIFY_ACCESS_DENIED — the request contains custom fields
    • RPA_ITEM_VIEW_ACCESS_DENIED — in all other cases
  2. If the request contains stageId, the method checks the permission to change the stage. The user has it if any of the following is true:

    • the user is listed in the "Users allowed to change item stage" setting of the current stage
    • the user is the element author and is listed in "Users allowed to start the workflow"
    • the user is the element author, and the element is at the first stage
  3. If the request changes custom field values, the method checks the permission to edit the element. The user has it if any of the following is true:

    • the user is listed in the "Users allowed to edit stage items" setting of the current stage
    • the user is the element author and is listed in "Users allowed to start the workflow". In this case, the user can edit their own element at any stage

A Bitrix24 administrator passes all checks. The permission to start the workflow does not allow editing or moving other users' elements.

If the request does not change field values, for example, it passes the current values, the edit permission is not checked.

Method Parameters

Required parameters are marked with *

Name
type

Description

typeId
integer

Process identifier

id
integer

Element identifier

fields*
object

Object containing values for custom fields of the element

Parameter fields

Name
type

Description

stageId
integer

Stage identifier

UF_RPA_...
any

Values for custom fields. The format for passing values depends on the field type

Code Examples

  1. Upload a new file to replace the old one (non-multiple field)

    To replace a file in a non-multiple field, simply upload the new file. The old one will be automatically deleted.

    {
                "fields": {
                    "UF_RPA_1_1585069397": [
                        "myfile.pdf", "...base64_encoded_file_content..."
                    ]
                }
            }
            
  2. Remove the value of a custom file field

    To do this, simply pass an empty string '' instead of the value.

  3. Keep the value of a non-multiple file field unchanged

    The simplest option is to not include the key for this field in fields. However, if you need to pass it without changing it, you should provide a list where the key id contains the file identifier.

    {
                "fields": {
                    "UF_RPA_1_1585069397": {
                        "id": 433    
                    }
                }
            }
            

    Warning

    If a value different from the current one is passed in id, the field value will be reset and the file will be deleted.

  4. Working with a multiple file field

    The value of a multiple field is an array. Each element of the array follows the same rules as for non-multiple values.

  5. Partial overwrite of a multiple file field value

    For example, currently the multiple file field contains the values [12, 255, 44].

    You need to keep files 12 and 44, and upload a new file instead of 255.

    The request should look as follows:

    {
                "fields": {
                    "UF_RPA_1_1585069397": [
                        {
                            "id": 12
                        },
                        {
                            "id": 44
                        },
                        [
                            "myNewFile.pdf",
                            "...base64_encoded_file_content..."
                        ]
                    ]
                }
            }
            

Error Handling

HTTP Status: 400

{
            "error": "RPA_ITEM_MODIFY_ACCESS_DENIED",
            "error_description": "You do not have permission to edit items in stage Approval"
        }
        

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

Value

400

RPA_ITEM_VIEW_ACCESS_DENIED

You don't have permission to view this item

The user cannot view the element, and the request contains neither stageId nor custom fields

400

RPA_ITEM_MOVE_ACCESS_DENIED

You do not have permission to change item stage from stage #STAGE#

No permission to change the element stage. If the user cannot view the element, the error description is "You don't have permission to view this item"

400

RPA_ITEM_MODIFY_ACCESS_DENIED

You do not have permission to edit items in stage #STAGE#

No permission to edit the element. If the user cannot view the element, the error description is "You don't have permission to view this item"

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