# Custom Record Types

## Overview

The Keeper Secrets Manager CLI has a list of default record types that are available for use. The CLI also allows for the creation of records using custom record types.

{% hint style="info" %}
More information about Custom Record Types is found in the [Enterprise Guide](/enterprise-guide/record-types.md).
{% endhint %}

In order to create records that use custom record types, the schema needs to be defined within the CLI. This is done by exporting the custom record type using [Keeper Commander](/keeperpam/commander-cli/overview.md).

The below will export the "My Custom" record type, as JSON, to the file `my_record_type.json`.

```
My Vault> rti --format json -lr "My Custom" --output my_record_type.json
```

The JSON file should be copied into a directory called `record_type`. The location of the `record_type` directory is the same as the location of the `keeper.ini` file. The `record_type` doesn't need to be in the same directory as the `keeper.ini`, it just need to be in locations where the CLI will check for the `keeper.ini`.

* The path defined by the environment variable **`KSM_INI_DIR`**
* The current directory
* The user's home directory
  * `${HOME}`
  * `${HOME}/.config/ksm`
  * `$env:USERPROFILE`
* Various system directories
  * `/etc`
  * `/etc/ksm`
  * `/etc/keeper`
  * `$env:APPDATA/Keeper`
  * `$env:ProgamData/Keeper`
  * `$env:ProgramFiles/Keeper`

An alternative directory can be set via the [config command](/keeperpam/secrets-manager/secrets-manager-command-line-interface/config-command.md).

```
$ ksm config record-type-dir -d /path/to/my/record/type/schemas
```

Once the file is copied into the `record_type` directory, it will be visible in the list of available record types.

```
 $ ksm secret template record -l
 Record Type
 ------------------------
 login
 bankAccount
 address
 ...
 My Custom
```

At this point the custom record type can be used to create a new record.

```
$ ksm secret add field --sf XXXX --rt "My Custom" -t "My Record" \
    "login=jsmith" "password=XXXX" "url=https://localhost"
```

If the custom record type name contains spaces, the name will need to be surrounded by quotes.

{% hint style="info" %}
All custom record type name need to be unique. An error will occur if a record type with the same name has already been imported. You also cannot override the default record types.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.keeper.io/keeperpam/secrets-manager/secrets-manager-command-line-interface/custom-record-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
