> ## 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 collaborations

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>;
};

Box Hub collaborations control who can access a hub and at what role. You can invite users or groups by user ID, group ID, or email (for users). Roles are `editor`, `viewer`, and `co-owner`. You can only invite users who have a Box account (any plan) to collaborate on a hub.

<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>

## Create a hub collaboration

To add a user or group to a hub, call the <Link href="/reference/v2025.0/post-hub-collaborations">`POST /2.0/hub_collaborations`</Link> endpoint and provide:

* The hub reference (`HUB_ID`)
* The collaborator's ID and type in the `accessible_by` field
* The level of access granted to a hub in the `role` field

### Create by user ID

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/hub_collaborations" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0" \
       -H "Content-Type: application/json" \
       -d '{
         "hub": {
           "type": "hubs",
           "id": "HUB_ID"
         },
         "accessible_by": {
           "type": "user",
           "id": "USER_ID"
         },
         "role": "viewer"
       }'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubCollaborations.createHubCollaborationV2025R0({
    hub: new HubCollaborationCreateRequestV2025R0HubField({ id: hub.id }),
    accessibleBy: {
      type: 'user',
      id: user.id,
    } satisfies HubCollaborationCreateRequestV2025R0AccessibleByField,
    role: 'viewer',
  } satisfies HubCollaborationCreateRequestV2025R0);
  ```

  ```python Python v10 theme={null}
  client.hub_collaborations.create_hub_collaboration_v2025_r0(
      CreateHubCollaborationV2025R0Hub(id=hub.id),
      CreateHubCollaborationV2025R0AccessibleBy(type="user", id=user.id),
      "viewer",
  )
  ```

  ```csharp .NET v10 theme={null}
  await client.HubCollaborations.CreateHubCollaborationV2025R0Async(requestBody: new HubCollaborationCreateRequestV2025R0(hub: new HubCollaborationCreateRequestV2025R0HubField(id: hub.Id), accessibleBy: new HubCollaborationCreateRequestV2025R0AccessibleByField(type: "user") { Id = user.Id }, role: "viewer"));
  ```

  ```swift Swift v10 theme={null}
  try await client.hubCollaborations.createHubCollaborationV2025R0(requestBody: HubCollaborationCreateRequestV2025R0(hub: HubCollaborationCreateRequestV2025R0HubField(id: hub.id), accessibleBy: HubCollaborationCreateRequestV2025R0AccessibleByField(type: "user", id: user.id), role: "viewer"))
  ```

  ```java Java v10 theme={null}
  client.getHubCollaborations().createHubCollaborationV2025R0(new HubCollaborationCreateRequestV2025R0(new HubCollaborationCreateRequestV2025R0HubField(hub.getId()), new HubCollaborationCreateRequestV2025R0AccessibleByField.Builder("user").id(user.getId()).build(), "viewer"));
  ```
</CodeGroup>

### Create by user email (login)

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X POST "https://api.box.com/2.0/hub_collaborations" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0" \
       -H "Content-Type: application/json" \
       -d '{
         "hub": {
           "type": "hubs",
           "id": "HUB_ID"
         },
         "accessible_by": {
           "type": "user",
           "login": "john@example.com"
         },
         "role": "editor"
       }'
  ```

  ```python Python v10 theme={null}
  client.hub_collaborations.create_hub_collaboration_v2025_r0(
      CreateHubCollaborationV2025R0Hub(id=hub.id),
      CreateHubCollaborationV2025R0AccessibleBy(type="user", login="john@example.com"),
      "editor",
  )
  ```
</CodeGroup>

Replace `HUB_ID`, `USER_ID`, and the email with real values. Valid `role` values are `editor`, `viewer`, and `co-owner`. A successful response returns the new <Link href="/reference/v2025.0/resources/hub-collaboration">Hub collaboration</Link> object.

## List hub collaborations

To list all collaborations for a hub, call the <Link href="/reference/v2025.0/get-hub-collaborations">`GET /2.0/hub_collaborations`</Link> endpoint with the hub ID.

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

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubCollaborations.getHubCollaborationsV2025R0({
    hubId: hub.id,
  } satisfies GetHubCollaborationsV2025R0QueryParams);
  ```

  ```python Python v10 theme={null}
  client.hub_collaborations.get_hub_collaborations_v2025_r0(hub.id)
  ```

  ```csharp .NET v10 theme={null}
  await client.HubCollaborations.GetHubCollaborationsV2025R0Async(queryParams: new GetHubCollaborationsV2025R0QueryParams(hubId: hub.Id));
  ```

  ```swift Swift v10 theme={null}
  try await client.hubCollaborations.getHubCollaborationsV2025R0(queryParams: GetHubCollaborationsV2025R0QueryParams(hubId: hub.id))
  ```

  ```java Java v10 theme={null}
  client.getHubCollaborations().getHubCollaborationsV2025R0(new GetHubCollaborationsV2025R0QueryParams(hub.getId()));
  ```
</CodeGroup>

Optional query parameters: `marker` and `limit`. For details, see [Marker-based pagination](/guides/api-calls/pagination/marker-based).

## Get a hub collaboration by ID

To retrieve a single hub collaboration, call the <Link href="/reference/v2025.0/get-hub-collaborations-id">`GET /2.0/hub_collaborations/{hub_collaboration_id}`</Link> endpoint with the collaboration ID.

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

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubCollaborations.getHubCollaborationByIdV2025R0(hubCollaborationId);
  ```

  ```python Python v10 theme={null}
  client.hub_collaborations.get_hub_collaboration_by_id_v2025_r0(hub_collaboration_id)
  ```

  ```csharp .NET v10 theme={null}
  await client.HubCollaborations.GetHubCollaborationByIdV2025R0Async(hubCollaborationId: hubCollaborationId);
  ```

  ```java Java v10 theme={null}
  client.getHubCollaborations().getHubCollaborationByIdV2025R0(hubCollaborationId);
  ```
</CodeGroup>

## Update a hub collaboration

To change a collaborator's role, call the <Link href="/reference/v2025.0/put-hub-collaborations-id">`PUT /2.0/hub_collaborations/{hub_collaboration_id}`</Link> endpoint with the hub collaboration ID and the new `role`.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X PUT "https://api.box.com/2.0/hub_collaborations/HUB_COLLABORATION_ID" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0" \
       -H "Content-Type: application/json" \
       -d '{
         "role": "editor"
       }'
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubCollaborations.updateHubCollaborationByIdV2025R0(hubCollaborationId, {
    role: 'editor',
  } satisfies HubCollaborationUpdateRequestV2025R0);
  ```

  ```python Python v10 theme={null}
  client.hub_collaborations.update_hub_collaboration_by_id_v2025_r0(hub_collaboration_id, role="editor")
  ```

  ```csharp .NET v10 theme={null}
  await client.HubCollaborations.UpdateHubCollaborationByIdV2025R0Async(hubCollaborationId: hubCollaborationId, requestBody: new HubCollaborationUpdateRequestV2025R0() { Role = "editor" });
  ```

  ```java Java v10 theme={null}
  client.getHubCollaborations().updateHubCollaborationByIdV2025R0(hubCollaborationId, new HubCollaborationUpdateRequestV2025R0.Builder().role("editor").build());
  ```
</CodeGroup>

## Delete a hub collaboration

To remove a collaborator from a hub, call the <Link href="/reference/v2025.0/delete-hub-collaborations-id">`DELETE /2.0/hub_collaborations/{hub_collaboration_id}`</Link> endpoint with the hub collaboration ID.

<CodeGroup>
  ```sh cURL theme={null}
  curl -i -X DELETE "https://api.box.com/2.0/hub_collaborations/HUB_COLLABORATION_ID" \
       -H "Authorization: Bearer <ACCESS_TOKEN>" \
       -H "box-version: 2025.0"
  ```

  ```typescript Node/TypeScript v10 theme={null}
  await client.hubCollaborations.deleteHubCollaborationByIdV2025R0(hubCollaborationId);
  ```

  ```python Python v10 theme={null}
  client.hub_collaborations.delete_hub_collaboration_by_id_v2025_r0(hub_collaboration_id)
  ```

  ```csharp .NET v10 theme={null}
  await client.HubCollaborations.DeleteHubCollaborationByIdV2025R0Async(hubCollaborationId: hubCollaborationId);
  ```

  ```java Java v10 theme={null}
  client.getHubCollaborations().deleteHubCollaborationByIdV2025R0(hubCollaborationId);
  ```
</CodeGroup>

A successful delete returns no body (HTTP 204).

## Use cases

* **Onboarding automation:** When a new hire is added to your HRIS, create a "Welcome Hub" and add them as a collaborator with the appropriate role.
* **Group-based access:** Use the <Link href="/reference/get-groups">Box Groups API</Link> to find the right group, then add the group as a collaborator so all members get access.

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Create hub collaboration"), href: "/reference/v2025.0/post-hub-collaborations", badge: "POST" },
{ label: translate("Get hub collaborations"), href: "/reference/v2025.0/get-hub-collaborations", badge: "GET" },
{ label: translate("Get hub collaboration by ID"), href: "/reference/v2025.0/get-hub-collaborations-id", badge: "GET" },
{ label: translate("Update hub collaboration"), href: "/reference/v2025.0/put-hub-collaborations-id", badge: "PUT" },
{ label: translate("Remove hub collaboration"), href: "/reference/v2025.0/delete-hub-collaborations-id", badge: "DELETE" }
]}
/>

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