
## What is a Store?

A **Store** is a configuration that specifies where your imagery should be delivered to cloud. When you set up a store, you define the target cloud service and the destination path. This enables automated delivery of your images directly from our platform to your preferred storage location.

---

## Supported Cloud Providers

Our platform supports multiple cloud storage services to suit different needs. Some of the key supported clouds include:

- **Amazon S3:**  
  Use S3 buckets for scalable and durable object storage.  
  - **Configuration:** Provide your S3 bucket name and path.
  
- **Google Cloud Storage (GCS):**  
  Utilize GCS for secure, highly available storage.  
  - **Configuration:** Specify the GCS bucket and the desired destination path.
  
- **Microsoft Azure Blob Storage:**  
  Store your imagery in Azure Blob Storage for reliable cloud storage with global reach.  
  - **Configuration:** Set your container name and directory path.

---

## Key Endpoints

### 1. Create a Store
This endpoint allows you to create a new store configuration to enable automatic or manual image delivery to required cloud buckets.

- Method: `POST`

- URL: `/v0/stores`

- Authentication Required: **Yes**

#### Body
<p align="justify">

You need the following fields in **Body**

| Field               | Type              | Required | Description |
|---------------------|-------------------|:----------:|:-------------:|
| `name`              | `string`          | ✅       | Name of the store. Used to identify it within the platform. |
| `type`              | `string`          | ✅       | Type of bucket depending on the cloud provider. Supported - S3, AZBLOB, GCS |
| `bucket`            | `string`          | ✅       | Name of the bucket to be used for data transfers. |
| `region`            | `string`          | ✅       | Region as defined by cloud provider. |
| `secrets`           | `array of string` | ✅       | Credentials to be used for transferring data to specified bucket. |

> **Note:** `secrets` vary for each cloud provider.Find more details below:
> - S3 - `access_key_id`, `secret_access_key`
> - AZBLOB - `account_name`, `tenant_id`, `client_id`, `client_secret`
> - GCS - `project_id`, `service_account_credentials`

Here is sample of the **body**: 

```json body
data '{
  "name": "my-analysis-store",
  "type": "S3",
  "configs": {
    "bucket": "my-data-bucket",
    "region": "us-east-2"
  },
  "secrets": {}
  }'
```
</p>


### 2. List Stores
Retrieve a list of all stores configured under your organization. This helps you verify that your delivery destinations are set up correctly.

- Method: `GET`

- URL: `/v0/stores`

- Authentication Required: **Yes**

#### Body
<p align="justify">

You dont really require any body for this endpoint apart from `Authorization`.

</p>

### 3. Delete a Store
Remove a store configuration that is no longer needed.

- Method: `DELETE`

- URL: `/v0/stores/{id}`

- Authentication Required: **Yes**

#### Path Parameters
<p align="justify">
You need to enter exact `store id` that is to be deleted.

| Name         | Type     | Required | Description                     |
|--------------|----------|----------|---------------------------------|
| `id`         | `string` | Yes      | Unique ID of the store          |
</p>

----
## How Stores integrate with Delivery

Once your store is configured, you can use it with the Delivery endpoints:

- **Create Delivery Request:**  
    When creating a delivery, you specify the store by providing the `config` (store ID) and the `path`. This tells our system where to send your images once they are ready.
- **Automatic Delivery:**  
    Your store configuration ensures that, as soon as imagery is delivered to your catalog, it is automatically pushed to your specified cloud storage.