Skip to main content

SVG

GET /v1/svg/{slug}

Returns raw SVG bytes for a catalog slug. The response body comes from stored SVG markup in service_svg_variants.svg_content (or the startup mono cache), not from a request-time CDN or filesystem lookup.

AspectDetail
HeaderX-API-Key
Pathslug
Queryvariant - see table below (default mono)

Response: Content-Type: image/svg+xml

Header: X-Svg-Variant - the variant actually served. When a placeholder is returned (requested variant missing but slug exists), this may be placeholder instead of the requested variant name.

Placeholder behavior

If the slug does not exist → 404 (service_not_found). If the slug exists but the requested variant is missing, Scrift first falls back to the stored mono variant. If no stored SVG is available for a known slug, it returns 200 with a branded placeholder SVG (not a 404).

Caching

CaseCache-Control
Real SVG assetpublic, max-age=86400
Placeholder SVGpublic, max-age=3600
curl "https://api.scrift.app/v1/svg/stripe?variant=mono" \
-H "X-API-Key: YOUR_API_KEY"

Use in HTML:

<img
src="https://api.scrift.app/v1/svg/stripe?variant=mono"
alt="Stripe"
width="48"
height="48"
/>
note

Embedding in img still triggers a normal HTTP GET; you must pass X-API-Key only where your client supports custom headers (or use a server-side proxy). Many browsers omit custom headers on <img> - prefer server-side fetch or your backend as a cache when keys must stay private.

Variants

VariantDescription
monoSingle-color mark; works on most backgrounds (default)
colorFull-color brand artwork
darkTuned for dark backgrounds
lightTuned for light backgrounds
wordmarkLogo including wordmark
iconIcon-only mark

Variant availability is per brand. For example, an enriched catalog row may have color, icon, mono, and wordmark, while another row may only have mono. Use the catalog/brand metadata or test the endpoint to discover what is actually available for a slug.

Interactive details: API reference.