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.
| Aspect | Detail |
|---|---|
| Header | X-API-Key |
| Path | slug |
| Query | variant - 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
| Case | Cache-Control |
|---|---|
| Real SVG asset | public, max-age=86400 |
| Placeholder SVG | public, 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"
/>
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
| Variant | Description |
|---|---|
mono | Single-color mark; works on most backgrounds (default) |
color | Full-color brand artwork |
dark | Tuned for dark backgrounds |
light | Tuned for light backgrounds |
wordmark | Logo including wordmark |
icon | Icon-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.