---
url: https://gudhub.com/docs/core-api/item-processor/
title: "Item Processor\n                #"
description: "Item Processor is responsible for creating, receiving, updating and deleting items. Please note that you can not delete items from an application. When you dele"
lang: uk
updated: 2026-09-08T15:38:47.382Z
---

# Item Processor [#](https://gudhub.com/docs/core-api/item-processor/#item-processor)

Item Processor is responsible for creating, receiving, updating and deleting items. Please note that you can not delete items from an application. When you delete the items they just marked as deleted.

Item Processor provides such methods for working with items:

1.  [getItems](#getitems)
    
2.  [addNewItems](#addnewitems)
    
3.  [updateItems](#updateitems)
    
4.  [deleteItems](#deleteitems)
    
5.  [getFilteredItemsAPI](#getfiltereditemsapi)
    

## getItems() [#](https://gudhub.com/docs/core-api/item-processor/#getitems)

Method returns items from the application. It takes an application ID as an argument.

Copy

```js
async gudhub.getItems(app_id, trash)
```

| Argument Name | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _application ID where we want to get the field model_ |
| trash | `boolean` | _if it's true then it returns deleted items only_ |

Copy

```js
import GudHub from '@gudhub/core';

const AUTHKEY = "NKJHIUHknjcnkhios9w92ehds78/7";
let app_id = 343;
let trash = false;

(async ()=>{
    const gudhub = await new GudHub(AUTHKEY);
    let gottenItems = await gudhub.getItems(app_id, trash);
    console.log(gottenItems);
})();
```

This method returns items from a particular application:

Copy

```json
[{
    "item_id": 2987986,
    "fields": [{
        "field_id": 645888,
        "field_value": "John",
    }],
    },{
    "item_id": 2987996,
    "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
    }]
}]
```

## addNewItems() [#](https://gudhub.com/docs/core-api/item-processor/#addnewitems)

The method adds a new item in the items list. It takes application ID and an item list as arguments.

Copy

```js
async gudhub.addNewItems(app_id, itemsList)
```

| Argument Name | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _application ID where we want to get the field model_ |
| itemsList | `array` | _array of application items_ |

Copy

```js
import GudHub from '@gudhub/core';

const AUTHKEY = "NKJHIUHknjcnkhios9w92ehds78/7";
let app_id = 345;
let itemsList = [{
  "fields": [{
        "field_id": 645888,
        "field_value": "John",
      }],
  },
  {
  "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
      }]
  }
];

(async ()=>{
    const gudhub = await new GudHub(AUTHKEY);
    let newItem = await gudhub.addNewItems(app_id, itemsList);
    console.log(newItem)
})();
```

In response, we will get an array of items:

Copy

```json
[{
    "item_id": 2987986,
    "fields": [{
        "field_id": 645888,
        "field_value": "John",
    }],
    },{
    "item_id": 2987996,
    "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
    }]
}]
```

## updateItems() [#](https://gudhub.com/docs/core-api/item-processor/#updateitems)

The method allows you to update an existing item. It takes application ID and items list as arguments.

Copy

```js
async gudhub.updateItems(app_id, itemsList)
```

| Argument Name | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _application ID where we want to get the field model_ |
| itemsList | `array` | _array of application items_ |

Copy

```js
import GudHub from '@gudhub/core';

const AUTHKEY = "NKJHIUHknjcnkhios9w92ehds78/7";
let itemsList = [{
  "item_id": 2987986,
  "fields": [{
        "field_id": 645888,
        "field_value": "John",
      }],
  },
  {
  "item_id": 2987996,
  "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
      }]
  }
];

(async ()=>{
    const gudhub = await new GudHub(AUTHKEY);
    let updatedItems = await gudhub.updateItems(app_id, itemsList);
    console.log(updatedItems);
})();
```

It returns an updated item object:

Copy

```json
[{
    "item_id": 2987986,
    "fields": [{
        "field_id": 645888,
        "field_value": "John",
    }],
},{
    "item_id": 2987996,
    "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
    }]
}]
```

## deleteItems() [#](https://gudhub.com/docs/core-api/item-processor/#deleteitems)

This method is called for deleting existed items. As arguments, it takes application ID and items list.

Copy

```js
async gudhub.deleteItems(app_id, itemsIds)
```

| Argument Name | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _application ID where we want to get the field model_ |
| itemsList | `array` | _array of application items_ |

Copy

```js
import GudHub from '@gudhub/core';

const AUTHKEY = "NKJHIUHknjcnkhios9w92ehds78/7";
let app_id = 454;
let itemsIds = [3129206, 3129207];

(async ()=>{
    const gudhub = await new GudHub(AUTHKEY);
    let deletedItems = await gudhub.deleteItems(app_id, itemsIds);
    console.log(deletedItems);
})();
```

As a result we get an array of deleted items:

Copy

```json
[{
    "item_id": 3129206,
    "fields": [{
        "field_id": 645888,
        "field_value": "John",
    }],
},{
    "item_id": 3129207,
    "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
    }]
}]
```

## getFilteredItemsAPI() [#](https://gudhub.com/docs/core-api/item-processor/#getfiltereditemsapi)

This method calls the server's `Get Items` endpoint directly, returning items filtered and paginated on the server side instead of filtering an already-fetched items list in memory. It is a low-level method on the item processor (like `addItemsApi`/`updateItemsApi`/`deleteItemsApi`) and is called through `gudhub.itemProcessor` rather than directly on `gudhub`. As arguments, it takes an application ID, a filters list, and an options object for pagination/specific items.

Copy

```js
async gudhub.itemProcessor.getFilteredItemsAPI(app_id, filters_list, options)
```

| Argument Name | Type | Description |
| :-- | :-- | :-- |
| app\_id | `number` | _application ID where we want to get items from_ |
| filters\_list | `array` | _list of filters to apply on the server side_ |
| options.items | `array` | _optional list of specific item IDs to fetch_ |
| options.offset | `number` | _optional offset for pagination_ |
| options.limit\_to | `number` | _optional limit on the number of items returned_ |

Copy

```js
import GudHub from '@gudhub/core';

const AUTHKEY = "NKJHIUHknjcnkhios9w92ehds78/7";
let app_id = 343;
let filters_list = [];
let options = {
  offset: 0,
  limit_to: 10
};

(async ()=>{
    const gudhub = await new GudHub(AUTHKEY);
    let filteredItems = await gudhub.itemProcessor.getFilteredItemsAPI(app_id, filters_list, options);
    console.log(filteredItems);
})();
```

In response, we get the filtered items list from the server (or `null` if the request fails):

Copy

```json
[{
    "item_id": 2987986,
    "fields": [{
        "field_id": 645888,
        "field_value": "John",
    }],
    },{
    "item_id": 2987996,
    "fields": [{
        "field_id": 645888,
        "field_value": "Johana",
    }]
}]
```
