---
title: How to make an Insights Backup
slug: guides-and-examples/gcs-dump
description: Learn how to easily schedule daily dumps of conversations in Kindly's Inbox with this comprehensive document. By following the included instructions, which involve setting up Amazon Web Services, an S3 Bucket, and a Kindly user, you'll be able to automate
icon: 🧑‍💻
docTags: 
createdAt: 2022-05-13T15:44:44.000Z
---

You can schedule to receive daily dumps of conversations in the Insights from us. This is useful if you e.g. want to routinely analyze your message data, or feed it to your own logging systems.

The setup for this process for Kindly happens totally within our [Kindly Platform](https://app.kindly.ai), under *Settings -> General -> Advanced*.

For this you will need either:

- Google Cloud, a GCS Bucket, and a user for Kindly to use.
- Amazon Web Services, a S3 Bucket, and a user for Kindly to use

# ☁️ Googe cloud - GCS bucket

## Setup user for Kindly with GCS permissions

### Step 1: Create a GCS bucket (skippable if you already have one)

Go to the [GCS dashboard](https://console.cloud.google.com/storage/browser) and click `Create`, go with default settings. **Make sure public access is OFF**.

### Step 2: Create an Service Account

Go to the [IAM dashboard](https://console.cloud.google.com/iam-admin/serviceaccounts), and click `Create a policy`.&#x20;

On `Grant this service account access to project` step, give the service account the `Storage Object Creator`

You can skip giving access to users.

### Step 3: Create key for the Service Account

Right after creating the Service Account, go to details of the service account. You can use the search function to help with finding the account.

After going into details page you should go to `Keys` tab and click on `Add Key` and `Create  new key`. Select `JSON` as the key format. Now your browser should download a file.

### Step 4: Setup GCS in Kindly

Navigate to Workspace -> Settings -> Insights Backup
*app.kindly.ai/workspace/\[ID]/settings/message-backups*

Fill out the `Bucket Name` and `Path` fields. The Google Application Credential is the content of the file you downloaded at Step 3.

## Schedule

If enabled in Kindly, the job will execute every night. It will upload a file for each language in the bot to a path structure like e.g. `YYYY-MM-DD/INBOX-(BOTID)_BOTNAME-LOCALE-FILEPART`. This file will include norwegian conversations for BOTNAME from 12am to 12pm, 31st of aug.



## Data payload example

:::CodeblockTabs
Payload

```json
"data": [
  {
    "id": "1107ff573fb78f4ffa6666a2",
    "language_code": "en",
    "taken_over": false,
    "completed_takeover": false,
    "takeover_by_agent_id": 4040,
    "created": "2023-09-18T07:42:15.265000Z",
    "updated": "2023-09-18T07:42:20.571000Z",
    "messages": [
      {
        "message": "Hi! I'm Kindly's Chatbot. I can answer questions about Kindly and our services. How can I help you? 🟢<br>\n<br>Feel free to ask me a question! You can also use one of the buttons below to get started.",
        "from_bot": true,
        "sender": "BOT",
        "score": null,
        "created": "2023-09-18T07:42:15.321000Z",
        "exchange_id": "c2db8b5d-6386-438c-b7ca-00a1cdc969bd",
        "is_followup": false,
        "exchange_type": "greeting",
        "reply_type": "STANDARD",
        "reply_candidates": [],
        "suggestions": []
      },
      {
        "message": "How are you?",
        "from_bot": true,
        "sender": "BOT",
        "score": null,
        "created": "2023-09-18T07:42:20.526000Z",
        "exchange_id": "c83969eb-4486-4612-9d10-d09ee364169c",
        "is_followup": false,
        "exchange_type": "usersays",
        "reply_type": "STANDARD",
        "reply_candidates": [],
        "suggestions": []
      }
    ],
    "feedback": [],
    "context": {
      "_name": "Kindly Chatbot",
      "_organization_name": "Kindly Chatbot",
      "_web_path": "/blog/chatbot-faq-example",
      "_web_host": "www.kindly.ai",
      "_web_url": "https://www.kindly.ai/blog/chatbot-faq-example",
      "some_random_variable": "Some random value",
    },
    "web_host": "www.kindly.ai",
    "web_path": "/blog/chatbot-faq-example",
    "labels": [
      {
        "id": "2g65d747-b644-456e-b0a6-0e66c3c2dde9",
        "name": "Support"
      }
    ]
  },
]
```
:::

***

# ☁️ Amazon Web Services - S3 bucket

## Setup user for Kindly with S3 permissions

### Step 1: Create a S3 bucket (skippable if you already have one)

Go to the [S3 dashboard](https://s3.console.aws.amazon.com) and click `Create bucket`, go with default settings. **Make sure public access is OFF**.

### Step 2: Create an IAM Policy

Go to the [IAM dashboard](https://console.aws.amazon.com/iam/home?#/policies), and click `Create a policy`.

Go to the JSON tab, add the following (note the wildcard at the end is needed for allowing all paths within the bucket):

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::MY_BUCKET/*"
    }
  ]
}
```

Remember to replace `MY_BUCKET` with your actual bucket name

### Step 3: Create a Group

[Create a group](https://console.aws.amazon.com/iam/home?#/groups) and attach the policy from step 2.

### Step 4: Create a User, and get the public key / private key

[Create a user](https://console.aws.amazon.com/iam/home?#/users) for Kindly to use, it only needs Programmatic access, add this user to the group from step 3, skip tags.

On the success-page, copy the Access key ID (public key), and the Secret access key (private key).

### Step 5: Use the key-pair in Kindly

Navigate to Workspace -> Settings -> Insights Backup
*app.kindly.ai/workspace/\[ID]/settings/message-backups*

![](https://api.archbee.com/api/optimize/VLyTaamiYpVSyrmNspQvO/lSglWOZhbjTUgKpTkgfsg_spaces-ldk3ajtbnk03ia96g-quploadsgit-blob-353301f44f0071ae2682dbe181e5fb06567619a2kindly-aws-settings.png "Kindly AWS settings")

## Schedule

If enabled in Kindly, the job will execute every night. It will upload a file for each language in the bot to a path structure like e.g. `YYYY-MM-DD/INBOX-(BOTID)_BOTNAME-LOCALE-FILEPART`. This file will include norwegian conversations for BOTNAME from 12am to 12pm, 31st of aug.



## Data payload example

:::CodeblockTabs
Payload

```json
"data": [
  {
    "id": "1107ff573fb78f4ffa6666a2",
    "language_code": "en",
    "taken_over": false,
    "completed_takeover": false,
    "takeover_by_agent_id": 4040,
    "created": "2023-09-18T07:42:15.265000Z",
    "updated": "2023-09-18T07:42:20.571000Z",
    "messages": [
      {
        "message": "Hi! I'm Kindly's Chatbot. I can answer questions about Kindly and our services. How can I help you? 🟢<br>\n<br>Feel free to ask me a question! You can also use one of the buttons below to get started.",
        "from_bot": true,
        "sender": "BOT",
        "score": null,
        "created": "2023-09-18T07:42:15.321000Z",
        "exchange_id": "c2db8b5d-6386-438c-b7ca-00a1cdc969bd",
        "is_followup": false,
        "exchange_type": "greeting",
        "reply_type": "STANDARD",
        "reply_candidates": [],
        "suggestions": []
      },
      {
        "message": "How are you?",
        "from_bot": true,
        "sender": "BOT",
        "score": null,
        "created": "2023-09-18T07:42:20.526000Z",
        "exchange_id": "c83969eb-4486-4612-9d10-d09ee364169c",
        "is_followup": false,
        "exchange_type": "usersays",
        "reply_type": "STANDARD",
        "reply_candidates": [],
        "suggestions": []
      }
    ],
    "feedback": [],
    "context": {
      "_name": "Kindly Chatbot",
      "_organization_name": "Kindly Chatbot",
      "_web_path": "/blog/chatbot-faq-example",
      "_web_host": "www.kindly.ai",
      "_web_url": "https://www.kindly.ai/blog/chatbot-faq-example",
      "some_random_variable": "Some random value",
    },
    "web_host": "www.kindly.ai",
    "web_path": "/blog/chatbot-faq-example",
    "labels": [
      {
        "id": "2g65d747-b644-456e-b0a6-0e66c3c2dde9",
        "name": "Support"
      }
    ]
  },
]
```
:::



