> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcollate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Storage Service

> Create a new storage service connection with authentication, configuration, owners, and tags using the Collate REST API for metadata ingestion and discovery.

# Create a Storage Service

Create a new storage service connection to a platform such as S3, GCS, or ADLS.

## Body Parameters

**name** `string` *required*

Name of the storage service. Must be unique across all storage services.

**serviceType** `string` *required*

Type of storage service, for example `S3`, `GCS`, `ADLS`, `CustomStorage`.

**connection** `object` *required*

Connection configuration specific to the service type.

**properties**

**config** `object`

Service-specific connection configuration, such as AWS credentials for S3 and project ID for GCS.

**displayName** `string`

Human-readable display name for the storage service.

**description** `string`

Description of the storage service in Markdown format.

**owners** `array`

Array of owner references (users or teams) to assign to the service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the storage service.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

```python POST /v1/services/storageServices theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import StorageServices
from metadata.generated.schema.api.services.createStorageService import CreateStorageServiceRequest

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

request = CreateStorageServiceRequest(
    name="s3_datalake",
    displayName="S3 Data Lake",
    serviceType="S3",
    description="Production S3 data lake for analytics",
    connection={
        "config": {
            "type": "S3",
            "awsConfig": {
                "awsAccessKeyId": "AKIA...",
                "awsSecretAccessKey": "***",
                "awsRegion": "us-east-1",
                "endPointURL": "https://s3.amazonaws.com/"
            }
        }
    }
)

service = StorageServices.create(request)
print(f"Created: {service.fullyQualifiedName.root}")
```

```java POST /v1/services/storageServices theme={null}
import org.openmetadata.schema.api.services.CreateStorageService;
import org.openmetadata.schema.api.services.CreateStorageService.StorageServiceType;
import org.openmetadata.schema.entity.services.StorageService;
import org.openmetadata.schema.security.credentials.AWSCredentials;
import org.openmetadata.schema.services.connections.storage.S3Connection;
import org.openmetadata.schema.type.StorageConnection;
import org.openmetadata.sdk.fluent.StorageServices;

// client is an initialized OpenMetadataClient.
StorageServices.setDefaultClient(client);

CreateStorageService request = new CreateStorageService()
    .withName("s3_datalake")
    .withServiceType(StorageServiceType.S3)
    .withConnection(new StorageConnection().withConfig(
        new S3Connection().withAwsConfig(
            new AWSCredentials()
                .withAwsAccessKeyId("AKIA...")
                .withAwsSecretAccessKey("***")
                .withAwsRegion("us-east-1"))));

StorageService service = StorageServices.create(request);
```

```bash POST /v1/services/storageServices theme={null}
curl -X POST "{base_url}/api/v1/services/storageServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "s3_datalake",
    "serviceType": "S3",
    "description": "Production S3 data lake for analytics",
    "connection": {
      "config": {
        "type": "S3",
        "awsConfig": {
          "awsAccessKeyId": "AKIA...",
          "awsSecretAccessKey": "***",
          "awsRegion": "us-east-1",
          "endPointURL": "https://s3.amazonaws.com/"
        }
      }
    }
  }'
```

```json Response theme={null}
{
  "id": "d1589e1d-2ab0-431c-a383-15e4be20a106",
  "name": "s3_datalake",
  "fullyQualifiedName": "s3_datalake",
  "serviceType": "S3",
  "description": "Production S3 data lake for analytics",
  "connection": {
    "config": {
      "type": "S3",
      "awsConfig": {
        "enabled": false,
        "awsAccessKeyId": "AKIA...",
        "awsSecretAccessKey": "*********",
        "awsRegion": "us-east-1",
        "endPointURL": "https://s3.amazonaws.com/"
      }
    }
  },
  "version": 0.1,
  "updatedAt": 1769982621820,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106",
  "owners": [],
  "tags": [],
  "deleted": false,
  "domains": []
}
```

***

## Returns

Returns the created storage service object with all specified properties and system-generated fields.

## Response

**id** `string`

Unique identifier for the storage service (UUID format).

**name** `string`

Storage service name.

**fullyQualifiedName** `string`

Fully qualified name of the service.

**displayName** `string`

Human-readable display name.

**description** `string`

Description of the storage service in Markdown format.

**serviceType** `string`

Type of storage service, for example S3, GCS, ADLS, CustomStorage.

**connection** `object`

Connection configuration for the service.

**properties**

**config** `object`

Service-specific connection configuration.

**owners** `array`

List of owners assigned to the storage service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the assigned domains.

**tags** `array`

Classification tags applied to the storage service.

**properties**

**tagFQN** `string`

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**version** `number`

Version number for the entity (starts at 0.1).

***

## Create or Update (PUT)

Use `PUT /v1/services/storageServices` instead of `POST` to perform an upsert. If a storage service with the same `fullyQualifiedName` already exists, it will be updated; otherwise, a new service is created. The request body is the same as `POST`.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/services/storageServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
```

> [!NOTE]
>
> `PUT` will not return a `409` conflict error if the entity already exists -- it will update the existing entity instead. However, for certain fields (such as description, tags, owners, and custom properties), `PUT` preserves an already-populated value instead of overwriting it with an empty or omitted one -- the exact behavior depends on the field and the calling user or bot's permissions, not a blanket rule. See [Entity Update Behavior](https://docs.getcollate.io/api-reference/entity-updates.md) for the full preserve/merge rules. Use `PATCH` to intentionally replace an existing value.

***

## Bulk Create or Update (PUT)

Use `PUT /v1/services/storageServices/bulk` to create or update multiple storage services in a single request. The request body is an array of create request objects.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/services/storageServices/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "s3_datalake", "serviceType": "S3", "connection": { "config": {} } },
    { "name": "gcs_analytics", "serviceType": "GCS", "connection": { "config": {} } }
  ]'
```

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid request body or missing required fields |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to create storage services |
| `409` | `ENTITY_ALREADY_EXISTS` | Storage service with same name already exists (POST only) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.