Request
curl -X POST https://api.iterationlayer.com/document-generation/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "pdf",
"document": {
"metadata": {
"title": "Offer Letter - Senior Software Engineer",
"author": "Cascade Systems Inc."
},
"page": {
"size": { "preset": "A4" },
"margins": {
"top_in_pt": 72,
"right_in_pt": 72,
"bottom_in_pt": 72,
"left_in_pt": 72
}
},
"styles": {
"text": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333"
},
"headline": {
"font_family": "Helvetica",
"font_size_in_pt": 24.0,
"color": "#111111",
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 6.0,
"is_bold": true
},
"link": {
"color": "#0066CC",
"is_underlined": true
},
"list": {
"text_style": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333"
},
"marker_color": "#333333",
"marker_gap_in_pt": 8.0
},
"table": {
"header": {
"background_color": "#333333",
"text_color": "#FFFFFF",
"font_size_in_pt": 11.0,
"is_bold": true
},
"body": {
"background_color": "#FFFFFF",
"text_color": "#333333",
"font_size_in_pt": 11.0
},
"border": {
"outer": {
"top": { "color": "#CCCCCC", "width_in_pt": 1.0 },
"right": { "color": "#CCCCCC", "width_in_pt": 1.0 },
"bottom": { "color": "#CCCCCC", "width_in_pt": 1.0 },
"left": { "color": "#CCCCCC", "width_in_pt": 1.0 }
},
"inner": {
"horizontal": { "color": "#EEEEEE", "width_in_pt": 0.5 },
"vertical": { "color": "#EEEEEE", "width_in_pt": 0.5 }
}
}
},
"grid": {
"background_color": "#FFFFFF",
"border_color": "#CCCCCC",
"border_width_in_pt": 0.0,
"gap_in_pt": 12.0
},
"separator": {
"color": "#CCCCCC",
"thickness_in_pt": 1.0,
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 12.0
},
"image": {
"border_color": "#000000",
"border_width_in_pt": 0.0
}
},
"footer": [
{
"type": "paragraph",
"runs": [{
"text": "Cascade Systems Inc. · 350 Spear Street, Suite 900, San Francisco, CA 94105 · cascadesystems.com"
}]
}
],
"content": [
{ "type": "headline", "level": "h1", "text": "Cascade Systems Inc." },
{ "type": "paragraph", "runs": [
{ "text": "March 14, 2026" }
] },
{ "type": "paragraph", "runs": [
{ "text": "Dear Alex Morgan," }
] },
{ "type": "paragraph", "runs": [
{ "text": "We are pleased to offer you the position of " },
{ "text": "Senior Software Engineer", "is_bold": true },
{ "text": " at Cascade Systems Inc. We were impressed by your experience and believe you will be a valuable addition to our engineering team. Below are the details of your offer." }
] },
{ "type": "paragraph", "runs": [
{ "text": "Role: ", "is_bold": true },
{ "text": "Senior Software Engineer\n" },
{ "text": "Department: ", "is_bold": true },
{ "text": "Platform Engineering\n" },
{ "text": "Annual Salary: ", "is_bold": true },
{ "text": "$185,000.00\n" },
{ "text": "Equity Grant: ", "is_bold": true },
{ "text": "15,000 stock options (4-year vesting, 1-year cliff)\n" },
{ "text": "Start Date: ", "is_bold": true },
{ "text": "April 14, 2026\n" },
{ "text": "Reporting To: ", "is_bold": true },
{ "text": "Elena Vasquez, VP of Engineering" }
] },
{ "type": "separator" },
{ "type": "headline", "level": "h2", "text": "Benefits" },
{
"type": "list",
"variant": "unordered",
"items": [
{ "text": "Comprehensive health, dental, and vision insurance (100% employee, 75% dependents)" },
{ "text": "401(k) retirement plan with 4% company match" },
{ "text": "Unlimited paid time off with a 3-week minimum encouraged" },
{ "text": "$5,000 annual learning and development budget" },
{ "text": "Flexible remote work policy with quarterly team on-sites" },
{ "text": "$2,500 home office setup stipend" }
]
},
{ "type": "separator" },
{ "type": "paragraph", "runs": [
{ "text": "This offer is contingent upon successful completion of a background check and is valid for 7 business days from the date of this letter. This letter is not a contract of employment and does not guarantee employment for any specific duration." }
] },
{ "type": "separator" },
{
"type": "grid",
"columns": [
{
"column_span": 6,
"blocks": [
{ "type": "paragraph", "runs": [
{ "text": "For Cascade Systems Inc.\n\n", "is_bold": true },
{ "text": "Signature: ________________________\n\n" },
{ "text": "Name: ", "is_bold": true },
{ "text": "Elena Vasquez\n" },
{ "text": "Title: ", "is_bold": true },
{ "text": "VP of Engineering" }
] }
]
},
{
"column_span": 6,
"blocks": [
{ "type": "paragraph", "runs": [
{ "text": "Accepted by Candidate\n\n", "is_bold": true },
{ "text": "Signature: ________________________\n\n" },
{ "text": "Name: ", "is_bold": true },
{ "text": "____________________\n" },
{ "text": "Date: ", "is_bold": true },
{ "text": "____________________" }
] }
]
}
]
}
]
}
}'Response
{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}Request
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.generateDocument({
format: "pdf",
document: {
metadata: {
title: "Offer Letter - Senior Software Engineer",
author: "Cascade Systems Inc.",
},
page: {
size: { preset: "A4" },
margins: {
top_in_pt: 72,
right_in_pt: 72,
bottom_in_pt: 72,
left_in_pt: 72,
},
},
styles: {
text: {
font_family: "Helvetica",
font_size_in_pt: 11.0,
line_height: 1.5,
color: "#333333",
},
headline: {
font_family: "Helvetica",
font_size_in_pt: 24.0,
color: "#111111",
spacing_before_in_pt: 12.0,
spacing_after_in_pt: 6.0,
is_bold: true,
},
link: {
color: "#0066CC",
is_underlined: true,
},
list: {
text_style: {
font_family: "Helvetica",
font_size_in_pt: 11.0,
line_height: 1.5,
color: "#333333",
},
marker_color: "#333333",
marker_gap_in_pt: 8.0,
},
table: {
header: {
background_color: "#333333",
text_color: "#FFFFFF",
font_size_in_pt: 11.0,
is_bold: true,
},
body: {
background_color: "#FFFFFF",
text_color: "#333333",
font_size_in_pt: 11.0,
},
border: {
outer: {
top: { color: "#CCCCCC", width_in_pt: 1.0 },
right: { color: "#CCCCCC", width_in_pt: 1.0 },
bottom: { color: "#CCCCCC", width_in_pt: 1.0 },
left: { color: "#CCCCCC", width_in_pt: 1.0 },
},
inner: {
horizontal: { color: "#EEEEEE", width_in_pt: 0.5 },
vertical: { color: "#EEEEEE", width_in_pt: 0.5 },
},
},
},
grid: {
background_color: "#FFFFFF",
border_color: "#CCCCCC",
border_width_in_pt: 0.0,
gap_in_pt: 12.0,
},
separator: {
color: "#CCCCCC",
thickness_in_pt: 1.0,
spacing_before_in_pt: 12.0,
spacing_after_in_pt: 12.0,
},
image: {
border_color: "#000000",
border_width_in_pt: 0.0,
},
},
footer: [
{
type: "paragraph",
runs: [{
text: "Cascade Systems Inc. · 350 Spear Street, Suite 900, San Francisco, CA 94105 · cascadesystems.com",
}],
},
],
content: [
{ type: "headline", level: "h1", text: "Cascade Systems Inc." },
{ type: "paragraph", runs: [
{ text: "March 14, 2026" },
] },
{ type: "paragraph", runs: [
{ text: "Dear Alex Morgan," },
] },
{ type: "paragraph", runs: [
{ text: "We are pleased to offer you the position of " },
{ text: "Senior Software Engineer", is_bold: true },
{ text: " at Cascade Systems Inc. We were impressed by your experience and believe you will be a valuable addition to our engineering team. Below are the details of your offer." },
] },
{ type: "paragraph", runs: [
{ text: "Role: ", is_bold: true },
{ text: "Senior Software Engineer\n" },
{ text: "Department: ", is_bold: true },
{ text: "Platform Engineering\n" },
{ text: "Annual Salary: ", is_bold: true },
{ text: "$185,000.00\n" },
{ text: "Equity Grant: ", is_bold: true },
{ text: "15,000 stock options (4-year vesting, 1-year cliff)\n" },
{ text: "Start Date: ", is_bold: true },
{ text: "April 14, 2026\n" },
{ text: "Reporting To: ", is_bold: true },
{ text: "Elena Vasquez, VP of Engineering" },
] },
{ type: "separator" },
{ type: "headline", level: "h2", text: "Benefits" },
{
type: "list",
variant: "unordered",
items: [
{ text: "Comprehensive health, dental, and vision insurance (100% employee, 75% dependents)" },
{ text: "401(k) retirement plan with 4% company match" },
{ text: "Unlimited paid time off with a 3-week minimum encouraged" },
{ text: "$5,000 annual learning and development budget" },
{ text: "Flexible remote work policy with quarterly team on-sites" },
{ text: "$2,500 home office setup stipend" },
],
},
{ type: "separator" },
{ type: "paragraph", runs: [
{ text: "This offer is contingent upon successful completion of a background check and is valid for 7 business days from the date of this letter. This letter is not a contract of employment and does not guarantee employment for any specific duration." },
] },
{ type: "separator" },
{
type: "grid",
columns: [
{
column_span: 6,
blocks: [
{ type: "paragraph", runs: [
{ text: "For Cascade Systems Inc.\n\n", is_bold: true },
{ text: "Signature: ________________________\n\n" },
{ text: "Name: ", is_bold: true },
{ text: "Elena Vasquez\n" },
{ text: "Title: ", is_bold: true },
{ text: "VP of Engineering" },
] },
],
},
{
column_span: 6,
blocks: [
{ type: "paragraph", runs: [
{ text: "Accepted by Candidate\n\n", is_bold: true },
{ text: "Signature: ________________________\n\n" },
{ text: "Name: ", is_bold: true },
{ text: "____________________\n" },
{ text: "Date: ", is_bold: true },
{ text: "____________________" },
] },
],
},
],
},
],
},
});
await Bun.write("offer-letter-alex-morgan.pdf", Buffer.from(result.data.buffer, "base64"));Response
{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}Request
import base64
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.generate_document(
format="pdf",
document={
"metadata": {
"title": "Offer Letter - Senior Software Engineer",
"author": "Cascade Systems Inc.",
},
"page": {
"size": {"preset": "A4"},
"margins": {
"top_in_pt": 72,
"right_in_pt": 72,
"bottom_in_pt": 72,
"left_in_pt": 72,
},
},
"styles": {
"text": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333",
},
"headline": {
"font_family": "Helvetica",
"font_size_in_pt": 24.0,
"color": "#111111",
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 6.0,
"is_bold": True,
},
"link": {
"color": "#0066CC",
"is_underlined": True,
},
"list": {
"text_style": {
"font_family": "Helvetica",
"font_size_in_pt": 11.0,
"line_height": 1.5,
"color": "#333333",
},
"marker_color": "#333333",
"marker_gap_in_pt": 8.0,
},
"table": {
"header": {
"background_color": "#333333",
"text_color": "#FFFFFF",
"font_size_in_pt": 11.0,
"is_bold": True,
},
"body": {
"background_color": "#FFFFFF",
"text_color": "#333333",
"font_size_in_pt": 11.0,
},
"border": {
"outer": {
"top": {"color": "#CCCCCC", "width_in_pt": 1.0},
"right": {"color": "#CCCCCC", "width_in_pt": 1.0},
"bottom": {"color": "#CCCCCC", "width_in_pt": 1.0},
"left": {"color": "#CCCCCC", "width_in_pt": 1.0},
},
"inner": {
"horizontal": {"color": "#EEEEEE", "width_in_pt": 0.5},
"vertical": {"color": "#EEEEEE", "width_in_pt": 0.5},
},
},
},
"grid": {
"background_color": "#FFFFFF",
"border_color": "#CCCCCC",
"border_width_in_pt": 0.0,
"gap_in_pt": 12.0,
},
"separator": {
"color": "#CCCCCC",
"thickness_in_pt": 1.0,
"spacing_before_in_pt": 12.0,
"spacing_after_in_pt": 12.0,
},
"image": {
"border_color": "#000000",
"border_width_in_pt": 0.0,
},
},
"footer": [
{
"type": "paragraph",
"runs": [{
"text": "Cascade Systems Inc. · 350 Spear Street, Suite 900, San Francisco, CA 94105 · cascadesystems.com",
}],
},
],
"content": [
{"type": "headline", "level": "h1", "text": "Cascade Systems Inc."},
{"type": "paragraph", "runs": [
{"text": "March 14, 2026"},
]},
{"type": "paragraph", "runs": [
{"text": "Dear Alex Morgan,"},
]},
{"type": "paragraph", "runs": [
{"text": "We are pleased to offer you the position of "},
{"text": "Senior Software Engineer", "is_bold": True},
{"text": " at Cascade Systems Inc. We were impressed by your experience and believe you will be a valuable addition to our engineering team. Below are the details of your offer."},
]},
{"type": "paragraph", "runs": [
{"text": "Role: ", "is_bold": True},
{"text": "Senior Software Engineer\n"},
{"text": "Department: ", "is_bold": True},
{"text": "Platform Engineering\n"},
{"text": "Annual Salary: ", "is_bold": True},
{"text": "$185,000.00\n"},
{"text": "Equity Grant: ", "is_bold": True},
{"text": "15,000 stock options (4-year vesting, 1-year cliff)\n"},
{"text": "Start Date: ", "is_bold": True},
{"text": "April 14, 2026\n"},
{"text": "Reporting To: ", "is_bold": True},
{"text": "Elena Vasquez, VP of Engineering"},
]},
{"type": "separator"},
{"type": "headline", "level": "h2", "text": "Benefits"},
{
"type": "list",
"variant": "unordered",
"items": [
{"text": "Comprehensive health, dental, and vision insurance (100% employee, 75% dependents)"},
{"text": "401(k) retirement plan with 4% company match"},
{"text": "Unlimited paid time off with a 3-week minimum encouraged"},
{"text": "$5,000 annual learning and development budget"},
{"text": "Flexible remote work policy with quarterly team on-sites"},
{"text": "$2,500 home office setup stipend"},
],
},
{"type": "separator"},
{"type": "paragraph", "runs": [
{"text": "This offer is contingent upon successful completion of a background check and is valid for 7 business days from the date of this letter. This letter is not a contract of employment and does not guarantee employment for any specific duration."},
]},
{"type": "separator"},
{
"type": "grid",
"columns": [
{
"column_span": 6,
"blocks": [
{"type": "paragraph", "runs": [
{"text": "For Cascade Systems Inc.\n\n", "is_bold": True},
{"text": "Signature: ________________________\n\n"},
{"text": "Name: ", "is_bold": True},
{"text": "Elena Vasquez\n"},
{"text": "Title: ", "is_bold": True},
{"text": "VP of Engineering"},
]},
],
},
{
"column_span": 6,
"blocks": [
{"type": "paragraph", "runs": [
{"text": "Accepted by Candidate\n\n", "is_bold": True},
{"text": "Signature: ________________________\n\n"},
{"text": "Name: ", "is_bold": True},
{"text": "____________________\n"},
{"text": "Date: ", "is_bold": True},
{"text": "____________________"},
]},
],
},
],
},
],
},
)
with open("offer-letter-alex-morgan.pdf", "wb") as f:
f.write(base64.b64decode(result["data"]["buffer"]))Response
{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}Request
package main
import (
"encoding/base64"
"os"
il "github.com/iterationlayer/sdk-go"
)
func main() {
client := il.NewClient("YOUR_API_KEY")
result, err := client.GenerateDocument(il.GenerateDocumentRequest{
Format: "pdf",
Document: il.DocumentDefinition{
Metadata: il.DocumentMetadata{
Title: "Offer Letter - Senior Software Engineer",
Author: "Cascade Systems Inc.",
},
Page: il.PageConfig{
Size: il.PageSize{Preset: "A4"},
Margins: il.Margins{TopInPt: 72, RightInPt: 72, BottomInPt: 72, LeftInPt: 72},
},
Content: []il.ContentBlock{
il.NewHeadlineBlock("h1", "Cascade Systems Inc."),
il.ParagraphBlock{Type: "paragraph", Markdown: "March 14, 2026"},
il.ParagraphBlock{Type: "paragraph", Markdown: "Dear Alex Morgan,"},
il.ParagraphBlock{Type: "paragraph", Markdown: "We are pleased to offer you the position of **Senior Software Engineer** at Cascade Systems Inc."},
il.ParagraphBlock{Type: "paragraph", Runs: []il.TextRun{
{Text: "Role: ", IsBold: true},
{Text: "Senior Software Engineer\n"},
{Text: "Annual Salary: ", IsBold: true},
{Text: "$185,000.00\n"},
{Text: "Start Date: ", IsBold: true},
{Text: "April 14, 2026"},
}},
il.NewSeparatorBlock(),
il.NewHeadlineBlock("h2", "Benefits"),
il.ListBlock{Type: "list", Variant: "unordered", Items: []il.ListItem{
{Text: "Comprehensive health, dental, and vision insurance"},
{Text: "401(k) retirement plan with 4% company match"},
{Text: "Unlimited paid time off"},
{Text: "$5,000 annual learning and development budget"},
{Text: "Flexible remote work policy"},
{Text: "$2,500 home office setup stipend"},
}},
il.NewSeparatorBlock(),
il.ParagraphBlock{Type: "paragraph", Markdown: "This offer is valid for 7 business days from the date of this letter."},
},
},
})
if err != nil {
panic(err)
}
decoded, _ := base64.StdEncoding.DecodeString(result.Data.Buffer)
os.WriteFile("offer-letter-alex-morgan.pdf", decoded, 0644)
}Response
{
"success": true,
"data": {
"buffer": "JVBERi0xLjcKMSAwIG9iago8...",
"mime_type": "application/pdf"
}
}