V1 / Render

Render pattern (POST JSON)

Generate a pattern PNG from a JSON body. Same parameters as GET /api/v1/render query string. Response is raw image/png bytes.

POST/api/v1/render

Request body

PropertyTypeRequiredDescription
patternstringYesPattern path: `{patternKey}-{variantKey}` (e.g. dots-base)
modestringNoUse render-only for PNG binary response
widthnumberNo
heightnumberNo
cacheunknownNoSet false to bypass server memory cache for this request

Responses

200

image/png

400

Invalid body

402

Width or height exceeds the max export size for the current plan (free: 1000×1000 px)

Request
curl -X POST "https://pattx.com/api/v1/render" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{"pattern":"string","mode":"string","width":0,"height":0,"cache":null}'
Response
// Binary image (image/png, image/svg+xml, or image/webp)
// Or data URL for inline format