[comment]: # ({5102e8bb-5102e8bb})
# screen.update

[comment]: # ({/5102e8bb-5102e8bb})

[comment]: # ({ff6dac41-ff6dac41})
### Description

`object screen.update(object/array screens)`

This method allows to update existing screens.

[comment]: # ({/ff6dac41-ff6dac41})

[comment]: # ({5b6fdfad-6da273d1})
### Parameters

`(object/array)` Screen properties to be updated.

The `screenid` property must be defined for each screen, all other
properties are optional. Only the passed properties will be updated, all
others will remain unchanged.

Additionally to the [standard screen properties](object#screen), the
method accepts the following parameters.

|Parameter|Type|Description|
|---------|----|-----------|
|screenitems|array|Screen items to replace existing screen items.<br><br>Screen items are updated by coordinates, so each screen item must have the `x` and `y` properties defined.|
|users|array|Screen user shares to replace the existing elements.|
|userGroups|array|Screen user group shares to replace the existing elements.|

[comment]: # ({/5b6fdfad-6da273d1})

[comment]: # ({a7d28486-a7d28486})
### Return values

`(object)` Returns an object containing the IDs of the updated screens
under the `screenids` property.

[comment]: # ({/a7d28486-a7d28486})

[comment]: # ({b41637d2-b41637d2})
### Examples

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({136c04cc-136c04cc})
#### Renaming a screen

Rename a screen to "CPU Graphs".

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "screen.update",
    "params": {
        "screenid": "26",
        "name": "CPU Graphs"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "screenids": [
            "26"
        ]
    },
    "id": 1
}
```

[comment]: # ({/136c04cc-136c04cc})

[comment]: # ({770bf5d2-770bf5d2})
#### Change screen owner

Available only for admins and super admins.

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "screen.update",
    "params": {
        "screenid": "83",
        "userid": "1"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 2
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "screenids": [
            "83"
        ]
    },
    "id": 2
}
```

[comment]: # ({/770bf5d2-770bf5d2})

[comment]: # ({60031f32-60031f32})
### See also

-   [Screen item](/manual/api/reference/screenitem/object#screen_item)
-   [screenitem.create](/manual/api/reference/screenitem/create)
-   [screenitem.update](/manual/api/reference/screenitem/update)
-   [screenitem.updatebyposition](/manual/api/reference/screenitem/updatebyposition)
-   [Screen user](object#screen_user)
-   [Screen user group](object#screen_user_group)

[comment]: # ({/60031f32-60031f32})

[comment]: # ({c7ef95ff-c7ef95ff})
### Source

CScreen::update() in
*frontends/php/include/classes/api/services/CScreen.php*.

[comment]: # ({/c7ef95ff-c7ef95ff})
