API Reference
Welcome to the EzyRender API. We've designed our API to be straightforward and powerful, letting you generate professional visuals programmatically in seconds.
Introduction
The EzyRender API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses (or binary images), and uses standard HTTP response codes.
Base URL: https://ezyrender.com/api
Authentication
Authenticate your requests using your API Token. You can create and manage tokens in your Dashboard.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authorization: Bearer ezr_YOUR_API_TOKEN
Render Image
This is the main endpoint you'll use. It takes a project (template) ID and a set of modifications, renders the graphic in a headless browser, and returns the result (either as a URL or binary file).
Parameters
| Argument | Type | Description |
|---|---|---|
projectId * |
String | The UUID of the project template to render. Found in your Dashboard or via the Projects endpoint. |
modifications |
Object | A dictionary of changes to apply to the template. Keys match the data-key of elements. See Guide. |
format |
String | Output format. Options: png (default), jpeg, pdf. |
output |
String |
• url (Recommended): Uploads the render to our CDN and returns a public URL.• base64 (Default): Returns the image data as a base64 string inside the JSON.• Omitted + Accept: image/png: Returns raw binary stream.
|
width |
Number | Override the output width (height scales automatically unless specified). |
height |
Number | Override the output height. |
Example Request
curl -X POST https://ezyrender.com/api/render \
-H "Authorization: Bearer ezr_token_..." \
-H "Content-Type: application/json" \
-d '{
"projectId": "d3333c77-...",
"output": "url",
"format": "png",
"modifications": {
"heading_1": "Summer Sale",
"main_image": "https://example.com/photo.jpg",
"promo_box": { "backgroundColor": "#ff5500" }
}
}'
Response (output="url")
{
"url": "https://ezyrender-templates.nyc3.digitaloceanspaces.com/renders/uuid.png",
"projectId": "d3333c77-...",
"format": "png"
}
List Projects
Retrieve a list of your existing projects to get their IDs and names.
curl https://ezyrender.com/api/projects -H "Authorization: Bearer ezr_..."
Modifications Guide
The power of EzyRender lies in the modifications object. You can dynamically change
elements on your canvas by referencing their Data Key.
You set these keys in the Editor sidebar.
1. Changing Text
Simply provide the new text string.
"my_title": "Hello World"
2. Changing Images
Provide a publicly accessible URL for the new image.
"hero_bg": "https://mysite.com/images/banner.jpg"
3. Changing Styles (CSS)
Pass an object with CSS properties (camelCase) to change styles dynamically.
"cta_button": {
"backgroundColor": "#000000",
"color": "#ffffff",
"fontSize": "24px"
}
Errors
EzyRender uses conventional HTTP response codes to indicate the success or failure of an API request.
200 |
OK - Everything worked nicely. |
400 |
Bad Request - Missing parameters or invalid JSON. |
401 |
Unauthorized - Valid API token required. |
429 |
Too Many Requests - You hit the rate limit. |
500 |
Server Errors - Something went wrong on our end. |