# Import Files

<admonition type="info">

Imports are not entirely supported on V3. This page is a work in progress.

</admonition>

If you've just started using Stream, you might want to import data from your old infrastructure. Instead of using the APIs and creating your own import scripts, you can make use of our import feature.

Import files use the [JSON Lines](https://jsonlines.org/) format (one JSON object per line). Each line is an envelope that wraps a single record:

```json
{ "type": "<entity>", "data": { ... } }
```

Valid values for `type` are: `user`, `feed`, `feed_group`, `feed_view`, `activity`, `comment`, `reaction`, `bookmark`, `follow`, and `collection`. The full JSON Schemas are published at [GetStream/protocol](https://github.com/GetStream/protocol/tree/main/jsonschemas/feeds).

### The Process

The steps for importing data into your app are as follows:

Install the CLI

```bash
brew tap GetStream/stream-cli https://github.com/GetStream/stream-cli
brew install stream-cli
```

Setup your app

```bash
stream-cli config new
```

```bash
stream-cli import feeds upload-import myfile.jsonl
stream-cli import feeds get-import <task-id> --watch
stream-cli import feeds list-imports
```

### Users

Users are shared with chat and video. So if you already use those products you typically don't need to import users.
The structure for importing users is shown below:

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json
{ "type": "user", "data": { "id": "myuserid", "role": "user", "custom": {} } }
```

</codetabs-item>

</codetabs>

### Feeds

This is how you can import feeds.

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json label="JSON"
{
  "type": "feed",
  "data": {
    "group_id": "user",
    "id": "myuserid",
    "fid": "user:myuserid",
    "created_by_id": "myuserid",
    "name": "My Feed",
    "description": "A sample feed",
    "visibility": "public",
    "custom": {}
  }
}
```

</codetabs-item>

</codetabs>

`fid` is the fully-qualified feed id and is typically `"{group_id}:{id}"`.

### Follows

For follows specify the import in the following structure:

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json label="JSON"
{
  "type": "follow",
  "data": {
    "source_fid": "timeline:123",
    "target_fid": "user:222",
    "push_preference": "none",
    "custom": {}
  }
}
```

</codetabs-item>

</codetabs>

### Activities

Activities are the core records posted to one or more feeds:

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json
{
  "type": "activity",
  "data": {
    "id": "activity-123",
    "type": "post",
    "user_id": "user-222",
    "fids": ["user:myuserid"],
    "text": "hello world",
    "visibility": "public",
    "custom": {}
  }
}
```

</codetabs-item>

</codetabs>

### Comments

For comments specify the import in the following structure:

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json label="JSON"
{
  "type": "comment",
  "data": {
    "id": "comment-1",
    "object_type": "activity",
    "object_id": "activity-123",
    "user_id": "user-222",
    "text": "buy a gaming chair",
    "mentioned_user_ids": ["user-222"],
    "parent_id": null,
    "attachments": [],
    "custom": {}
  }
}
```

</codetabs-item>

</codetabs>

### Reactions

For reactions specify the import in the following structure:

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json label="JSON"
{
  "type": "reaction",
  "data": {
    "user_id": "user-222",
    "activity_id": "activity-123",
    "type": "like",
    "custom": {}
  }
}
```

</codetabs-item>

</codetabs>

`activity_id` is required. Set `comment_id` as well when reacting to a comment on the activity.

### Putting it all together

A single import file mixes entity types — one record per line:

<codetabs>

<codetabs-item value="jsonl" label="JSONL">

```json
{"type":"user","data":{"id":"myuserid","role":"user","custom":{}}}
{"type":"feed","data":{"group_id":"user","id":"myuserid","fid":"user:myuserid","created_by_id":"myuserid","custom":{}}}
{"type":"activity","data":{"id":"activity-123","type":"post","user_id":"myuserid","fids":["user:myuserid"],"text":"hello world"}}
{"type":"comment","data":{"id":"comment-1","object_type":"activity","object_id":"activity-123","user_id":"myuserid","text":"nice!"}}
{"type":"reaction","data":{"user_id":"myuserid","activity_id":"activity-123","type":"like"}}
```

</codetabs-item>

</codetabs>


---

This page was last updated at 2026-05-22T16:31:46.733Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/go-golang/importing-data-feeds/](https://getstream.io/activity-feeds/docs/go-golang/importing-data-feeds/).