<!-- Markdown twin of https://pixelvault.dev/docs/api/transform-presets/ -->

[API reference](/docs/api/)

# Transform Presets

Per-project custom named transform presets referenced via `?size=<name>`. Free includes 5 presets per project, Starter 25 and Pro 100. Combine with project `strict_transforms` to restrict CDN delivery to declared presets only.

-   [The Transform preset object](#object)
-   GET [List custom transform presets](#list_presets)
-   PUT [Create or update a transform preset](#upsert_preset)
-   DELETE [Delete a transform preset](#delete_preset)

## The Transform preset object

A project-scoped custom named transform preset usable via `?size=<name>`.

### Properties

The Transform preset object properties

Property

Type

Description

`name`

string

pattern ^\[a-z\]\[a-z0-9\_-\]{1,39}$

`params`

TransformParams

On-the-fly image transform parameters (subset of [`serve_image`](/docs/api/image-delivery/#serve_image) query parameters).

Child properties of `params`

Properties of params

Property

Type

Description

`size`

string

Named preset (built-in or custom). Allowed on [`sign_image_url`](/docs/api/images/#sign_image_url), disallowed inside custom preset definitions.

`w`

integer

min 1 · max 4000

`h`

integer

min 1 · max 4000

`fit`

string

One of: `scale-down`, `contain`, `cover`, `crop`, `pad`

`fmt`

string

One of: `auto`, `webp`, `avif`, `jpg`, `png`

`q`

string

One of: `auto`, `60`, `75`, `85`

`dpr`

string

Device pixel ratio multiplier (1, 1.5, or 2; requires w/h).

`trim`

string

Auto-trim uniform outer borders.

One of: `border`, `auto`

`anim`

string

Set `false` to flatten animated GIF/WebP to the first frame.

One of: `false`, `true`

`metadata`

string

EXIF/copyright/C2PA metadata handling.

One of: `none`, `copyright`, `keep`

`segment`

string

One of: `foreground`

`background`

string

`gravity`

string

`zoom`

string

`blur`

string

`sharpen`

string

`rotate`

string

`flip`

string

One of: `h`, `v`, `hv`

`brightness`

string

`contrast`

string

`saturation`

string

`tile`

string

Public same-project raster image path to tile as a watermark.

`watermark`

string

Public same-project raster image path for a single positioned watermark.

`watermark_pos`

string

One of: `bottom-right`, `bottom-left`, `top-right`, `top-left`, `center`

`watermark_opacity`

string

Snapped to 0.25/0.5/0.75/1.

`watermark_width`

string

Target width in px (snapped up to 32..512).

`text`

string

Text overlay string.

min length 1 · max length 120

`text_color`

string

`text_size`

string

Font size in px (snapped to 16..128).

`text_pos`

string

One of: `bottom-right`, `bottom-left`, `top-right`, `top-left`, `center`

`text_opacity`

string

Snapped to 0.25/0.5/0.75/1.

`created_at`

string (date-time)

`updated_at`

string (date-time)

The Transform preset object

```
{
  "name": "avatar",
  "params": {
    "size": "avatar",
    "w": 400,
    "h": 400,
    "fit": "cover",
    "fmt": "auto",
    "q": "85",
    "dpr": "2",
    "trim": "border",
    "anim": "false",
    "metadata": "none",
    "segment": "foreground",
    "background": "white",
    "gravity": "face",
    "zoom": "0.7",
    "blur": "30",
    "sharpen": "1",
    "rotate": "90",
    "flip": "h",
    "brightness": "1.25",
    "contrast": "1.25",
    "saturation": "0",
    "tile": "img_logo.png",
    "watermark": "img_logo.png",
    "watermark_pos": "bottom-right",
    "watermark_opacity": "0.75",
    "watermark_width": "128",
    "text": "SAMPLE",
    "text_color": "#ffffff",
    "text_size": "32",
    "text_pos": "bottom-right",
    "text_opacity": "0.75"
  },
  "created_at": "2026-11-17T09:30:00Z",
  "updated_at": "2026-11-17T09:30:00Z"
}
```

## List custom transform presets

GET `/v1/presets`

Lists the active project's custom named transform presets, plan capacity (Free 5, Starter 25, Pro 100), built-in preset names, and whether `strict_transforms` is enabled.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Responses

-   200
    
    Project transform presets and limits
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   403
    
    [`preset_management_forbidden`](/docs/errors/#preset_management_forbidden): publishable keys cannot manage transform presets. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl https://api.pixelvault.dev/v1/presets \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY"
```

Response 200

```
{
  "data": [
    {
      "name": "avatar",
      "params": {
        "size": "avatar",
        "w": 400,
        "h": 400,
        "fit": "cover",
        "fmt": "auto",
        "q": "85",
        "dpr": "2",
        "trim": "border",
        "anim": "false",
        "metadata": "none",
        "segment": "foreground",
        "background": "white",
        "gravity": "face",
        "zoom": "0.7",
        "blur": "30",
        "sharpen": "1",
        "rotate": "90",
        "flip": "h",
        "brightness": "1.25",
        "contrast": "1.25",
        "saturation": "0",
        "tile": "img_logo.png",
        "watermark": "img_logo.png",
        "watermark_pos": "bottom-right",
        "watermark_opacity": "0.75",
        "watermark_width": "128",
        "text": "SAMPLE",
        "text_color": "#ffffff",
        "text_size": "32",
        "text_pos": "bottom-right",
        "text_opacity": "0.75"
      },
      "created_at": "2026-11-17T09:30:00Z",
      "updated_at": "2026-11-17T09:30:00Z"
    }
  ],
  "meta": {
    "limit": 25,
    "total": 2,
    "strict_transforms": false,
    "builtin_presets": [
      "s",
      "m",
      "l",
      "social",
      "square",
      "portrait"
    ]
  }
}
```

## Create or update a transform preset

PUT `/v1/presets/{name}`

Idempotently creates (`201`) or updates (`200`) a named transform preset on the active project and mirrors it to edge KV. Reference it on any project image URL with `?size=<name>`. Presets cannot nest `size`.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Path parameters

Path parameters

Name

Type

Required

Description

`name`

string

Required

Custom preset name (2–40 lowercase letters, digits, `-` or `_`; cannot shadow built-in presets `s`, `m`, `l`, `social`, `square`, `portrait`).

pattern ^\[a-z\]\[a-z0-9\_-\]{1,39}$

### Request body

`application/json`, required

Request body

Name

Type

Required

Description

`params`

TransformParams

Required

On-the-fly image transform parameters (subset of [`serve_image`](/docs/api/image-delivery/#serve_image) query parameters).

Child properties of `params`

Properties of params

Name

Type

Required

Description

`size`

string

Optional

Named preset (built-in or custom). Allowed on [`sign_image_url`](/docs/api/images/#sign_image_url), disallowed inside custom preset definitions.

`w`

integer

Optional

min 1 · max 4000

`h`

integer

Optional

min 1 · max 4000

`fit`

string

Optional

One of: `scale-down`, `contain`, `cover`, `crop`, `pad`

`fmt`

string

Optional

One of: `auto`, `webp`, `avif`, `jpg`, `png`

`q`

string

Optional

One of: `auto`, `60`, `75`, `85`

`dpr`

string

Optional

Device pixel ratio multiplier (1, 1.5, or 2; requires w/h).

`trim`

string

Optional

Auto-trim uniform outer borders.

One of: `border`, `auto`

`anim`

string

Optional

Set `false` to flatten animated GIF/WebP to the first frame.

One of: `false`, `true`

`metadata`

string

Optional

EXIF/copyright/C2PA metadata handling.

One of: `none`, `copyright`, `keep`

`segment`

string

Optional

One of: `foreground`

`background`

string

Optional

`gravity`

string

Optional

`zoom`

string

Optional

`blur`

string

Optional

`sharpen`

string

Optional

`rotate`

string

Optional

`flip`

string

Optional

One of: `h`, `v`, `hv`

`brightness`

string

Optional

`contrast`

string

Optional

`saturation`

string

Optional

`tile`

string

Optional

Public same-project raster image path to tile as a watermark.

`watermark`

string

Optional

Public same-project raster image path for a single positioned watermark.

`watermark_pos`

string

Optional

One of: `bottom-right`, `bottom-left`, `top-right`, `top-left`, `center`

`watermark_opacity`

string

Optional

Snapped to 0.25/0.5/0.75/1.

`watermark_width`

string

Optional

Target width in px (snapped up to 32..512).

`text`

string

Optional

Text overlay string.

min length 1 · max length 120

`text_color`

string

Optional

`text_size`

string

Optional

Font size in px (snapped to 16..128).

`text_pos`

string

Optional

One of: `bottom-right`, `bottom-left`, `top-right`, `top-left`, `center`

`text_opacity`

string

Optional

Snapped to 0.25/0.5/0.75/1.

### Responses

-   200
    
    Updated transform preset
    
-   201
    
    Created transform preset
    
-   400
    
    [`invalid_json`](/docs/errors/#invalid_json) or [`validation_error`](/docs/errors/#validation_error): invalid preset name or invalid/empty `params`.
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   403
    
    [`preset_management_forbidden`](/docs/errors/#preset_management_forbidden): publishable keys cannot manage transform presets. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   409
    
    [`preset_limit_reached`](/docs/errors/#preset_limit_reached): the project already has the maximum number of custom presets for its plan.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl -X PUT https://api.pixelvault.dev/v1/presets/avatar \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "size": "avatar",
    "w": 400,
    "h": 400,
    "fit": "cover",
    "fmt": "auto",
    "q": "85",
    "dpr": "2",
    "background": "white",
    "gravity": "face",
    "zoom": "0.7",
    "blur": "30",
    "sharpen": "1",
    "rotate": "90",
    "brightness": "1.25",
    "contrast": "1.25",
    "saturation": "0",
    "tile": "img_logo.png",
    "watermark": "img_logo.png",
    "watermark_pos": "bottom-right",
    "watermark_opacity": "0.75",
    "watermark_width": "128",
    "text": "SAMPLE",
    "text_color": "#ffffff",
    "text_size": "32",
    "text_pos": "bottom-right",
    "text_opacity": "0.75"
  }
}'
```

Response 201

```
{
  "data": {
    "name": "avatar",
    "params": {
      "size": "avatar",
      "w": 400,
      "h": 400,
      "fit": "cover",
      "fmt": "auto",
      "q": "85",
      "dpr": "2",
      "trim": "border",
      "anim": "false",
      "metadata": "none",
      "segment": "foreground",
      "background": "white",
      "gravity": "face",
      "zoom": "0.7",
      "blur": "30",
      "sharpen": "1",
      "rotate": "90",
      "flip": "h",
      "brightness": "1.25",
      "contrast": "1.25",
      "saturation": "0",
      "tile": "img_logo.png",
      "watermark": "img_logo.png",
      "watermark_pos": "bottom-right",
      "watermark_opacity": "0.75",
      "watermark_width": "128",
      "text": "SAMPLE",
      "text_color": "#ffffff",
      "text_size": "32",
      "text_pos": "bottom-right",
      "text_opacity": "0.75"
    },
    "created_at": "2026-11-17T09:30:00Z",
    "updated_at": "2026-11-17T09:30:00Z"
  },
  "meta": {
    "limit": 0
  }
}
```

## Delete a transform preset

DELETE `/v1/presets/{name}`

Removes a custom named preset from the active project and updates edge KV.

### Authentication

API key, or a dashboard session token, sent as `Authorization: Bearer <token>`.

### Path parameters

Path parameters

Name

Type

Required

Description

`name`

string

Required

Custom preset name (2–40 lowercase letters, digits, `-` or `_`; cannot shadow built-in presets `s`, `m`, `l`, `social`, `square`, `portrait`).

pattern ^\[a-z\]\[a-z0-9\_-\]{1,39}$

### Responses

-   200
    
    Deleted preset
    
-   401
    
    [`unauthorized`](/docs/errors/#unauthorized): no Bearer token, or the dashboard session is invalid or expired. [`invalid_api_key`](/docs/errors/#invalid_api_key): the API key is unknown or revoked.
    
-   403
    
    [`preset_management_forbidden`](/docs/errors/#preset_management_forbidden): publishable keys cannot manage transform presets. [`account_suspended`](/docs/errors/#account_suspended): the account is suspended.
    
-   404
    
    [`preset_not_found`](/docs/errors/#preset_not_found): no custom preset with this name exists in the project.
    
-   429
    
    [`rate_limit_exceeded`](/docs/errors/#rate_limit_exceeded): more than 60 requests per minute for this key (or dashboard session) or 300 per minute for the project. Honour `Retry-After`.
    

Request

curlNode.jsPython

```
curl -X DELETE https://api.pixelvault.dev/v1/presets/avatar \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY"
```

Response 200

```
{
  "data": {
    "deleted": true,
    "name": "avatar"
  }
}
```
