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

# Get Schema

> Retrieve a single trigger payload schema by slug from a SuprSend workspace, returning JSON Schema type, properties, and validation rules for draft or live.

Retrieve the full definition of a specific schema by its slug. Returns the JSON Schema object including type, properties, and validation rules. Pass the slug as a positional argument or via `--slug`. Use `--mode` to switch between draft and live versions.

## Syntax

```bash theme={"system"}
suprsend schema get [<slug>] [flags]
```

## Flags

| Flag | Description | Default |
| - | - | - |
| `-h, --help` | Show help for the command | – |
| `-g, --slug string` | Schema slug to retrieve (or pass it as a positional argument) | – |
| `-m, --mode string` | Version mode (`draft` or `live`) | `live` |
| `-o, --output string` | Output format (`json`, `yaml`) | `json` |

> [!TIP]
>
> Use `-o json` for machine-readable JSON output, `-o yaml` for YAML.

## Example

```bash theme={"system"}
# Get a schema by slug
suprsend schema get order-payload
suprsend schema get --slug order-payload

# Get the draft version
suprsend schema get --slug order-payload --mode draft

# Get schema in YAML format
suprsend schema get --slug order-payload --output yaml

# Get schema from production workspace
suprsend schema get --slug order-payload --workspace production
```


## Related topics

- [Get Schema](https://docs.suprsend.com/reference/get-schema.md)
- [Commands and Flags](https://docs.suprsend.com/reference/cli-schema-overview.md)
- [In-product Agent](https://docs.suprsend.com/reference/agent.md)
- [Generate Types](https://docs.suprsend.com/reference/cli-schema-generate-types.md)
- [Get Event](https://docs.suprsend.com/reference/cli-event-get.md)


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