Templates

Templates define the layout, typography, and placeholders for your images. Each template has a typed schema that validates incoming fields.

Creating a template

Use the API to create a new template with a name, slug, dimensions, and a schema:

POST /v1/templates
curl -X POST https://api.imageclaw.dev/v1/templates \
-H "Authorization: Bearer $IMGCLAW_API_KEY" \
-d '{
"name": "My Blog Card",
"slug": "blog-card-v1",
"width": 1200,
"height": 630,
"schema": {
"title": { "type": "string", "required": true },
"author": { "type": "string", "required": false }
}
}'

Using a template

Reference a template by its slug when rendering. The API validates your fields against the template schema.

POST /v1/images
curl -X POST https://api.imageclaw.dev/v1/images \
-H "Authorization: Bearer $IMGCLAW_API_KEY" \
-d '{
"template": "blog-card-v1",
"title": "How the algorithm ranks posts",
"author": "Jane Doe",
"size": "1200x630"
}'

Template library

Browse the full template library on the Templates page. Each template shows its slug, dimensions, and available fields.