> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage hub items

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = href;
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

The Box Hub items API allows you to:

* [List all items in a hub](#list-hub-items).
* [Add or remove files, folders, and web links from a hub](#add-or-remove-hub-items).

<Note>
  At this stage, the API supports managing files, folders, and web links only. Elements such as callouts, dividers, paragraphs, or sections must be added in the Box Hubs web interface. Content added through the API is placed in the first content block.
</Note>

<Warning>Box Hubs endpoints require the `box-version: 2025.0 header`. If you omit this header, the API returns a 400 error with the message `Missing required box-version header. Supported API versions: [2025.0].` For more information, see [Box API versioning strategy](/guides/api-calls/api-versioning-strategy/).</Warning>

<Note>
  The <Link href="/reference/v2025.0/get-hub-items">`GET /2.0/hub_items`</Link> returns HTTP `207` (Multi-Status). The response body includes the status of each operation (add or remove). Follow the API reference for full response and error handling.
</Note>

## List hub items

To retrieve all items in a Box Hub, call the <Link href="/reference/v2025.0/get-hub-items">`GET /2.0/hub_items`</Link> endpoint with the hub ID.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X GET "https://api.box.com/2.0/hub_items?hub_id=HUB_ID" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0"
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubItems.getHubItemsV2025R0({
    hubId: createdHub.id,
  } satisfies GetHubItemsV2025R0QueryParams);
  ```

  ```python Python v10 theme={null}
  client.hub_items.get_hub_items_v2025_r0(created_hub.id)
  ```

  ```csharp .NET v10 theme={null}
  await client.HubItems.GetHubItemsV2025R0Async(queryParams: new GetHubItemsV2025R0QueryParams(hubId: createdHub.Id));
  ```

  ```swift Swift v10 theme={null}
  try await client.hubItems.getHubItemsV2025R0(queryParams: GetHubItemsV2025R0QueryParams(hubId: createdHub.id))
  ```

  ```java Java v10 theme={null}
  client.getHubItems().getHubItemsV2025R0(new GetHubItemsV2025R0QueryParams(createdHub.getId()));
  ```
</CodeGroup>

Replace `HUB_ID` with your hub ID. You can use optional query parameters `marker` and `limit` for pagination. The response includes an `entries` array of hub items (each with `id`, `type`, `name`).

## Add or remove hub items

To add or remove items in a hub, call the <Link href="/reference/v2025.0/post-hubs-id-manage-items">`POST /2.0/hubs/{hub_id}/manage_items`</Link> endpoint with the hub ID and a list of operations. Each operation has an `action` (`add` or `remove`) and an `item` reference (`type` and `id`).

### Add a file to a hub

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/hubs/HUB_ID/manage_items" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0" \
       -H "Content-Type: application/json" \
       -d '{
         "operations": [
           {
             "action": "add",
             "item": {
               "type": "file",
               "id": "FILE_ID"
             }
           }
         ]
       }'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubItems.manageHubItemsV2025R0(createdHub.id, {
    operations: [
      {
        action: 'add' as HubItemOperationV2025R0ActionField,
        item: new FileReferenceV2025R0({ id: file.id }),
      } satisfies HubItemOperationV2025R0,
    ],
  } satisfies HubItemsManageRequestV2025R0);
  ```

  ```python Python v10 theme={null}
  client.hub_items.manage_hub_items_v2025_r0(
      created_hub.id,
      operations=[
          HubItemOperationV2025R0(
              action=HubItemOperationV2025R0ActionField.ADD,
              item=FileReferenceV2025R0(id=file.id),
          )
      ],
  )
  ```

  ```csharp .NET v10 theme={null}
  await client.HubItems.ManageHubItemsV2025R0Async(hubId: createdHub.Id, requestBody: new HubItemsManageRequestV2025R0() { Operations = Array.AsReadOnly(new [] { new HubItemOperationV2025R0(action: HubItemOperationV2025R0ActionField.Add, item: new FileReferenceV2025R0(id: file.Id)) }) });
  ```

  ```java Java v10 theme={null}
  client.getHubItems().manageHubItemsV2025R0(createdHub.getId(), new HubItemsManageRequestV2025R0.Builder().operations(Arrays.asList(new HubItemOperationV2025R0(HubItemOperationV2025R0ActionField.ADD, new FileReferenceV2025R0(file.getId())))).build());
  ```
</CodeGroup>

### Add a folder to a hub

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/hubs/HUB_ID/manage_items" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0" \
       -H "Content-Type: application/json" \
       -d '{
         "operations": [
           {
             "action": "add",
             "item": {
               "type": "folder",
               "id": "FOLDER_ID"
             }
           }
         ]
       }'
  ```

  ```python Python v10 theme={null}
  client.hub_items.manage_hub_items_v2025_r0(
      created_hub.id,
      operations=[
          HubItemOperationV2025R0(
              action=HubItemOperationV2025R0ActionField.ADD,
              item=FolderReferenceV2025R0(id=folder.id),
          )
      ],
  )
  ```
</CodeGroup>

### Remove an item from a hub

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/hubs/HUB_ID/manage_items" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0" \
       -H "Content-Type: application/json" \
       -d '{
         "operations": [
           {
             "action": "remove",
             "item": {
               "type": "file",
               "id": "FILE_ID"
             }
           }
         ]
       }'
  ```

  ```python Python v10 theme={null}
  client.hub_items.manage_hub_items_v2025_r0(
      created_hub.id,
      operations=[
          HubItemOperationV2025R0(
              action=HubItemOperationV2025R0ActionField.REMOVE,
              item=FileReferenceV2025R0(id=file.id),
          )
      ],
  )
  ```
</CodeGroup>

Replace `HUB_ID`, `FILE_ID`, and `FOLDER_ID` with actual IDs. For web links, use `"type": "web_link"` and the web link ID. You can combine multiple add and remove operations in a single request.

## Use cases

* **Automate hub creation:** Use the <Link href="/reference/get-search">Box Search API</Link> or metadata queries to find content matching criteria, then add the filtered results to a hub with the manage hub items endpoint.
* **Event-driven updates:** Use <Link href="/guides/webhooks">webhooks</Link> to react to events (for example, a new file in a folder) and add that content to a hub automatically.

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Get hub items"), href: "/reference/v2025.0/get-hub-items", badge: "GET" },
{ label: translate("Manage hub items"), href: "/reference/v2025.0/post-hubs-id-manage-items", badge: "POST" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Box Hubs overview"), href: "/guides/hubs-api", badge: "GUIDE" },
{ label: translate("Create a hub"), href: "/guides/hubs-api/hubs/create-hub", badge: "GUIDE" },
{ label: translate("Manage hub collaborations"), href: "/guides/hubs-api/hubs-collaborations/hub-collaborations", badge: "GUIDE" }
]}
/>
