What response will I get from the API?

2 min read
API & Integration

Understanding API responses helps you handle them correctly in your code.

Successful Response (200 OK)

json
{ "success": true, "imageUrl": "https://cdn.canvelete.com/renders/abc123def456.png", "renderTime": 234, "format": "png", "width": 1080, "height": 1080 }
FieldDescription
successAlways true for successful renders
imageUrlDirect URL to your generated image
renderTimeHow long the render took (milliseconds)
formatThe output format you requested
width / heightDimensions of the generated image

Error Response (4xx/5xx)

json
{ "success": false, "error": { "code": "INVALID_DESIGN_ID", "message": "The specified design was not found" } }

Common Error Codes

CodeMeaningSolution
INVALID_API_KEYAPI key is wrong or revokedCheck your key in Dashboard
INVALID_DESIGN_IDDesign doesn't existVerify the design ID
RATE_LIMIT_EXCEEDEDToo many requestsWait and retry, or upgrade plan
INSUFFICIENT_CREDITSOut of render creditsAdd credits or upgrade
INVALID_ELEMENTElement name doesn't existCheck layer names in editor

Handling Responses in Code

javascript
const response = await fetch(url, options); const data = await response.json(); if (data.success) { console.log("Image URL:", data.imageUrl); } else { console.error("Error:", data.error.message); }

Was this article helpful?

Need more help? Contact support