Generate Canva Designs Programmatically with the Design API
Render Canva templates to PDF or PNG from server-side code using asynchronous API jobs and signed output URLs.
26 Aug 2026, 18:29 UTC

Useful answer
Canva's Design API lets server-side code render an existing Canva template into a downloadable PDF or image without a person opening the Canva editor. Your application sends a template ID and output preferences, receives a design identifier, waits for asynchronous processing to finish, then downloads the generated asset. This is useful for batch-producing branded social graphics, certificates, or PDFs from a single master template.
How the request works
Authentication uses a Bearer token, either an API key or an OAuth access token. The client sends a POST request to the designs endpoint with a JSON body containing at least template_id and an outputs array. Each output entry specifies a format such as pdf, png, or jpg, plus optional quality and page selection. Canva returns a design ID and a status. Processing runs asynchronously, so the initial response does not contain the final file. Your code must poll the design status endpoint until the status is ready, then read the output URL and download the file.
Template access is scoped to the authenticated user or team. A template visible in a personal Canva account may not be available in a team API context unless it has been shared or the correct brand kit permissions are in place.
Worked configuration
Run the following from a trusted server or CI job, never from a browser or mobile app. Replace the placeholders with values from your Canva Developer Portal app. The base URL and paths below are illustrative; confirm the exact endpoints in the current documentation.
CANVA_API_KEY="canva_live_..."
TEMPLATE_ID="DExxxxxxxx"
BASE_URL="https://api.canva.com/rest/v1"
curl -i -X POST "$BASE_URL/designs" \
-H "Authorization: Bearer $CANVA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template_id": "'"$TEMPLATE_ID"'",
"outputs": [
{
"format": "pdf",
"quality": "high",
"pages": "all"
}
]
}'
Expected checks: the API should return a 2xx response with a JSON body that includes a design ID. A 401 response means the key is invalid or lacks the required scope. A 404 response means the template ID is wrong or not accessible to the authenticated account. Record the design ID; you need it for polling.
Poll until ready. This Bash loop sleeps between attempts and stops when the status field is ready or failed:
DESIGN_ID="d-xxxxxxxx"
BASE_URL="https://api.canva.com/rest/v1"
while true; do
RESPONSE=$(curl -s "$BASE_URL/designs/$DESIGN_ID" \
-H "Authorization: Bearer $CANVA_API_KEY")
STATUS=$(echo "$RESPONSE" | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
echo "Status: $STATUS"
if [ "$STATUS" = "ready" ] || [ "$STATUS" = "failed" ]; then
break
fi
sleep 5
done
When the status is ready, extract the output URL from the response and download it:
OUTPUT_URL=$(echo "$RESPONSE" | grep -o '"url":"[^"]*"' | cut -d'"' -f4)
curl -L -o branded-design.pdf "$OUTPUT_URL"
Risks: do not download immediately after creation. The output URL may be absent or return an error while Canva is still rendering. Output URLs are often temporary or signed; copy the file into your own storage instead of hotlinking. Never embed CANVA_API_KEY in frontend JavaScript or a mobile binary; keep it in a backend service and expose only a controlled proxy or signing endpoint to clients.
Limits and common mistakes
- Treating creation as synchronous. Attempting to download right after the POST usually returns a missing URL or a not-ready status. Implement retry with backoff and respect
Retry-Afterheaders if present. - Wrong template context. Confirm the template is accessible to the API token's user or team before running production batches.
- Unsupported formats or page ranges. Not every template supports PDF, PNG, JPG, or arbitrary page selections. Validate with a single test design before scaling.
- Rate limits. Bursts can trigger throttling. Queue requests and handle 429 responses.
- Key exposure. Rotate the key immediately if it appears in version control or logs.
Verification
- Register an app in the Canva Developer Portal and create an API key.
- Confirm the exact base URL, endpoint paths, and required scopes in the current documentation.
- Send a POST request with a known template ID and one output format.
- Capture the returned design ID, poll the status endpoint until
ready, then download the output URL. - Open the downloaded file and confirm the format, page count, and branding. Check the Canva dashboard to confirm the design was created under the correct team.
Cleanup
Creating a design writes to your Canva account. If a test design was created by mistake, remove it manually from the Canva dashboard. Treat the creation as a state-changing operation; there is no universal undo for API-generated designs.