# Import/Export

Source: https://docs.annoto.net/developers/rest-api/data-api-import-export

To obtain internal group uuid, please refer to [Mapping](https://docs.annoto.net/developers/rest-api/data-api-mapping)



Import data from course A to course B

`POST` `/hosts/{hostId}/groups/{groupId}/import/data`

This API allows to import data from group (course) A to group (course) B.

The `{groupId}` param of the route specifies the target group (course B).

Required user scope: `super-mod`



**Query Parameters**

| Name | Value |
|---|---|
| `source_group_id` | uuid of the source group (group A) from which to take the data |
| `cta` | if set to `1` or `true` interactions data (quizzes) will be imported |
| `preferences` | if set to `1` or `true` preferences data of the group and all the threads will be imported (if some threads have custom preferences) |
| `my_comments` | if set to `1` or `true` the root comments of the Authorized user that is performing the import will be imported |

Example:  
`/hosts/9a89fe71-78d6-4e29-8fb1-82c0cba44eed/groups/910aac35-d911-4e4b-bfbb-3ba2f2bd16ff/import/data?source_group_id=dc7c138e-36e9-4041-ba57-3a7068af2cb2&preferences=1&cta=1`



**Response**

200

```json
{
  "result": "ok"
}

```



400

```json
{
  "message": "Bad request",
  "statusCode": 400
}

```



Bulk duplicate data of a course to multiple courses

`POST` `/hosts/{hostId}/groups/{groupId}/bulk_duplicate/data`

This API allows to perform bulk operation of duplicating the data of a source group (course) specified by the `{groupId}` to multiple groups (courses). This bulk operation will create new groups and threads as needed, for the duplication.

Required user scope: `admin`



**Query Parameters**

| Name | Value |
|---|---|
| `cta` | if set to `1` or `true` interactions data (quizzes) will be imported |
| `preferences` | if set to `1` or `true` preferences data of the group and all the threads will be imported (if some threads have custom preferences) |

Example:

`/hosts/9a89fe71-78d6-4e29-8fb1-82c0cba44eed/groups/910aac35-d911-4e4b-bfbb-3ba2f2bd16ff/bulk_duplicate/data?preferences=1&cta=1`



**Body**

Array of target courses (groups):

```json
{
  "targetGroups": [
    {
      "group_id": "23456",
      "title": "Course B Title",
      "url": "https://canvas.instructure.com/courses/23456",
      "description": "Optional Description of course B"
    },
    {
      "group_id": "3456",
      "title": "Course C Title",
      "url": "https://canvas.instructure.com/courses/3456",
      "description": "Optional Description of course C"
    }
  ]
}

```

Each targe group object has the following properties

| Name | Type | Description |
|---|---|---|
| `group_id` | string | the host/LMS course id to where the data should be copied to |
| `url` | string | the url of the course in the host/LMS system |
| `title` | string | the course title |
| `description` | string | (optional) course description |

**Response**

200

```json
{
  "result": "ok"
}

```



400

```json
{
  "message": "Bad request",
  "statusCode": 400
}

```
