DocsAPI ReferenceOverview

API Reference

The copyto.design API allows you to integrate HTML to Figma conversion into your applications and workflows.

Overview

Our REST API provides programmatic access to all conversion features available in the web playground, plus additional capabilities for production use.

Base URL

All API requests should be made to:

https://api.copyto.design/v1

API Version

The current API version is v1. We maintain backward compatibility and will announce any breaking changes well in advance.

Get Started

Generate Your API Key

To start using the API, you’ll need an API key. Create and manage your keys in the dashboard.

Manage API Keys →

Key Features

RESTful Design

Standard HTTP methods and response codes make integration straightforward:

  • POST - Create conversion jobs

JSON API

All requests and responses use JSON format:

Content-Type: application/json

Rate Limiting

API requests are rate-limited based on your plan:

  • Free: 100 requests/day
  • Pro: 10,000 requests/day
  • Enterprise: Custom limits

Rate limit information is included in response headers:

X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9995
X-RateLimit-Reset: 1640995200

Quick Start Example

Here’s a simple example to convert HTML to Figma:

const response = await fetch('https://api.copyto.design/v1/convert', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    html: '<div style="padding: 20px;"><h1>Hello Figma</h1></div>',
    format: 'figma'
  })
});
 
const data = await response.json();
console.log(data.figmaUrl); // URL to paste in Figma

Response Format

Success Response

{
  "success": true,
  "data": {
    "id": "conv_abc123",
    "figmaUrl": "https://...",
    "downloadUrl": "https://...",
    "metadata": {
      "nodes": 5,
      "processingTime": 234
    }
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "INVALID_HTML",
    "message": "The provided HTML is not valid",
    "details": {}
  }
}

Error Codes

Common error codes you may encounter:

CodeDescription
INVALID_HTMLThe HTML provided is malformed
INVALID_URLThe URL provided is not accessible
RATE_LIMIT_EXCEEDEDToo many requests
UNAUTHORIZEDInvalid or missing API key
CONVERSION_FAILEDConversion process failed
FILE_TOO_LARGEInput exceeds size limits

SDKs and Libraries

We provide official SDKs for popular languages:

JavaScript/TypeScript

npm install @copyto-design/sdk
import { CopyToDesign } from '@copyto-design/sdk';
 
const client = new CopyToDesign('YOUR_API_KEY');
const result = await client.convert({ html: '<div>...</div>' });

cURL

curl -X POST https://api.copyto.design/v1/convert \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"html": "<div>Hello</div>", "format": "figma"}'

Security

  • Never expose API keys in client-side code
  • Use environment variables for credentials
  • Rotate API keys regularly
  • Monitor API usage for anomalies

Support

For API support:

Next Steps


© 2025 $copyto.design. Transform any design to Figma.