[comment]: # translation:outdated

[comment]: # ({7063b41c-7063b41c})
# token.update

[comment]: # ({/7063b41c-7063b41c})

[comment]: # ({677d903b-f2679bab})
### Описание

`object token.update(объект/массив tokens)`

Этот метод позволяет обновлять существующие токены.

::: noteclassic
Для роли пользователя требуется [разрешение](/manual/web_interface/frontend_sections/users/user_roles#configuration) *Управление токенами API*, чтобы управлять токенами для других пользователей.
:::

[comment]: # ({/677d903b-f2679bab})

[comment]: # ({new-416a8426})
### Parameters

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

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

The method accepts tokens with the [standard token properties](object).

[comment]: # ({/new-416a8426})

[comment]: # ({d0adc398-d0adc398})
### Возвращаемые значения

`(object)` Возвращает объект, содержащий идентификаторы обновлённых токенов, указанных 
в свойстве `tokenids`.

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

[comment]: # ({b41637d2-b41637d2})
### Примеры

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

[comment]: # ({63919922-4f041664})
#### Удаление срок действия токена

Удалить дату истечения срока действия из токена.

Запрос:

```json
{
    "jsonrpc": "2.0",
    "method": "token.update",
    "params": {
        "tokenid": "2",
        "expires_at": "0"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Ответ:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "tokenids": [
            "2"
        ]
    },
    "id": 1
}
```

[comment]: # ({/63919922-4f041664})

[comment]: # ({63651b34-63651b34})
### Источник

CToken::update() в *ui/include/classes/api/services/CToken.php*.

[comment]: # ({/63651b34-63651b34})
