[comment]: # ({3466d178-389b3928})
# history.push

[comment]: # ({/3466d178-389b3928})

[comment]: # ({5e478835-a90ea165})
#### Description

`object history.push(object/array itemHistoryData)`

This method allows sending item history data to Zabbix server.

::: noteclassic
This method is available to users of any type.
Permissions to call the method can be revoked in user role settings.
See [User roles](/manual/web_interface/frontend_sections/users/user_roles) for more information.
:::

[comment]: # ({/5e478835-a90ea165})

[comment]: # ({fecb3622-e0163c70})
#### Parameters

`(object/array)` Item history data to send.

The method supports the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|itemid|ID|ID of the related item.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *required* if `host` and `key` are not set|
|host|string|Technical name of the host.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *required* if `itemid` is not set|
|key|string|Item key.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *required* if `itemid` is not set|
|value|mixed|Item value.<br><br>[Parameter behavior](/manual/api/reference_commentary#parameter-behavior):<br>- *required*|
|clock|timestamp|Time when the value was received.|
|ns|integer|Nanoseconds when the value was received.|

[comment]: # ({/fecb3622-e0163c70})

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

`(object)` Returns the result of the data sending operation.

[comment]: # ({/a55f92a5-d10d10b9})

[comment]: # ({4c860844-6892d8c2})
#### Examples

[comment]: # ({/4c860844-6892d8c2})

[comment]: # ({b319fb61-c6721628})
##### Send item history data

Send item history data to Zabbix server for items "10600", "10601", and "999999".

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "history.push",
    "params": [
        {
            "itemid": 10600,
            "value": 0.5,
            "clock": 1690891294,
            "ns": 45440940
        },
        {
            "itemid": 10600,
            "value": 0.6,
            "clock": 1690891295,
            "ns": 312431
        },
        {
            "itemid": 10601,
            "value": "[Tue Aug 01 15:01:35 2023] [error] [client 1.2.3.4] File does not exist: /var/www/html/robots.txt"
        },
        {
            "itemid": 999999,
            "value": 123
        }
    ],
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "response": "success",
        "data": [
            {
                "itemid": "10600"
            },
            {
                "itemid": "10600"
            },
            {
                "itemid": "10601",
                "error": "Item is disabled."
            },
            {
                "error": "No permissions to referred object or it does not exist."
            }
        ]
    },
    "id": 1
}
```

[comment]: # ({/b319fb61-c6721628})

[comment]: # ({57c06937-f4799610})
#### See also

- [Trapper items](/manual/config/items/itemtypes/trapper#sending-data)
- [HTTP agent](/manual/config/items/itemtypes/http) items
- [Host](/manual/api/reference/host/object#host)
- [Item](/manual/api/reference/item/object#item)

[comment]: # ({/57c06937-f4799610})

[comment]: # ({7e832fdb-b99de764})
#### Source

CHistory::push() in *ui/include/classes/api/services/CHistory.php*.

[comment]: # ({/7e832fdb-b99de764})
