API Reference
Templates API

Templates API

Browse and use design templates via the Canvelete (opens in a new tab) API.

Base URL

https://api.canvelete.com/v1/templates

List Templates

GET /templates

Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20, max: 100)
categorystringFilter by category
searchstringSearch by name

Example

curl -X GET "https://api.canvelete.com/v1/templates?category=social-media" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": [
    {
      "id": "template_abc123",
      "name": "Instagram Post",
      "category": "social-media",
      "width": 1080,
      "height": 1080,
      "thumbnail": "https://cdn.canvelete.com/thumbnails/abc123.png",
      "variables": ["headline", "subtext", "image"]
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150
  }
}

Get Template

GET /templates/{templateId}

Example

curl -X GET "https://api.canvelete.com/v1/templates/template_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "id": "template_abc123",
    "name": "Instagram Post",
    "description": "Modern social media post template",
    "category": "social-media",
    "width": 1080,
    "height": 1080,
    "thumbnail": "https://cdn.canvelete.com/thumbnails/abc123.png",
    "variables": [
      {
        "name": "headline",
        "type": "text",
        "default": "Your Headline Here"
      },
      {
        "name": "image",
        "type": "image",
        "default": null
      }
    ],
    "canvasData": { ... }
  }
}

Create Design from Template

POST /templates/{templateId}/use

Body

{
  "name": "My Design from Template",
  "dynamicData": {
    "headline": "Welcome!",
    "image": "https://example.com/photo.jpg"
  }
}

Example

curl -X POST "https://api.canvelete.com/v1/templates/template_abc123/use" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Instagram Post",
    "dynamicData": {
      "headline": "New Product Launch!"
    }
  }'

Response

{
  "success": true,
  "data": {
    "id": "design_xyz789",
    "name": "My Instagram Post",
    "width": 1080,
    "height": 1080,
    "status": "DRAFT",
    "createdAt": "2024-01-15T14:00:00Z"
  }
}

Render Template Directly

Render a template without creating a design first:

POST /render/template/{templateId}

Body

{
  "format": "png",
  "quality": 90,
  "dynamicData": {
    "headline": "Hello World",
    "image": "https://example.com/photo.jpg"
  }
}

Example

curl -X POST "https://api.canvelete.com/v1/render/template/template_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "png",
    "dynamicData": {
      "headline": "Welcome!"
    }
  }'

Template Categories

Common template categories:

CategoryDescription
social-mediaInstagram, Facebook, Twitter posts
certificatesAwards, diplomas, achievements
marketingFlyers, banners, ads
businessBusiness cards, letterheads
presentationsSlides, decks
documentsInvoices, reports

SDK Examples

Python

from canvelete import CanveleteClient
 
client = CanveleteClient(api_key="YOUR_API_KEY")
 
# List templates
templates = client.templates.list(category="social-media")
 
# Get template
template = client.templates.get("template_123")
 
# Create design from template
design = client.templates.use(
    "template_123",
    name="My Design",
    dynamic_data={"headline": "Hello!"}
)
 
# Render template directly
result = client.render.create(
    template_id="template_123",
    format="png",
    dynamic_data={"headline": "Hello!"},
    output_file="output.png"
)

TypeScript

import { CanveleteClient } from '@canveletedotcom/sdk';
 
const client = new CanveleteClient({ apiKey: 'YOUR_API_KEY' });
 
// List templates
const templates = await client.templates.list({ category: 'social-media' });
 
// Create design from template
const design = await client.templates.use('template_123', {
  name: 'My Design',
  dynamicData: { headline: 'Hello!' }
});
 
// Render template directly
const result = await client.render.create({
  templateId: 'template_123',
  format: 'png',
  dynamicData: { headline: 'Hello!' }
});

Browse Templates

Explore the full template gallery at canvelete.com/templates (opens in a new tab).

Next Steps