---
updatedAt: 2026-04-22T15:53:18.000Z
agentTools:
  projectIndex: https://360learning.readme.io/llms.txt
---

# Migrate addToGroupLibrary

This guide outlines the main differences between the [Add content to libraries](https://360learning.readme.io/reference/v2bulkgroupsaddcontentstogroupslibrarycontroller_addcontentstogroupslibrary) v2 endpoint and the v1 `addToGroupLibrary` endpoint.

<Callout icon="💡" theme="default">
  ### Key changes

  * **Restricted scope:** The v2 endpoint is restricted and requires the following scope: `groups:bulk`. To request this scope, reach out to your Customer Success Partner (CSP).
  * **Bulk operation:** The v2 endpoint operates as a bulk endpoint, allowing you to process up to 20,000 objects asynchronously. The v1 endpoint was a synchronous operation for a single group.
  * **HTTP method:** The v2 endpoint uses the `POST` method, while v1 used the `PATCH` method.
</Callout>

## Documentation links

Here are the links to the API reference for:

* [API v1](https://api.360learning.com/#c693a353-8076-4e33-9cfd-4989b9e801d7)
* [API v2](https://360learning.readme.io/reference/v2bulkgroupsaddcontentstogroupslibrarycontroller_addcontentstogroupslibrary)

## Endpoint mapping

Here's the direct correlation between the v1 and v2 endpoint URLs:

* API v1: `/api/v1/groups/:group_id/library`
* API v2: `/api/v2/bulk/groups/library`

## Behavior changes

* **Bulk operation:** The v2 endpoint is designed for bulk addition, allowing multiple group/content associations across different groups and content types in a single call (up to 20,000 items). The v1 endpoint only supported adding content to a single group per request.
* **Asynchronous processing:** API v2 shifts from synchronous to asynchronous operations. Instead of an immediate success (`200 OK`), it returns a `202 Accepted` status code. The response will include a `Location` header with a URL to track the bulk operation's status.

## Input changes

This section details the specific alterations to the input requirements between API versions.

### API v1 input example

```Text Shell
curl --location --request PATCH 'https://app.360learning.com/api/v1/groups/6470744ad045da027bccafd1/library' \
--header 'Content-Type: application/json' \
--data '{
  "courses": ["6475f4696935d28559684d22"]
}'
```

### API v2 input example

```Text Shell
curl --request POST \
     --url https://app.360learning.com/api/v2/bulk/groups/library \
     --header '360-api-version: v2.0' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer your_access_token' \
     --header 'content-type: application/json' \
     --data '
{
  "input": [
    {
      "groupId": "6470744ad045da027bccafd1",
      "contentType": "course",
      "contentId": "6475f4696935d28559684d22"
    }
  ]
}
'
```

### Main input differences

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Change type
      </th>

      <th>
        API v1
      </th>

      <th>
        API v2
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <span class="param-removed">Removed</span><br />Path parameter
      </td>

      <td>
        `group_id` (Required): The unique ID of the group.
      </td>

      <td>
        Replaced by `groupId` body parameter.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-removed">Removed</span><br />Body parameter
      </td>

      <td>
        `programTemplates`: Top-level JSON array containing program template IDs.
      </td>

      <td>
        Removed because the underlying feature (Programs) has been retired from the platform and is not supported in API v2.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-removed">Removed</span><br />Body parameter
      </td>

      <td>
        `courses`: Top-level JSON array containing course IDs.
      </td>

      <td>
        Content IDs and types are now specified using the nested fields `contentId` and `contentType`.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-removed">Removed</span><br />Body parameter
      </td>

      <td>
        `paths`: Top-level JSON array containing path IDs.
      </td>

      <td>
        Content IDs and types are now specified using the nested fields `contentId` and `contentType`.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-added">Added</span><br />Header parameter
      </td>

      <td>
        * <br />
      </td>

      <td>
        `360-api-version` (Required):  API version identifier. Example: `v2.0`.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-added">Added</span><br />Body parameter
      </td>

      <td>
        * <br />
      </td>

      <td>
        `input` (Required, length ≤ 20000): New array of objects for bulk processing.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-added">Added</span><br />Body parameter
      </td>

      <td>
        * <br />
      </td>

      <td>
        `groupId` (Required, nested in `input`): The unique ID of the group. V1 used a path parameter.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-added">Added</span><br />Body parameter
      </td>

      <td>
        * <br />
      </td>

      <td>
        `contentId` (Required, nested in `input`): The unique ID of the content.
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-added">Added</span><br />Body parameter
      </td>

      <td>
        * <br />
      </td>

      <td>
        `contentType` (Required, nested in `input`): The type of the content (`path`, `course`).
      </td>
    </tr>
  </tbody>
</Table>

<br />

## Output changes

This section details the specific alterations to the successful output returned between API versions.

### API v1 output example

```Text JSON
{
    "status": "group_updated"
}
```

### API v2 output example

No JSON body is returned for a successful submission. The `202` status code is the key response indicator.

### Main output differences

API v2 shifted from synchronous to asynchronous operations. Instead of an immediate result (`200 OK`), it returns a `202 Accepted` status code indicating the bulk request has been queued. The full result must be tracked via the `Location` header.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Change type
      </th>

      <th>
        API v1
      </th>

      <th>
        API v2
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <span class="param-removed">Removed</span><br />Output property
      </td>

      <td>
        `status`: Property confirming group update status (`group_updated`). Removed in v2 because the operation is asynchronous.
      </td>

      <td>
        * <br />
      </td>
    </tr>

    <tr>
      <td>
        <span class="param-modified">Modified</span><br /> Success output
      </td>

      <td>
        `200`: Returns immediate success and status object.
      </td>

      <td>
        `202 Accepted`: Changed for asynchronous operation tracking. The response includes a `Location` header to track bulk operation status.
      </td>
    </tr>
  </tbody>
</Table>