Dockyfy API Documentation
Generate images and PDFs programmatically from your templates. Integrate Dockyfy into any application with our simple REST API.
Overview
Dockyfy is a template-based image and PDF generation platform. You design templates once in our visual drag-and-drop editor, then call the API with your JSON data to generate thousands of unique, branded assets programmatically.
Each template contains canvas objects (text, images, shapes) with named variable slots. When you call the API, you pass override values for those variables — the engine renders a pixel-perfect asset in milliseconds.
Generate unique certificates for every learner automatically.
Auto-generate branded promo images for products or events.
Dynamic invoice or report PDF generation from your data.
QR-coded labels, price tags, and packaging artwork at scale.
https://api.dockyfy.comAll requests and responses use application/json unless otherwise noted.
Authentication
Dockyfy supports two authentication methods depending on your use case.
API Key (Recommended for integrations)
Use your dk_-prefixed API key in the
X-Api-Key header. Keys are created in
your dashboard under API Keys and shown only once
at creation time — store them securely.
X-Api-Key: dk_live_xxxxxxxxxxxxxxxxBearer JWT (Dashboard / OAuth flows)
For browser-based or OAuth flows, use the JWT token returned from
POST /api/auth/login.
This method is used automatically by the Dockyfy dashboard.
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...Encrypted Payload Envelope (API Key routes only)
All requests and responses on X-Api-Key
endpoints use AES-256-GCM encryption. Your raw JSON body must be encrypted
and wrapped in this envelope:
{
"v": 1,
"uid": "your-user-uuid",
"iv": "base64-encoded-12-byte-nonce",
"tag": "base64-encoded-16-byte-auth-tag",
"data": "base64-encoded-ciphertext"
}The encryption key is derived from your user ID and API key secret using HKDF-SHA256 — it is never stored. Official SDK helpers handle encryption automatically. See our SDK for implementation details.
Quick Start
Generate your first image in under 2 minutes.
Create an Account & Get an API Key
Sign up for free →
go to API Keys in the sidebar →
click Create New Key. Copy the dk_
key shown. You start with 50 free credits — no card required.
Design & Publish a Template
Go to Templates → Create New. Use the visual editor
to design your canvas. Click any text or image object and set a
Variable Name in the Properties panel
(e.g. name,
date). Click
Publish and copy the template ID from the URL.
Call the Generate Endpoint
Send your data as overrides. Each call costs 1 credit and returns an output URL for the generated asset.
curl -X POST https://api.dockyfy.com/api/templates/{templateId}/generate \
-H "X-Api-Key: dk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"format": "png",
"overrides": [
{ "variableKey": "name", "text": "Jane Smith" },
{ "variableKey": "date", "text": "March 29, 2026" }
]
}'Response — 200 OK
{
"generationId": "550e8400-e29b-41d4-a716-446655440000",
"outputUrl": "https://cdn.dockyfy.com/gen/2026/03/abc123.png",
"format": "png",
"templateId": "your-template-id",
"creditsUsed": 1,
"createdAt": "2026-03-29T12:00:00Z"
}Templates
Templates define the visual layout. Create and publish them in the Dockyfy editor, then reference them by ID in API calls.
/api/templates
List all your templatesReturns a paginated list of your templates. Requires JWT Bearer.
Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
page | int | 1 | Page number (1-based) |
pageSize | int | 20 | Results per page (max 100) |
search | string | — | Filter by name or tag |
status | string | — | Draft or Published |
purpose | string | — | Filter by template purpose/type |
/api/templates/{id}
Get a single template by IDReturns full template details including variable schema and canvas JSON.
/api/templates/{id}/preview
Generate a watermarked previewRenders a watermarked preview image. Requires JWT Bearer. Does not deduct credits. Use for playground and testing.
/api/templates
Create a new template (programmatic)Creates a new empty draft template via API. Requires JWT Bearer.
Generate
The core production endpoint. Call it with a published template ID and your override data to receive a generated image or PDF URL.
/api/templates/{templateId}/generate
Generate an image or PDF — 1 creditRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
format | string | Yes | png, jpg, or pdf |
overrides | array | No | Array of variable override objects (see Variables Guide) |
overrides[].variableKey | string | Yes | Variable name assigned in the editor |
overrides[].text | string | No | New text content for text objects |
overrides[].fill | string | No | CSS color value e.g. #ff0000 |
overrides[].src | string | No | Image URL for image/background objects |
overrides[].fontSize | number | No | Font size in pixels |
overrides[].fontFamily | string | No | Font family name (must be web-safe or loaded) |
overrides[].opacity | number | No | Object opacity 0–1 |
Bulk Generation
Submit a JSON array of rows to generate hundreds of images or PDFs in a single API call. The job runs asynchronously — poll for status or use Webhooks to be notified on completion.
GET /api/billing/credits/balance.
/api/bulk-jobs
Submit a bulk job — returns 202 AcceptedRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
templateId | string (UUID) | Yes | Published template to generate from |
format | string | Yes | png, jpg, or pdf |
rowsJson | string | Yes | JSON-encoded array of override sets, one object per output file |
[
{ "name": "Alice Johnson", "date": "March 29, 2026", "score": "92%" },
{ "name": "Bob Williams", "date": "March 29, 2026", "score": "87%" },
{ "name": "Carol Martinez", "date": "March 29, 2026", "score": "95%" }
]/api/bulk-jobs
List your bulk jobs/api/bulk-jobs/{id}
Get bulk job status, progress, and item results/api/bulk-jobs/{id}
Cancel a pending or running bulk jobAPI Keys
Manage your dk_-prefixed API keys programmatically.
A raw key is shown only once on creation — Dockyfy stores only a SHA-256 hash.
/api/api-keys
List your keys (prefix + metadata only)/api/api-keys
Create a new API key — returns raw key once — 201Request Body
| Field | Type | Description |
|---|---|---|
name | string | Friendly label for the key (e.g. "Production App") |
scopes | string[] | Requested permission scopes e.g. ["generate", "templates.read"] |
/api/api-keys/{id}/revoke
Revoke an API key permanently — 204Webhooks
Receive real-time HTTP POST notifications when generation jobs complete, credits run low, or bulk jobs finish. Dockyfy delivers to your HTTPS endpoint with 3 automatic retry attempts on failure.
Available Events
| Event | Trigger |
|---|---|
generation.completed | Single image/PDF generated successfully |
generation.failed | Generation rendering failed |
bulk_job.completed | Bulk job finished (all items processed) |
credit.exhausted | Credit balance dropped to zero |
HMAC Signature Verification
Every webhook delivery includes an
X-Dockyfy-Signature header.
Always verify this before processing the payload to ensure requests are authentic.
const crypto = require('crypto');
function verifyWebhook(rawBody, signatureHeader, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(rawBody, 'utf8')
.digest('hex');
// Constant-time comparison to prevent timing attacks
return crypto.timingSafeEqual(
Buffer.from(`sha256=${expected}`),
Buffer.from(signatureHeader)
);
}Webhook Endpoints
/api/webhooks
List your registered webhooks/api/webhooks
Register a new webhook endpoint/api/webhooks/{id}
Update a webhook (URL, events, active state)/api/webhooks/{id}/test
Send a test delivery to your endpoint/api/webhooks/{id}
Delete a webhookCredits & Billing
Every generation costs 1 credit. Credits are included in your plan and can be purchased as add-on packs at any time. Free accounts start with 50 credits.
/api/billing/credits/balance
Get current credit balance and expiry info/api/billing/subscription
Get active subscription, plan name, and limits/api/billing/plans
List all available plans and their credit allocations/api/billing/credits/purchase
Purchase additional credit packsVariables Guide
Variables let you inject dynamic content into templates at generation time. You define variable names in the template editor, then pass override values via the API.
How to Define Variables
- Open the template editor and click any text, image, or shape object.
- In the Properties panel, set a Variable Name (e.g.
recipient_name). - The object's default content is used when no override is provided.
- When calling the API, pass the variable name in
overrides[].variableKey.
Override Properties by Object Type
| Object Type | Primary Override | Additional Overrides |
|---|---|---|
| Text | text |
fill, fontSize, fontFamily, fontWeight, fontStyle, textAlign, opacity |
| Image | src (URL) |
opacity |
| Rectangle / Shape | fill |
stroke, strokeWidth, opacity |
| Background | fill |
— |
| Any object | — | opacity, angle (rotation), backgroundColor |
Example Override Array
[
{ "variableKey": "recipient_name", "text": "Jane Smith" },
{ "variableKey": "issue_date", "text": "March 29, 2026" },
{ "variableKey": "badge_color", "fill": "#6366f1" },
{ "variableKey": "profile_photo", "src": "https://cdn.example.com/jane.jpg" },
{ "variableKey": "score_text", "text": "92%", "fontSize": 48, "fill": "#22c55e" }
]variableKey is not found on the
canvas, it is silently ignored. Template default values are used for any
variable not present in the overrides array.
Error Codes
All error responses return a structured JSON body:
{
"type": "https://tools.ietf.org/html/rfc9110",
"title": "Not Found",
"status": 404,
"detail": "Template '550e8400-e29b-...' not found or not published.",
"traceId": "00-abc123def456..."
}Validation errors (400) include a field-level errors map:
{
"status": 400,
"title": "One or more validation errors occurred.",
"errors": {
"format": [ "'format' must be one of: png, jpg, pdf" ],
"templateId": [ "'templateId' must not be empty." ]
}
}| HTTP Status | Meaning | Common Cause |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created (API key, webhook, template) |
| 202 | Accepted | Bulk job submitted, processing asynchronously |
| 400 | Bad Request | Validation error — see field-level errors in response |
| 401 | Unauthorized | Missing or invalid API key / JWT token |
| 402 | Payment Required | Insufficient credits — purchase more or upgrade plan |
| 403 | Forbidden | Valid auth but missing required permission |
| 404 | Not Found | Template, resource, or API key ID does not exist |
| 409 | Conflict | Duplicate resource (e.g. key name already used) |
| 500 | Server Error | Internal error — retry; contact support if it persists |
Code Examples
Full working examples for common use cases across popular languages and platforms.
Login + List Templates + Generate
// Node.js 18+ (built-in fetch)
const BASE = 'https://api.dockyfy.com';
const API_KEY = 'dk_live_your_api_key';
// List templates (JWT)
async function listTemplates(accessToken) {
const res = await fetch(`${BASE}/api/templates`, {
headers: { 'Authorization': `Bearer ${accessToken}` }
});
return res.json();
}
// Generate image (API key)
async function generate(templateId, overrides) {
const res = await fetch(`${BASE}/api/templates/${templateId}/generate`, {
method: 'POST',
headers: { 'X-Api-Key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ format: 'png', overrides })
});
if (!res.ok) throw new Error(`Generate failed: ${res.status}`);
return res.json();
}
// Submit bulk job (JWT)
async function submitBulk(accessToken, templateId, rows) {
const res = await fetch(`${BASE}/api/bulk-jobs`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ templateId, format: 'png', rowsJson: JSON.stringify(rows) })
});
return res.json(); // { jobId, status: 'Queued' }
}Ready to start building?
Create a free account and get 50 credits instantly — no credit card required.
Dockyfy API Documentation
Generate images and PDFs programmatically from your templates. Integrate Dockyfy into any application with our simple REST API.
Overview
Dockyfy is a template-based image and PDF generation platform. You design templates once in our visual drag-and-drop editor, then call the API with your JSON data to generate thousands of unique, branded assets programmatically.
Each template contains canvas objects (text, images, shapes) with named variable slots. When you call the API, you pass override values for those variables — the engine renders a pixel-perfect asset in milliseconds.
Generate unique certificates for every learner automatically.
Auto-generate branded promo images for products or events.
Dynamic invoice or report PDF generation from your data.
QR-coded labels, price tags, and packaging artwork at scale.
https://api.dockyfy.comAll requests and responses use application/json unless otherwise noted.
Authentication
Dockyfy supports two authentication methods depending on your use case.
API Key (Recommended for integrations)
Use your dk_-prefixed API key in the
X-Api-Key header. Keys are created in
your dashboard under API Keys and shown only once
at creation time — store them securely.
X-Api-Key: dk_live_xxxxxxxxxxxxxxxxBearer JWT (Dashboard / OAuth flows)
For browser-based or OAuth flows, use the JWT token returned from
POST /api/auth/login.
This method is used automatically by the Dockyfy dashboard.
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...Encrypted Payload Envelope (API Key routes only)
All requests and responses on X-Api-Key
endpoints use AES-256-GCM encryption. Your raw JSON body must be encrypted
and wrapped in this envelope:
{
"v": 1,
"uid": "your-user-uuid",
"iv": "base64-encoded-12-byte-nonce",
"tag": "base64-encoded-16-byte-auth-tag",
"data": "base64-encoded-ciphertext"
}The encryption key is derived from your user ID and API key secret using HKDF-SHA256 — it is never stored. Official SDK helpers handle encryption automatically. See our SDK for implementation details.
Quick Start
Generate your first image in under 2 minutes.
Create an Account & Get an API Key
Sign up for free →
go to API Keys in the sidebar →
click Create New Key. Copy the dk_
key shown. You start with 50 free credits — no card required.
Design & Publish a Template
Go to Templates → Create New. Use the visual editor
to design your canvas. Click any text or image object and set a
Variable Name in the Properties panel
(e.g. name,
date). Click
Publish and copy the template ID from the URL.
Call the Generate Endpoint
Send your data as overrides. Each call costs 1 credit and returns an output URL for the generated asset.
curl -X POST https://api.dockyfy.com/api/templates/{templateId}/generate \
-H "X-Api-Key: dk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"format": "png",
"overrides": [
{ "variableKey": "name", "text": "Jane Smith" },
{ "variableKey": "date", "text": "March 29, 2026" }
]
}'Response — 200 OK
{
"generationId": "550e8400-e29b-41d4-a716-446655440000",
"outputUrl": "https://cdn.dockyfy.com/gen/2026/03/abc123.png",
"format": "png",
"templateId": "your-template-id",
"creditsUsed": 1,
"createdAt": "2026-03-29T12:00:00Z"
}Templates
Templates define the visual layout. Create and publish them in the Dockyfy editor, then reference them by ID in API calls.
/api/templates
List all your templatesReturns a paginated list of your templates. Requires JWT Bearer.
Query Parameters
| Param | Type | Default | Description |
|---|---|---|---|
page | int | 1 | Page number (1-based) |
pageSize | int | 20 | Results per page (max 100) |
search | string | — | Filter by name or tag |
status | string | — | Draft or Published |
purpose | string | — | Filter by template purpose/type |
/api/templates/{id}
Get a single template by IDReturns full template details including variable schema and canvas JSON.
/api/templates/{id}/preview
Generate a watermarked previewRenders a watermarked preview image. Requires JWT Bearer. Does not deduct credits. Use for playground and testing.
/api/templates
Create a new template (programmatic)Creates a new empty draft template via API. Requires JWT Bearer.
Generate
The core production endpoint. Call it with a published template ID and your override data to receive a generated image or PDF URL.
/api/templates/{templateId}/generate
Generate an image or PDF — 1 creditRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
format | string | Yes | png, jpg, or pdf |
overrides | array | No | Array of variable override objects (see Variables Guide) |
overrides[].variableKey | string | Yes | Variable name assigned in the editor |
overrides[].text | string | No | New text content for text objects |
overrides[].fill | string | No | CSS color value e.g. #ff0000 |
overrides[].src | string | No | Image URL for image/background objects |
overrides[].fontSize | number | No | Font size in pixels |
overrides[].fontFamily | string | No | Font family name (must be web-safe or loaded) |
overrides[].opacity | number | No | Object opacity 0–1 |
Bulk Generation
Submit a JSON array of rows to generate hundreds of images or PDFs in a single API call. The job runs asynchronously — poll for status or use Webhooks to be notified on completion.
GET /api/billing/credits/balance.
/api/bulk-jobs
Submit a bulk job — returns 202 AcceptedRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
templateId | string (UUID) | Yes | Published template to generate from |
format | string | Yes | png, jpg, or pdf |
rowsJson | string | Yes | JSON-encoded array of override sets, one object per output file |
[
{ "name": "Alice Johnson", "date": "March 29, 2026", "score": "92%" },
{ "name": "Bob Williams", "date": "March 29, 2026", "score": "87%" },
{ "name": "Carol Martinez", "date": "March 29, 2026", "score": "95%" }
]/api/bulk-jobs
List your bulk jobs/api/bulk-jobs/{id}
Get bulk job status, progress, and item results/api/bulk-jobs/{id}
Cancel a pending or running bulk jobAPI Keys
Manage your dk_-prefixed API keys programmatically.
A raw key is shown only once on creation — Dockyfy stores only a SHA-256 hash.
/api/api-keys
List your keys (prefix + metadata only)/api/api-keys
Create a new API key — returns raw key once — 201Request Body
| Field | Type | Description |
|---|---|---|
name | string | Friendly label for the key (e.g. "Production App") |
scopes | string[] | Requested permission scopes e.g. ["generate", "templates.read"] |
/api/api-keys/{id}/revoke
Revoke an API key permanently — 204Webhooks
Receive real-time HTTP POST notifications when generation jobs complete, credits run low, or bulk jobs finish. Dockyfy delivers to your HTTPS endpoint with 3 automatic retry attempts on failure.
Available Events
| Event | Trigger |
|---|---|
generation.completed | Single image/PDF generated successfully |
generation.failed | Generation rendering failed |
bulk_job.completed | Bulk job finished (all items processed) |
credit.exhausted | Credit balance dropped to zero |
HMAC Signature Verification
Every webhook delivery includes an
X-Dockyfy-Signature header.
Always verify this before processing the payload to ensure requests are authentic.
const crypto = require('crypto');
function verifyWebhook(rawBody, signatureHeader, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(rawBody, 'utf8')
.digest('hex');
// Constant-time comparison to prevent timing attacks
return crypto.timingSafeEqual(
Buffer.from(`sha256=${expected}`),
Buffer.from(signatureHeader)
);
}Webhook Endpoints
/api/webhooks
List your registered webhooks/api/webhooks
Register a new webhook endpoint/api/webhooks/{id}
Update a webhook (URL, events, active state)/api/webhooks/{id}/test
Send a test delivery to your endpoint/api/webhooks/{id}
Delete a webhookCredits & Billing
Every generation costs 1 credit. Credits are included in your plan and can be purchased as add-on packs at any time. Free accounts start with 50 credits.
/api/billing/credits/balance
Get current credit balance and expiry info/api/billing/subscription
Get active subscription, plan name, and limits/api/billing/plans
List all available plans and their credit allocations/api/billing/credits/purchase
Purchase additional credit packsVariables Guide
Variables let you inject dynamic content into templates at generation time. You define variable names in the template editor, then pass override values via the API.
How to Define Variables
- Open the template editor and click any text, image, or shape object.
- In the Properties panel, set a Variable Name (e.g.
recipient_name). - The object's default content is used when no override is provided.
- When calling the API, pass the variable name in
overrides[].variableKey.
Override Properties by Object Type
| Object Type | Primary Override | Additional Overrides |
|---|---|---|
| Text | text |
fill, fontSize, fontFamily, fontWeight, fontStyle, textAlign, opacity |
| Image | src (URL) |
opacity |
| Rectangle / Shape | fill |
stroke, strokeWidth, opacity |
| Background | fill |
— |
| Any object | — | opacity, angle (rotation), backgroundColor |
Example Override Array
[
{ "variableKey": "recipient_name", "text": "Jane Smith" },
{ "variableKey": "issue_date", "text": "March 29, 2026" },
{ "variableKey": "badge_color", "fill": "#6366f1" },
{ "variableKey": "profile_photo", "src": "https://cdn.example.com/jane.jpg" },
{ "variableKey": "score_text", "text": "92%", "fontSize": 48, "fill": "#22c55e" }
]variableKey is not found on the
canvas, it is silently ignored. Template default values are used for any
variable not present in the overrides array.
Error Codes
All error responses return a structured JSON body:
{
"type": "https://tools.ietf.org/html/rfc9110",
"title": "Not Found",
"status": 404,
"detail": "Template '550e8400-e29b-...' not found or not published.",
"traceId": "00-abc123def456..."
}Validation errors (400) include a field-level errors map:
{
"status": 400,
"title": "One or more validation errors occurred.",
"errors": {
"format": [ "'format' must be one of: png, jpg, pdf" ],
"templateId": [ "'templateId' must not be empty." ]
}
}| HTTP Status | Meaning | Common Cause |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created (API key, webhook, template) |
| 202 | Accepted | Bulk job submitted, processing asynchronously |
| 400 | Bad Request | Validation error — see field-level errors in response |
| 401 | Unauthorized | Missing or invalid API key / JWT token |
| 402 | Payment Required | Insufficient credits — purchase more or upgrade plan |
| 403 | Forbidden | Valid auth but missing required permission |
| 404 | Not Found | Template, resource, or API key ID does not exist |
| 409 | Conflict | Duplicate resource (e.g. key name already used) |
| 500 | Server Error | Internal error — retry; contact support if it persists |
Code Examples
Full working examples for common use cases across popular languages and platforms.
Login + List Templates + Generate
// Node.js 18+ (built-in fetch)
const BASE = 'https://api.dockyfy.com';
const API_KEY = 'dk_live_your_api_key';
// List templates (JWT)
async function listTemplates(accessToken) {
const res = await fetch(`${BASE}/api/templates`, {
headers: { 'Authorization': `Bearer ${accessToken}` }
});
return res.json();
}
// Generate image (API key)
async function generate(templateId, overrides) {
const res = await fetch(`${BASE}/api/templates/${templateId}/generate`, {
method: 'POST',
headers: { 'X-Api-Key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ format: 'png', overrides })
});
if (!res.ok) throw new Error(`Generate failed: ${res.status}`);
return res.json();
}
// Submit bulk job (JWT)
async function submitBulk(accessToken, templateId, rows) {
const res = await fetch(`${BASE}/api/bulk-jobs`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ templateId, format: 'png', rowsJson: JSON.stringify(rows) })
});
return res.json(); // { jobId, status: 'Queued' }
}Ready to start building?
Create a free account and get 50 credits instantly — no credit card required.