# Metadata Schemas CLI Commands

> The soat CLI commands for the Metadata Schemas module, with usage and every option, generated from the OpenAPI spec.

# Metadata Schemas Commands

See [Metadata Schemas module docs](../../modules/metadata-schemas) for permissions and data model.

### `soat list-metadata-schemas`

List metadata schemas

- Method: `GET`
- Path: `/api/v1/metadata-schemas`

#### Usage

```bash
soat list-metadata-schemas
```

#### Options

##### `--project-id`

Project public ID (proj_ prefix)

- Source: `query`
- Required: no
- Type: `string`
- Example: `proj_V1StGXR8Z5jdHi6B`

##### `--resource-type`

Return only the declarations governing this resource.

- Source: `query`
- Required: no
- Type: `enum("document")`

### `soat create-metadata-schema`

Declare a metadata schema

- Method: `POST`
- Path: `/api/v1/metadata-schemas`

#### Usage

```bash
soat create-metadata-schema --resource-type <enum("document")> --schema <object>
```

#### Options

##### `--project-id`

Project the declaration governs. Optional for a project-scoped API key, which supplies it.

- Source: `body`
- Required: no
- Type: `string`
- Example: `proj_V1StGXR8Z5jdHi6B`

##### `--resource-type`

The resource whose metadata this declaration governs. A type appears here once its write path reads the registry, so a declaration always has a door that enforces it.

- Source: `body`
- Required: yes
- Type: `enum("document")`
- Example: `document`

##### `--path-prefix`

The selector a `document` declaration must carry: the directory it governs.

- Source: `body`
- Required: no
- Type: `string`
- Example: `/reports`

##### `--schema`

A JSON Schema. Its keywords are its own vocabulary and are stored as written.

- Source: `body`
- Required: yes
- Type: `object`
- Example: `\{"type":"object","required":["quarter"],"properties":\{"quarter":\{"type":"string"\}\}\}`

### `soat validate-metadata`

Check metadata against what is declared

- Method: `POST`
- Path: `/api/v1/metadata-schemas/validate`

#### Usage

```bash
soat validate-metadata --path <string>
```

#### Options

##### `--project-id`

—

- Source: `body`
- Required: no
- Type: `string`
- Example: `proj_V1StGXR8Z5jdHi6B`

##### `--path`

The path the document would be filed at, which decides which declaration governs it.

- Source: `body`
- Required: yes
- Type: `string`
- Example: `/reports/q1.txt`

##### `--metadata`

The bag to judge. Absent or `null` is judged as an empty bag.

- Source: `body`
- Required: no
- Type: `unknown`
- Example: `\{"quarter":"Q1"\}`

### `soat get-metadata-schema`

Get a metadata schema

- Method: `GET`
- Path: `/api/v1/metadata-schemas/{metadata_schema_id}`

#### Usage

```bash
soat get-metadata-schema --metadata-schema-id <string>
```

#### Options

##### `--metadata-schema-id`

—

- Source: `path`
- Required: yes
- Type: `string`
- Example: `mdschema_V1StGXR8Z5jdHi6B`

### `soat update-metadata-schema`

Update a metadata schema

- Method: `PATCH`
- Path: `/api/v1/metadata-schemas/{metadata_schema_id}`

#### Usage

```bash
soat update-metadata-schema --metadata-schema-id <string>
```

#### Options

##### `--metadata-schema-id`

—

- Source: `path`
- Required: yes
- Type: `string`
- Example: `mdschema_V1StGXR8Z5jdHi6B`

##### `--path-prefix`

The declaration's new selector.

- Source: `body`
- Required: no
- Type: `string`
- Example: `/reports/quarterly`

##### `--schema`

Replaces the declared JSON Schema.

- Source: `body`
- Required: no
- Type: `object`
- Example: `\{"type":"object","required":["quarter","owner"],"properties":\{"quarter":\{"type":"string"\},"owner":\{"type":"string"\}\}\}`

### `soat delete-metadata-schema`

Delete a metadata schema

- Method: `DELETE`
- Path: `/api/v1/metadata-schemas/{metadata_schema_id}`

#### Usage

```bash
soat delete-metadata-schema --metadata-schema-id <string>
```

#### Options

##### `--metadata-schema-id`

—

- Source: `path`
- Required: yes
- Type: `string`
- Example: `mdschema_V1StGXR8Z5jdHi6B`
