Box Developer Documentation
Beta

Manage hub items

post
https://api.box.com/2.0
/hubs/:hub_id/manage_items

Adds and/or removes Hub items from a Hub.

Request

bearer [ACCESS_TOKEN]
application/json

Request Headers

stringin headerrequired

Version header.

Value is always 2025.0

Path Parameters

stringin pathrequired
12345

The unique identifier that represent a hub.

The ID for any hub can be determined by visiting this hub in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/hubs/123 the hub_id is 123.

Request Body

object arrayin bodyoptional

List of operations to perform on Hub items.

stringin bodyconditionally required
"add"

The action to perform on a Hub item.

Value is one of add,remove

object objectin body

Reference to an item that can be added to a Hub.

Response

Retrieves the status of all the operations.

application/jsonClient error

Returned when the access token provided in the Authorization header is not recognized or not provided.

application/jsonClient error

Returned if the Hub is not found, or the user does not have access to the Hub.

application/jsonClient error

An unexpected client error.

post
Manage hub items
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

TypeScript Gen
await client.hubItems.manageHubItemsV2025R0(createdHub.id, {
  operations: [
    {
      action: 'add' as HubItemOperationV2025R0ActionField,
      item: new FolderReferenceV2025R0({ id: folder.id }),
    } satisfies HubItemOperationV2025R0,
  ],
} satisfies HubItemsManageRequestV2025R0);
Python Gen
client.hub_items.manage_hub_items_v2025_r0(
    created_hub.id,
    operations=[
        HubItemOperationV2025R0(
            action=HubItemOperationV2025R0ActionField.ADD,
            item=FolderReferenceV2025R0(id=folder.id),
        )
    ],
)
.NET Gen
await client.HubItems.ManageHubItemsV2025R0Async(hubId: createdHub.Id, requestBody: new HubItemsManageRequestV2025R0() { Operations = Array.AsReadOnly(new [] {new HubItemOperationV2025R0(action: HubItemOperationV2025R0ActionField.Add, item: new FolderReferenceV2025R0(id: folder.Id))}) });
Java Gen (Beta)
client.getHubItems().manageHubItemsV2025R0(createdHub.getId(), new HubItemsManageRequestV2025R0.Builder().operations(Arrays.asList(new HubItemOperationV2025R0(HubItemOperationV2025R0ActionField.ADD, new FolderReferenceV2025R0(folder.getId())))).build())

Response Example

{
  "operations": [
    {
      "action": "add",
      "error": "Item not found",
      "item": {
        "id": "42037322",
        "type": "file"
      },
      "status": 200
    }
  ]
}