API Reference
Designs API

Designs API

Create, read, update, and delete designs programmatically via the Canvelete (opens in a new tab) API.

Base URL

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

List Designs

GET /designs

Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20, max: 100)
statusstringFilter by status: DRAFT, PUBLISHED
searchstringSearch by name

Example

curl -X GET "https://api.canvelete.com/v1/designs?page=1&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": [
    {
      "id": "design_abc123",
      "name": "Social Media Post",
      "width": 1080,
      "height": 1080,
      "status": "PUBLISHED",
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-15T12:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  }
}

Get Design

GET /designs/{designId}

Example

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

Response

{
  "success": true,
  "data": {
    "id": "design_abc123",
    "name": "Social Media Post",
    "width": 1080,
    "height": 1080,
    "status": "PUBLISHED",
    "canvasData": {
      "elements": [
        {
          "id": "elem_1",
          "type": "text",
          "text": "{{headline}}",
          "x": 100,
          "y": 100,
          "fontSize": 48
        }
      ]
    },
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T12:30:00Z"
  }
}

Create Design

POST /designs

Body

{
  "name": "My Design",
  "width": 1920,
  "height": 1080,
  "canvasData": {
    "elements": [
      {
        "type": "text",
        "text": "{{title}}",
        "x": 100,
        "y": 100,
        "fontSize": 48,
        "fill": "#000000"
      },
      {
        "type": "rectangle",
        "x": 0,
        "y": 0,
        "width": 1920,
        "height": 1080,
        "fill": "#ffffff"
      }
    ]
  }
}

Example

curl -X POST "https://api.canvelete.com/v1/designs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Design",
    "width": 1920,
    "height": 1080,
    "canvasData": {
      "elements": []
    }
  }'

Response

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

Update Design

PATCH /designs/{designId}

Body

{
  "name": "Updated Name",
  "status": "PUBLISHED",
  "canvasData": {
    "elements": [...]
  }
}

Example

curl -X PATCH "https://api.canvelete.com/v1/designs/design_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Design Name"
  }'

Delete Design

DELETE /designs/{designId}

Example

curl -X DELETE "https://api.canvelete.com/v1/designs/design_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "deleted": true
  }
}

Duplicate Design

POST /designs/{designId}/duplicate

Body

{
  "name": "Copy of Design"
}

Example

curl -X POST "https://api.canvelete.com/v1/designs/design_abc123/duplicate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Copy of My Design"
  }'

Element Types

Supported element types in canvasData.elements:

TypeDescription
rectangleRectangular shape
circleCircle/ellipse
textText element
imageImage from URL
lineStraight line
polygonMulti-sided shape
starStar shape
svgSVG graphic
qrQR code
barcodeBarcode
tableData table

Element Properties

Common properties for all elements:

{
  "type": "text",
  "x": 100,
  "y": 100,
  "width": 400,
  "height": 100,
  "rotation": 0,
  "opacity": 1,
  "fill": "#000000",
  "stroke": "#000000",
  "strokeWidth": 0
}

Text Element

{
  "type": "text",
  "text": "{{variable}}",
  "x": 100,
  "y": 100,
  "fontSize": 48,
  "fontFamily": "Inter",
  "fontWeight": "bold",
  "fill": "#000000",
  "textAlign": "center"
}

Image Element

{
  "type": "image",
  "src": "{{imageUrl}}",
  "x": 100,
  "y": 100,
  "width": 400,
  "height": 300,
  "objectFit": "cover"
}

SDK Examples

Python

from canvelete import CanveleteClient
 
client = CanveleteClient(api_key="YOUR_API_KEY")
 
# List
designs = client.designs.list(page=1, limit=20)
 
# Create
design = client.designs.create(
    name="My Design",
    width=1920,
    height=1080
)
 
# Update
client.designs.update("design_123", name="New Name")
 
# Delete
client.designs.delete("design_123")

TypeScript

import { CanveleteClient } from '@canveletedotcom/sdk';
 
const client = new CanveleteClient({ apiKey: 'YOUR_API_KEY' });
 
// List
const designs = await client.designs.list({ page: 1, limit: 20 });
 
// Create
const design = await client.designs.create({
  name: 'My Design',
  width: 1920,
  height: 1080
});
 
// Update
await client.designs.update('design_123', { name: 'New Name' });
 
// Delete
await client.designs.delete('design_123');

Next Steps