Skip to main content

API Reference

Backend API documentation

Sketch to Screen API (1.0.0)

Download OpenAPI specification:Download

API documentation for the backend services handling sketch-to-HTML generation, component variations, and real-time collaboration.

API Connection Test

Simple test endpoint to verify frontend-backend connection.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Backend is connected!",
  • "method": "GET"
}

Generate Single Page Mockup

Uploads a single sketch image and converts it into HTML/CSS code.

Request Body schema: multipart/form-data
required
file
required
string <binary>

The sketch image file (PNG/JPG). Max size 10MB.

prompt
string

Optional text prompt to guide the generation.

Responses

Response samples

Content type
application/json
{
  • "html": "string"
}

Generate Multiple Mockups

Uploads multiple sketch images to generate multiple HTML pages in parallel. Note: Files must be indexed (file_0, file_1, etc.).

Request Body schema: multipart/form-data
required
count
required
integer [ 1 .. 20 ]

Total number of files being uploaded (1-20).

file_0
string <binary>

First file upload. Pattern: file_{i}

name_0
string

Name for the first page. Pattern: name_{i}

id=0
string

ID for the first page. Pattern: id={i}

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Generate Component Variations

Generates design variations for a specific HTML element/component.

Request Body schema: application/json
required
element_html
required
string

The HTML code of the component to modify.

element_type
string
Default: "component"

Type of element (e.g., 'button', 'card').

prompt
string

Custom instructions for the variation (e.g., 'Make it darker').

count
integer [ 1 .. 10 ]
Default: 3

Number of variations to generate.

Responses

Request samples

Content type
application/json
{
  • "element_html": "string",
  • "element_type": "component",
  • "prompt": "string",
  • "count": 3
}

Response samples

Content type
application/json
{
  • "variations": [
    ]
}

Real-time Collaboration WebSocket

Initiates a WebSocket connection for real-time collaboration on a specific sketch session. Connect using 'ws://' or 'wss://'.

path Parameters
collabID
required
string^\d+$

Unique numeric ID of the collaboration session

Responses