Skip to content

List style presets

Returns the style presets saved in your organization’s default workspace, sorted by name. Use a preset’s name as preset when you render a snippet.

GET /api/v1/presets
RequirementValue
HeaderAuthorization: Bearer <token>
Scoperead_presets
Terminal window
curl https://api.prettycode.dev/v1/presets \
-H "Authorization: Bearer YOUR_TOKEN"

200 OK

{
"data": [
{
"name": "Blog",
"style": {
"theme": "nord",
"font": {"family": "jetbrains-mono", "size": 14, "line_height": 1.5},
"frame": {"kind": "macos", "corner_radius": 12, "shadow": "medium", "border": true},
"background": {"kind": "gradient", "colors": ["#7f5af0", "#2cb67d"], "angle": 135},
"padding": 64
}
}
]
}
FieldTypeDescription
namestringThe preset’s name.
style.themestringThe color theme, such as dracula or github-light.
style.font.familystringThe font, such as jetbrains-mono.
style.font.sizeintegerThe font size in pixels.
style.font.line_heightnumberThe line height, as a multiple of the font size.
style.frame.kindstringThe window around the code: macos, windows, linux, browser, terminal or none.
style.frame.corner_radiusintegerThe window’s corner radius in pixels.
style.frame.shadowstringnone, small, medium or large.
style.frame.borderbooleanWhether the window has a border.
style.background.kindstringsolid, gradient or transparent.
style.background.colorsstring[]The background’s hex colors: one for solid, two for gradient, none for transparent.
style.background.angleintegerThe gradient’s angle in degrees.
style.paddingintegerThe space around the window in pixels.

A workspace with no presets answers {"data": []}.

StatusWhen
401 UnauthorizedMissing or invalid token.
403 ForbiddenThe organization’s plan doesn’t qualify, or the token lacks the read_presets scope.
429 Too Many RequestsYour organization sent too many requests this minute — wait the seconds in the Retry-After header.