Named transform presets for reusable image configurations.

Presets

Presets are named transform configurations. Use them in CDN URLs with ?t=preset-name instead of specifying individual parameters.

List presets

GET /images/projects/{projectId}/presets
curl -H "Authorization: Bearer spronta_img_..." \
  https://app.spronta.com/api/images/projects/123e4567-.../presets

Response 200

[
  {
    "id": "abc12345-...",
    "name": "thumbnail",
    "transforms": {
      "width": 200,
      "height": 200,
      "fit": "cover",
      "gravity": "face",
      "format": "webp",
      "quality": 80
    },
    "createdAt": "2026-03-20T10:00:00.000Z"
  }
]

Create a preset

POST /images/projects/{projectId}/presets
FieldTypeRequiredDescription
namestringYesUnique name (1–64 chars, alphanumeric/hyphens/underscores)
transformsobjectYesTransform parameters

Transform parameters:

FieldTypeRangeDescription
widthinteger1–8192Output width
heightinteger1–8192Output height
fitstringcover, contain, fill, scale-down, crop, pad
formatstringwebp, avif, jpeg, png, jxl, auto
qualityinteger1–100Output quality
qualityModestringhigh, medium, low
dprinteger1–3Device pixel ratio
blurinteger1–250Gaussian blur
sharpennumber0–10Unsharp mask
gravitystringauto, face, center, top, bottom, left, right, corners
radiusinteger \"max"1–9999Corner radius
grayscalebooleanConvert to grayscale
brightnessinteger-100–100Brightness adjustment
contrastnumber-100–100Contrast adjustment
saturationinteger-100–100Saturation adjustment
sepiabooleanSepia tone
bgstringBackground hex color (6 chars, no #)
rotateinteger90, 180, 270
flipstringh, v
curl -X POST \
  -H "Authorization: Bearer spronta_img_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "thumbnail",
    "transforms": {
      "width": 200,
      "height": 200,
      "fit": "cover",
      "gravity": "face",
      "format": "webp",
      "quality": 80
    }
  }' \
  https://app.spronta.com/api/images/projects/123e4567-.../presets

Response 201 — Returns the created preset.

Error 409 — Preset name already exists.

Get a preset

GET /images/projects/{projectId}/presets/{presetId}

Response 200 — Returns the preset.

Update a preset

PATCH /images/projects/{projectId}/presets/{presetId}
FieldTypeDescription
namestringNew name
transformsobjectNew transforms (replaces existing)

Response 200 — Returns the updated preset.

Delete a preset

DELETE /images/projects/{projectId}/presets/{presetId}

Response 200

{ "deleted": true }

Using presets in CDN URLs

Once created, use a preset by name in any CDN URL:

https://cdn.spronta.com/my-project/hero.jpg?t=thumbnail

Or in the SDK:

spronta.url("hero.jpg", { preset: "thumbnail" });