# Cloud Storage integration

We currently support `Amazon S3`, `Cloudflare R2`, `Microsoft OneDrive` and `Google Drive`. Stay tuned for additional Storage providers.

This is one of two integration types managed by the [Integration API](https://docs.launchbrightly.com/integration-api/overview). Once a storage integration exists, you can [export screenshots](https://docs.launchbrightly.com/product-screenshots-api/export-screenshots) to it.

## `Cloudflare R2`

Refer to Cloudflare's documentation how to [create an API token](https://developers.cloudflare.com/r2/api/s3/tokens/). Once created, you will need to provide the `bucket` name, `accessKeyId`, `secretAccessKey` and `accountId.

`POST /integration`

### Request

```json
{
  "label": "My R2 Storage Credentials",
  "provider": "r2",
  "platform": "cloud",
  "credentials": {
    "bucket": "examplebucket",
    "accessKeyId": "xxx",
    "secretAccessKey": "yyy",
    "accountId": "zzz",
    "region": "auto"
  }
}
```

### Response

```json
{
  "id": "a7a0b392-4ec7-4b02-bef4-80c955ac674f",
  "createdAt": "2024-02-27T17:16:42.590Z",
  "updatedAt": "2024-02-27T17:16:42.590Z",
  "message": "The Integration credentials have been successfully created."
}
```

### HTTP Status codes:

| HTTP Code | Description                     |
|-----------|---------------------------------|
| 200       | On success                      |
| 422       | Any validation-related errors    |
| 500       | Any unhandled exceptions         |

## `Amazon S3`

Refer to AWS Documentation on how to [create access keys](https://docs.aws.amazon.com/sdkref/latest/guide/access-iam-users.html). Once created, you will need to provide the `bucket` name, `region`, `accessKeyId` and `secretAccessKey.`

### Request

```json
{
  "label": "My S3 Storage Credentials",
  "provider": "s3",
  "platform": "cloud",
  "credentials": {
    "accessKeyId": "xxx",
    "bucket": "yyy",
    "secretAccessKey": "zzz",
    "region": "us-east-1"
  }
}
```

### Response

### HTTP Status codes:

## `MS OneDrive`

We currently support Microsoft OneDrive for business only. The API enables seamless integration with OneDrive, allowing you to export and store your screenshots securely in your business account.

All exported files will be saved to a folder called `launchbrightly` in your OneDrive, which serves as the root directory for all your exports.

`POST /integration`

### Request

```json
{
  "label": "One Drive Credentials for Business",
  "provider": "onedrive",
  "platform": "cloud",
  "credentials": {
    "accessToken": "XXX",
    "refreshToken": "YYY"
  }
}
```

### Response

### HTTP Status codes:

## `Google Drive`

The API supports seamless integration with Google Drive, allowing you to connect and export screenshots to your Google Drive account.

All exported files will be saved to a folder called `launchbrightly` in your Google Drive, which serves as the root directory for all your exports.

`POST /integration`

### Request

```json
{
  "label": "Google Drive Credentials",
  "provider": "gdrive",
  "platform": "cloud",
  "credentials": {
    "accessToken": "XXX",
    "refreshToken": "YYY"
  }
}
```

### Response

### HTTP Status codes:
