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

# Create Preset

> Save a named transform with client.CreatePreset().

A preset is a named transform, so call sites don't repeat parameters and the recipe can
change without touching them. See [Presets](/guides/presets).

```go theme={null}
preset, err := client.CreatePreset(ctx, dreep.CreatePresetOptions{
    Key:  "thumbnail",
    Name: "Thumbnail",
    Transform: &dreep.Transform{
        Width:  200,
        Height: 200,
        Fit:    dreep.FitCover,
        Format: dreep.FormatWebP,
    },
})
```

## Signature

```go theme={null}
func (c *Client) CreatePreset(ctx context.Context, o dreep.CreatePresetOptions) (*dreep.Preset, error)
```

## `CreatePresetOptions`

| Field | Type | Description |
| :- | :- | :- |
| `Key` | `string` | **Required.** Lowercase letters, numbers and underscores. What callers pass as `Transform.Preset` |
| `Name` | `string` | **Required.** Human-readable label |
| `Transform` | [`*dreep.Transform`](/go-sdk/media/build-url#transform-fields) | **Required.** The recipe. Set at least a `Format` or a dimension |

An invalid key or a missing name or transform returns an error before any request is sent.

## Returns

```go theme={null}
type Preset struct {
    ID        string
    Key       string
    Name      string
    Params    map[string]any // the stored transform parameters
    CreatedAt time.Time
}
```

## Using it

Once saved, apply it anywhere a transform is accepted:

```go theme={null}
client.URL(asset.ID, &dreep.Transform{Preset: "thumbnail"})

client.Upload(ctx, dreep.UploadOptions{
    File:      f,
    Filename:  "hero.jpg",
    Transform: &dreep.Transform{Preset: "thumbnail"},
})
```

Changing a preset changes what every call site delivers, without a deploy.

## Errors

| Check | Cause |
| :- | :- |
| `dreep.IsPaymentRequired(err)` | The plan's preset quota is full |
| `dreep.IsInvalidRequest(err)` | Invalid transform, or a key already in use |


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