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/presetsAuthorization
Section titled “Authorization”| Requirement | Value |
|---|---|
| Header | Authorization: Bearer <token> |
| Scope | read_presets |
Example request
Section titled “Example request”curl https://api.prettycode.dev/v1/presets \ -H "Authorization: Bearer YOUR_TOKEN"Response
Section titled “Response”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 } } ]}Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
name | string | The preset’s name. |
style.theme | string | The color theme, such as dracula or github-light. |
style.font.family | string | The font, such as jetbrains-mono. |
style.font.size | integer | The font size in pixels. |
style.font.line_height | number | The line height, as a multiple of the font size. |
style.frame.kind | string | The window around the code: macos, windows, linux, browser, terminal or none. |
style.frame.corner_radius | integer | The window’s corner radius in pixels. |
style.frame.shadow | string | none, small, medium or large. |
style.frame.border | boolean | Whether the window has a border. |
style.background.kind | string | solid, gradient or transparent. |
style.background.colors | string[] | The background’s hex colors: one for solid, two for gradient, none for transparent. |
style.background.angle | integer | The gradient’s angle in degrees. |
style.padding | integer | The space around the window in pixels. |
A workspace with no presets answers {"data": []}.
Errors
Section titled “Errors”| Status | When |
|---|---|
401 Unauthorized | Missing or invalid token. |
403 Forbidden | The organization’s plan doesn’t qualify, or the token lacks the read_presets scope. |
429 Too Many Requests | Your organization sent too many requests this minute — wait the seconds in the Retry-After header. |