> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/concepts/resources/depot/create-depot-type.md).

# Add a depot type

A **depot type** tells the Depot Service what a source system looks like: what configuration fields it needs, what credentials secure it, and how to resolve a Uniform Data Link (UDL) into its component parts.

Creating a depot type is a prerequisite for anyone who wants to connect a source system to DataOS that does not yet have a built-in type. Once a depot type is registered, it becomes available as a valid `spec.type` value in Depot manifests across the platform.

{% hint style="warning" icon="hand-back-point-right" %}
Creating a depot type is a platform-level operation. You need the **Operator** or **Tenant Admin** role to apply a depot type manifest.
{% endhint %}

## Structure of a depot type manifest

{% code expandable="true" collapsedlinecount="8" %}

```yaml
name: <type-name>
description: ${{description}}
specSchema: |-
  ${{json-schema-for-spec}}
resolutionPattern: "${{udl-resolution-regex}}"
identifierPattern: "${{udl-identifier-regex}}"
secretSchema: |-
  ${{json-schema-for-secret}}
```

{% endcode %}

### Fields

#### **`name`**

The identifier used as the `spec.type` value in a Depot manifest.

| **Data type** | **Requirement** | **Possible values**               |
| ------------- | --------------- | --------------------------------- |
| string        | mandatory       | lowercase alphanumeric, no spaces |

**Example:**

{% code expandable="true" collapsedlinecount="8" %}

```yaml
name: mystore
```

{% endcode %}

***

#### **`description`**

A human-readable description of the source system this depot type connects to.

| **Data type** | **Requirement** |
| ------------- | --------------- |
| string        | optional        |

***

#### **`specSchema`**

A [JSON Schema (draft-07)](https://json-schema.org/draft-07/json-schema-release-notes) document (as an inline string) that describes the `spec.spec` block of a Depot manifest using this type. The Depot Service validates every new Depot manifest against this schema before accepting it.

| **Data type**                          | **Requirement** |
| -------------------------------------- | --------------- |
| JSON Schema string (YAML block scalar) | mandatory       |

Define every field that a Depot of this type can or must provide. Use `required` to enforce mandatory fields and `additionalProperties: false` to prevent unknown keys from slipping through.

***

#### **`resolutionPattern`**

A named-capture-group regular expression that the Depot Service uses to break a UDL (`dataos://depot/path`) into its logical parts (for example, depot name and collection path). Named groups become available as variables during resolution.

| **Data type** | **Requirement** |
| ------------- | --------------- |
| regex string  | mandatory       |

***

#### **`identifierPattern`**

A named-capture-group regular expression used to match and extract the depot and entity identifiers from a UDL. This is used by DataOS internals to look up the correct Depot when a UDL is referenced.

| **Data type** | **Requirement** |
| ------------- | --------------- |
| regex string  | mandatory       |

***

#### **`secretSchema`**

A JSON Schema document that describes the Secret payload expected by Depots of this type. The `required` array and `allOf` conditional blocks should capture authentication mode variants (for example, different fields for `PLAINTEXT` vs `SASL_SSL`).

| **Data type**                          | **Requirement** |
| -------------------------------------- | --------------- |
| JSON Schema string (YAML block scalar) | mandatory       |

***

## Example

The following example uses **Kafka** to illustrate the structure of a depot type manifest. The same pattern applies to any custom source system you want to register.

{% code expandable="true" collapsedlinecount="12" %}

```yaml
name: kafka
description: Apache Kafka depot type
specSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "KafkaConfig",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "brokers": {
        "type": "array",
        "items": { "type": "string" },
        "description": "List of Kafka broker addresses"
      },
      "schemaRegistryUrl": {
        "type": "string",
        "description": "Kafka Schema Registry URL"
      },
      "params": {
        "type": "object",
        "additionalProperties": { "type": "string" },
        "description": "Additional Kafka configuration parameters"
      }
    },
    "required": ["brokers"]
  }
resolutionPattern: "dataos://(?<depot>[^/?]+)(?:/(?<topic>[^/?]+))?"
identifierPattern: "dataos://(?<depot>[^/?]+)(?:/(?<topic>[^/?]+))?"
secretSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "KafkaSecret",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "security_protocol": {
        "type": "string",
        "enum": ["PLAINTEXT", "SASL_PLAINTEXT", "SSL", "SASL_SSL"]
      },
      "username": { "type": "string" },
      "password": { "type": "string" },
      "sasl_mechanism": {
        "type": "string",
        "enum": ["PLAIN", "SCRAM-SHA-256", "SCRAM-SHA-512"]
      },
      "endpoint_identification_algorithm": { "type": "string" },
      "ca_file": { "type": "string" },
      "trust_store_file": { "type": "string" },
      "trust_store_type": { "type": "string" },
      "trust_store_password": { "type": "string" },
      "client_key_file": { "type": "string" },
      "client_cert_file": { "type": "string" },
      "key_store_file": { "type": "string" },
      "key_store_type": { "type": "string" },
      "key_store_password": { "type": "string" },
      "key_password": { "type": "string" }
    },
    "required": ["security_protocol"],
    "allOf": [
      {
        "if": { "properties": { "security_protocol": { "const": "SASL_PLAINTEXT" } } },
        "then": { "required": ["username", "password"] }
      },
      {
        "if": { "properties": { "security_protocol": { "const": "SSL" } } },
        "then": {
          "required": [
            "trust_store_file",
            "trust_store_type",
            "trust_store_password",
            "key_store_file",
            "key_store_type",
            "key_store_password"
          ]
        }
      },
      {
        "if": { "properties": { "security_protocol": { "const": "SASL_SSL" } } },
        "then": {
          "required": [
            "username", "password", "sasl_mechanism",
            "trust_store_file", "trust_store_type", "trust_store_password"
          ]
        }
      }
    ]
  }
```

{% endcode %}

### What the schemas enforce

**`specSchema`** requires every Depot of this type to supply at least one broker address:

{% code expandable="true" collapsedlinecount="8" %}

```yaml
spec:
  type: kafka
  spec:
    brokers:
      - broker1:9092
    schemaRegistryUrl: http://registry:8081  # optional
```

{% endcode %}

**`secretSchema`** validates the Secret payload against the chosen `security_protocol`. For example, `SASL_SSL` mode requires `username`, `password`, `sasl_mechanism`, and trust store fields, while `PLAINTEXT` only requires `security_protocol`.

### UDL patterns

Both `resolutionPattern` and `identifierPattern` use:

```
dataos://(?<depot>[^/?]+)(?:/(?<topic>[^/?]+))?
```

This resolves UDLs such as:

| UDL                       | `depot` capture | `topic` capture |
| ------------------------- | --------------- | --------------- |
| `dataos://mydepot`        | `mydepot`       | *(none)*        |
| `dataos://mydepot/orders` | `mydepot`       | `orders`        |

## Apply the depot type manifest

Save the manifest to a file (for example, `my-depot-type.yaml`) and apply it with the DataOS CLI:

```bash
dataos-ctl depot types apply -f my-depot-type.yaml
```

## Verify the depot type

After applying, confirm the depot type is registered:

```bash
dataos-ctl depot types get
```

To look up a specific type by name:

```bash
dataos-ctl depot types get -n <type-name>
```

To see full details of a depot type:

```bash
dataos-ctl depot types get -n <type-name> --details
```

Once registered, the type name is available as a valid `spec.type` value in Depot manifests.

## Delete a depot type

```bash
dataos-ctl depot types delete -n <type-name>
```

## Built-in depot type definitions

The following are the actual manifests used to register some of the built-in depot types in DataOS. They illustrate how `specSchema`, `secretSchema`, and UDL patterns are defined for different kinds of sources.

{% tabs %}
{% tab title="Snowflake" %}
{% code expandable="true" collapsedlinecount="12" %}

```yaml
name: snowflake
description: Snowflake depot type
specSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "SnowflakeConfig",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "url": {
        "type": "string",
        "description": "Snowflake account URL"
      },
      "database": {
        "type": "string",
        "description": "Snowflake database name"
      },
      "warehouse": {
        "type": "string",
        "description": "Snowflake warehouse name"
      },
      "params": {
        "type": "object",
        "additionalProperties": { "type": "string" },
        "description": "Additional Snowflake parameters"
      },
      "account": {
        "type": "string",
        "description": "Snowflake account identifier"
      },
      "role": {
        "type": "string",
        "description": "Snowflake role"
      }
    },
    "required": ["url", "database"]
  }
resolutionPattern: "dataos://(?<depot>[^/?]+)(?:/(?<schema>[^/?]+))?(?:/(?<table>[^/?]+))?"
identifierPattern: "dataos://(?<depot>[^/?]+)(?:/(?<schema>[^/?]+))?(?:/(?<table>[^/?]+))?"
secretSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "SnowflakeSecret",
    "type": "object",
    "properties": {
      "auth_mode": { "type": "string" },
      "key": { "type": "string" },
      "passphrase": { "type": "string" },
      "username": { "type": "string" },
      "password": { "type": "string" }
    },
    "required": ["username"],
    "additionalProperties": false
  }
```

{% endcode %}
{% endtab %}

{% tab title="PostgreSQL" %}
{% code expandable="true" collapsedlinecount="12" %}

```yaml
name: postgresql
specSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "PostgresConfig",
    "type": "object",
    "properties": {
      "subprotocol": { "type": "string" },
      "host": { "type": "string" },
      "port": { "type": "integer" },
      "database": { "type": "string" },
      "params": {
        "type": "object",
        "additionalProperties": { "type": "string" }
      }
    },
    "required": ["subprotocol", "host", "port", "database"],
    "additionalProperties": false
  }
resolutionPattern: "dataos://(?<depot>[^/?]+)(?:/(?<schema>[^/?]+))?(?:/(?<table>[^/?]+))?"
identifierPattern: "dataos://(?<depot>[^/?]+)(?:/(?<schema>[^/?]+))?(?:/(?<table>[^/?]+))?"
secretSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "PostgresSecret",
    "type": "object",
    "properties": {
      "username": { "type": "string" },
      "password": { "type": "string" }
    },
    "required": ["username", "password"],
    "additionalProperties": false
  }
```

{% endcode %}
{% endtab %}

{% tab title="MySQL" %}
{% code expandable="true" collapsedlinecount="12" %}

```yaml
name: mysql
description: MySQL database depot type
specSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "MysqlConfig",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "subprotocol": {
        "type": "string",
        "description": "JDBC subprotocol"
      },
      "host": {
        "type": "string",
        "description": "MySQL host"
      },
      "port": {
        "type": "integer",
        "description": "MySQL port"
      },
      "params": {
        "type": "object",
        "additionalProperties": { "type": "string" },
        "description": "Additional MySQL connection parameters"
      }
    },
    "required": ["host", "port"]
  }
resolutionPattern: "dataos://(?<depot>[^/?]+)(?:/(?<database>[^/?]+))?(?:/(?<table>[^/?]+))?"
identifierPattern: "dataos://(?<depot>[^/?]+)(?:/(?<database>[^/?]+))?(?:/(?<table>[^/?]+))?"
secretSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "MysqlSecret",
    "type": "object",
    "properties": {
      "username": { "type": "string" },
      "password": { "type": "string" }
    },
    "required": ["username", "password"],
    "additionalProperties": false
  }
```

{% endcode %}
{% endtab %}

{% tab title="Amazon Redshift" %}
{% code expandable="true" collapsedlinecount="12" %}

```yaml
name: redshift
description: Amazon Redshift depot type
specSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "RedshiftConfig",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "subprotocol": {
        "type": "string",
        "description": "JDBC subprotocol"
      },
      "host": {
        "type": "string",
        "description": "Redshift cluster endpoint"
      },
      "port": {
        "type": "integer",
        "description": "Redshift port"
      },
      "database": {
        "type": "string",
        "description": "Redshift database name"
      },
      "params": {
        "type": "object",
        "additionalProperties": { "type": "string" },
        "description": "Additional Redshift connection parameters"
      },
      "scheme": {
        "type": "string",
        "description": "S3 scheme for temporary data"
      },
      "bucket": {
        "type": "string",
        "description": "S3 bucket for temporary data"
      },
      "relativePath": {
        "type": "string",
        "description": "S3 relative path for temporary data"
      }
    },
    "required": ["subprotocol", "host", "port"]
  }
resolutionPattern: "dataos://(?<depot>[^/?]+)(?:/(?<schema>[^/?]+))?(?:/(?<table>[^/?]+))?"
identifierPattern: "dataos://(?<depot>[^/?]+)(?:/(?<schema>[^/?]+))?(?:/(?<table>[^/?]+))?"
secretSchema: |-
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "RedshiftSecret",
    "type": "object",
    "properties": {
      "username": { "type": "string" },
      "password": { "type": "string" },
      "aws_access_key": { "type": "string" },
      "aws_secret_key": { "type": "string" }
    },
    "required": ["username", "password"],
    "additionalProperties": false
  }
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/concepts/resources/depot/create-depot-type.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
