> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.instabase.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.instabase.com/_mcp/server.

# Mount endpoint [Deprecated]

> Connect and manage external drives at the workspace level.

> **Note**
>
> This page documents a legacy API and is available for reference.

Use the Mount endpoint to connect external drives to a workspace on AI Hub, such as an Amazon S3 bucket or Azure Blob Storage container. This endpoint doesn't support mounting organization drives. To mount organization drives, [use the AI Hub UI](/admin/data-connections).

In this document, `URL_BASE` refers to the root URL of your Instabase instance, such as `aihub.instabase.com`. `API_ROOT` defines where to route API requests for file operations, and its value is `URL_BASE` appended by `/api/v1/drives`.

```python
import json, requests

url_base = 'https://aihub.instabase.com'
api_root = url_base + '/api/v1/drives'
```

To make calls to AI Hub APIs, you must define your API token and send it with your requests. `<API-TOKEN>` in the following examples refers to your API token. You can generate and manage API tokens from your AI Hub user settings. See the [authorization documentation](/api-sdk/authorization/) for details.

## Mount paths

Use the mount path to specify the workspace in which to mount the drive. For organization members, the format is `/<ORGANIZATION-ID>/<WORKSPACE>/fs`

| Value               | Description                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<ORGANIZATION-ID>` | Enter your organization ID. You can find this on the **Settings** > **APIs** page, under **Organization ID**.                                                                                                                                                                                                                                                                                           |
| `<WORKSPACE>`       | This value reflects the workspace name (shared workspaces) or your user ID (personal workspaces). You can find this value by selecting the workspace in Workspaces, then looking at the `workspace` query string in the URL. For example: - https\://aihub.instabase.com/workspaces/create?workspace=*New\_Workspace* -  https\://aihub.instabase.com/workspaces/create?workspace=*john.doe\_gmail.com* |

## Mount drive

| Method | Syntax                    |
| ------ | ------------------------- |
| POST   | `<API-ROOT>/<MOUNT-PATH>` |

### Description

Mount a drive by sending a `POST` request to `<API-ROOT>/<MOUNT-PATH>`, specifying the workspace in which to connect the drive using [MOUNT-PATH](#mount-paths) in the request URL.

### Request headers

| Name               | Type   | Description                                                    | Values                                                  |
| ------------------ | ------ | -------------------------------------------------------------- | ------------------------------------------------------- |
| `action`           | string | String describing the action to be taken.                      | Valid value is `mount`.                                 |
| `mount_point_name` | string | The name of the mounted drive.                                 | A valid name of a drive in the specified workspace.     |
| `mount_details`    | JSON   | Details of drive to mount that varies according to drive type. | See section below for valid values for each drive type. |

#### Amazon S3 bucket mount details

Mounting Amazon S3 buckets is supported for organization accounts. For an S3 bucket, provide mount details in the following structure:

```python
'mount_details': {
  'client_type': 'S3',
  'prefix': '<Path to mount (ex: files/data)>' ,
  's3_server_url': '<S3 Server URL>',
  's3_server_port': '<S3 Server Port>',
  's3_server_is_secure': 'True' | 'False',
  's3_server_validate_certs': 'True' | 'False',
  'use_aws_access_creds': True | False,
  'aws_access_key_id': '<AWS access key>', # Optional, use if 'use_aws_access_creds' is set to True
  'aws_secret_access_key': '<AWS secret access key>', # Optional, use if 'use_aws_access_creds' is set to True
  'bucket_name': '<AWS S3 Bucket Name>',
  'aws_region': 'AWS Region (ex: us-east-1)',
  'encryption_type': 'none' | 'kms_encryption',
  's3_sse_encryption_type': 'none' | 'aws_sse_s3' | 'aws_sse_kms',
  's3_sse_kms_key_id': '<S3 SSE KMS key ID>', # Optional, use if 's3_sse_encryption_type' is set to 'aws_sse_kms'
  's3_use_virtual_style_url': True | False,
  'use_hcp_s3_storage': True | False,
  'mount_permissions': '{"access_level":"writer"}' | '{"access_level":"reader"}'
}
```

> **Note**
>
> If `s3_sse_encryption_type` is set to `aws_sse_kms`, define the Amazon resource name (ARN) for the KMS key in `s3_sse_kms_key_id`. For example, `arn:aws:kms:us-west-2:123456789012:key/abcd1234-5678-90ab-cdef-EXAMPLE11111`. See the AWS [Finding the key ID and key ARN documentation](https://docs.aws.amazon.com/kms/latest/developerguide/find-cmk-id-arn.html) for additional information.

#### Azure Blob Storage mount details

Mounting Amazon S3 buckets is supported for organization accounts. Azure Blob Storage drives can be mounted with a connection string or a service principal as the authentication type.

If mounting an Azure Blob Storage container with a connection string, provide mount details in the following structure:

```python
'mount_details': {
  'client_type': 'AzureBlob',
  'az_blob_store_auth_type': 'connection_string', # Defaults to 'connection_string' if left empty
  'azure_container_name': '<Azure Blob Storage container name>',
  'azure_connect_str': '<Azure storage account connection string>'
  'mount_permissions': '{"access_level":"reader"}' | '{"access_level":"writer"}'
}
```

See the following sample connection string structure for an Azure storage account with default configurations. Connection strings can embed a different subset of fields:

```
DefaultEndpointsProtocol=[http|https];AccountName=myAccountName;AccountKey=myAccountKey;EndpointSuffix=[core.windows.net]
```

If mounting an Azure Blob Storage container with a service principal, provide mount details in the following structure:

```python
'mount_details': {
  'client_type': 'AzureBlob',
  'az_blob_store_auth_type': 'service_principal', # Defaults to 'connection_string' if left empty
  'azure_container_name': '<Azure Blob Storage container name>',
  'az_blob_store_client_id': '<Azure storage account client ID>',
  'az_blob_store_tenant_id': '<Azure storage account tenant ID>',
  'az_blob_store_client_secret': '<Azure storage account client secret'>,
  'az_blob_store_service_url': '<Azure storage account service URL'>,
  'mount_permissions': '{"access_level":"reader"}' | '{"access_level":"writer"}'
}
```

### Request body

This request contains no body.

### Response status

A 2XX status code indicates the request was successful.

| Status | Meaning                                         |
| ------ | ----------------------------------------------- |
| 200 OK | The response contains the entire file contents. |

### Response headers

Headers are always present if the request was successful unless marked as optional.

| Name             | Description                                 | Values                                 |
| ---------------- | ------------------------------------------- | -------------------------------------- |
| `Content-Type`   | The content type of the response body.      | `application/json`                     |
| `Content-Length` | The length, in bytes, of the response body. | An integer greater than or equal to 0. |

### Response schema

All keys are returned in the response by default, unless marked as optional.

| Key      | Description                                          | Values        |
| -------- | ---------------------------------------------------- | ------------- |
| `status` | Status of request.                                   | `OK`, `ERROR` |
| `msg`    | Optional. Job status message if `status` is `ERROR`. |               |

### Examples

#### Request

```python
import json, requests

headers = {
  'Authorization': f'Bearer {API_TOKEN}',
}
args = {
  'action':'mount',
  'mount_point_name': 'azure-blob-mount-point',
  'mount_details': {
    'client_type': 'AzureBlob',
    'az_blob_store_auth_type': 'connection_string',
    'azure_container_name': '<Azure Blob Storage container name>',
    'azure_connect_str': '<Azure storage account connection string>'
    'mount_permissions': '{"access_level":"reader"}' | '{"access_level":"writer"}'
  }
}
data = json.dumps(args)
resp = requests.post(api_root + '<MOUNT-PATH>',
                     headers=headers, 
                     data=data).json()
```

This request creates an Azure Blob Storage drive with the name `azure-blob-mount-point`.

#### Response

```shell
HTTP STATUS CODE 200

{
  "status": "OK"
}
```

## Update drive credentials

| Method | Syntax                  |
| ------ | ----------------------- |
| PUT    | `API_ROOT/<MOUNT-PATH>` |

### Description

Update a drive's credentials by sending a `PUT` request to `API_ROOT/<MOUNT-PATH>`, specifying the workspace in which the drive is connected using [MOUNT-PATH](#mount-paths) in the request URL.

### Request headers

| Name               | Type   | Description                          | Values                                                      |
| ------------------ | ------ | ------------------------------------ | ----------------------------------------------------------- |
| `mount_point_name` | string | The name of the mounted drive        | A valid name of a mounted drive in the specified workspace. |
| `mount_details`    | JSON   | New credentials of the mounted drive | See section below for valid values for each drive type.     |

> **Note**
>
> This endpoint can't be used to update non-credential fields in the `mount_details` object. See the following examples for supported fields.

For an S3 bucket, you can update the following drive credentials fields:

```json
'mount_details': {
  'aws_access_key_id': '<AWS access key>', # If 'use_aws_access_creds' is set to True
  'aws_secret_access_key': '<AWS secret access key>', # If 'use_aws_access_creds' is set to True
}
```

For Azure Blob Storage drives mounted with a connection string, you can update the following drive credentials fields:

```json
'mount_details': {
  'azure_connect_str': '<Azure storage account connection string>',
}
```

For Azure Blob Storage drives mounted with a service principal, you can update the following drive credentials fields:

```json
'mount_details': {
  'az_blob_store_client_id': '<Azure storage account client ID>',
  'az_blob_store_tenant_id': '<Azure storage account tenant ID>',
  'az_blob_store_client_secret': '<Azure storage account client secret>',
  'az_blob_store_service_url': '<Azure storage account service URL>',
}
```

### Request body

This request contains no body.

### Response status

A 2XX status code indicates the request was successful.

| Status | Meaning                                                        |
| ------ | -------------------------------------------------------------- |
| 200 OK | Indicates that the response contains the entire file contents. |

### Response headers

Headers are always present if the request was successful unless marked as optional.

| Name             | Description                                 | Values                                 |
| ---------------- | ------------------------------------------- | -------------------------------------- |
| `Content-Type`   | The content type of the response body.      | `application/json`                     |
| `Content-Length` | The length, in bytes, of the response body. | An integer greater than or equal to 0. |

### Response schema

All keys are returned in the response by default, unless marked as optional.

| Key      | Description                                          | Values        |
| -------- | ---------------------------------------------------- | ------------- |
| `status` | Status of request.                                   | `OK`, `ERROR` |
| `msg`    | Optional. Job status message if `status` is `ERROR`. |               |

### Examples

#### Request

```python
import json, requests

headers = {
  'Authorization': f'Bearer {API_TOKEN}',
}
args = {
  {
    "mount_point_name": "azure-blob-mount-point",
    "mount_details": {
      'azure_connect_str': '<Azure storage account connection string>',
    }
  }
}
data = json.dumps(args)
resp = requests.put(api_root + '<MOUNT-PATH>', headers=headers, data=data).json()
```

This request updates the connection string of the existing Azure Blob Storage drive "azure-blob-mount-point".

#### Response

If the drive credentials were successfully updated:

```shell
HTTP STATUS CODE 200

{
  "status": "OK"
}
```

## Unmount drive

| Method | Syntax                  |
| ------ | ----------------------- |
| DELETE | `API_ROOT/<MOUNT-PATH>` |

### Description

Remove a mounted drive by sending a `DELETE` request to `API_ROOT/<MOUNT-PATH>`, specifying the workspace in which the drive is connected using [MOUNT-PATH](#mount-paths) in the request URL.

### Request headers

| Name   | Type   | Description                   | Values                                                      |
| ------ | ------ | ----------------------------- | ----------------------------------------------------------- |
| `name` | string | The name of the mounted drive | A valid name of a mounted drive in the specified workspace. |

### Request body

This request contains no body.

### Response status

A 2XX status code indicates the request was successful.

| Status | Meaning                                                        |
| ------ | -------------------------------------------------------------- |
| 200 OK | Indicates that the response contains the entire file contents. |

### Response headers

Headers are always present if the request was successful unless marked as optional.

| Name             | Description                                 | Values                                 |
| ---------------- | ------------------------------------------- | -------------------------------------- |
| `Content-Type`   | The content type of the response body.      | `application/json`                     |
| `Content-Length` | The length, in bytes, of the response body. | An integer greater than or equal to 0. |

### Response schema

All keys are returned in the response by default, unless marked as optional.

| Key      | Description                                          | Value         |
| -------- | ---------------------------------------------------- | ------------- |
| `status` | Status of request.                                   | `OK`, `ERROR` |
| `msg`    | Optional. Job status message if `status` is `ERROR`. |               |

### Examples

#### Request

```python
import json, requests

headers = {
  'Authorization': f'Bearer {API_TOKEN}',
}
args = {
  'name': '<drive name>'
}
data = json.dumps(args)
resp = requests.delete(api_root + '<MOUNT-PATH>', headers=headers, data=data).json()
```

#### Response

If the drive was successfully unmounted:

```shell
HTTP STATUS CODE 200

{
  "status": "OK"
}
```