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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique name (1–64 chars, alphanumeric/hyphens/underscores) |
transforms | object | Yes | Transform parameters |
Transform parameters:
| Field | Type | Range | Description | |
|---|---|---|---|---|
width | integer | 1–8192 | Output width | |
height | integer | 1–8192 | Output height | |
fit | string | cover, contain, fill, scale-down, crop, pad | ||
format | string | webp, avif, jpeg, png, jxl, auto | ||
quality | integer | 1–100 | Output quality | |
qualityMode | string | high, medium, low | ||
dpr | integer | 1–3 | Device pixel ratio | |
blur | integer | 1–250 | Gaussian blur | |
sharpen | number | 0–10 | Unsharp mask | |
gravity | string | auto, face, center, top, bottom, left, right, corners | ||
radius | integer \ | "max" | 1–9999 | Corner radius |
grayscale | boolean | Convert to grayscale | ||
brightness | integer | -100–100 | Brightness adjustment | |
contrast | number | -100–100 | Contrast adjustment | |
saturation | integer | -100–100 | Saturation adjustment | |
sepia | boolean | Sepia tone | ||
bg | string | Background hex color (6 chars, no #) | ||
rotate | integer | 90, 180, 270 | ||
flip | string | h, 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}
| Field | Type | Description |
|---|---|---|
name | string | New name |
transforms | object | New 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" });