New: design and send email from the headless API.Explore the API
All posts
Guide

Generate Decks Programmatically: A Guide to the Preso API

Learn how to generate on-brand presentations from your app using the Preso API. This step-by-step guide covers setup, templates, customization, and automation

TPThe Preso Team
12 minutes read

Introduction

You know the abyss. A blank slide, a cursor blinking, and an entire afternoon lost nudging text boxes, wrestling alignment in PowerPoint, or pasting the same header onto 40 slides. For anyone who ships presentations at scale (sales teams, agencies, startups running board updates, or platforms that surface decks inside their own product), the manual slog is not just slow. It is expensive. A generic templated look signals that you cut corners. A deck that drifts off brand in a client meeting undermines trust before you even get to the ask.

The fix is not a bigger theme library. It is a programmatic engine that turns data in your stack into finished, on-brand presentations the moment they are needed. Preso gives you that engine. Describe a deck in plain English and Preso designs it. But for teams that ship dozens or hundreds of decks every month, the real unlock is the API. A REST endpoint and an MCP server that let your product, your CRM, your customer events, or an AI agent generate a beautiful, editable deck without a human clicking through a builder.

This guide walks you through generating decks programmatically with the Preso API. You will learn how to set up access, choose the right templates, inject data, layer on AI narrative and voice-over, and automate the flow so that a deck is ready the moment a trigger fires. Whether you are piping enriched account data into pitch decks, shipping monthly investor updates from product events, or spinning up webinar decks for a launch calendar, this is the playbook.

Before we dive in, take a quick look at the headless presentations overview if you need the big picture. And if you are already sold on the approach, the pricing page shows plans for developers and teams generating headless decks.

Prerequisites

You will need just a few things to follow along:

  • A Preso account with API access enabled. Sign up on trypreso.com and visit the pricing page for a plan that includes headless generation.
  • An API key, generated from the team settings within Preso. Keep this key secure. We will reference it as YOUR_API_KEY throughout this guide.
  • A basic understanding of REST APIs and JSON. You will be sending POST requests with JSON bodies. Comfort with curl, Postman, or any HTTP client is enough.
  • Optionally, a tool that triggers your API calls. That could be a CRM platform like Salesforce or HubSpot, a product analytics tool that emits events, a low-code workflow like Zapier, or a custom backend written in Python, Node.js, or your language of choice.

Now let us get into the steps.

Step 1: Setting Up Your Preso API Access

First, confirm your API key is active. Within your Preso team dashboard, navigate to Settings > API. You should see a key (if it is not there, generate one). Copy it. Test it with a simple call to the health endpoint:

curl -X GET https://api.trypreso.com/health \
  -H "Authorization: Bearer YOUR_API_KEY"

If you receive a 200 OK with a status message, you are connected. The real power, though, lives in the deck generation endpoints. The base URL is https://api.trypreso.com. All subsequent requests will use that.

Pro tip: Store your API key in an environment variable or a secrets manager. Never hardcode it into your application logic. For production workloads, Preso supports rotating keys. If you need to automate key creation as part of your pipeline, the broader developer community has discussed patterns like programmatically creating project API keys that you can adapt (though that thread references OpenAI, the key management principles are similar).

Now, before we make a deck, you need to understand the building blocks.

Step 2: Understanding Brand Kits, Templates, and Decks

Preso organizes its output around three concepts: brand kits, templates, and decks.

  • Brand kits are the visual rulebooks. Colors, fonts, logo placement, and slide layouts that match your company or a client’s identity. You can lock a brand kit so any generated deck stays inside those guardrails. This is crucial for agencies managing multiple client brands. Check out the per-client brand kits with locked guardrails template to see how this works in practice.
  • Templates (also called blueprints) are structured slide sequences. Think of them as the outline and design pattern for a specific use case: a pitch deck, a QBR, an investor update, a webinar. Each template accepts a set of content variables you provide via the API. The full catalog of ready-to-use templates lives on the deck templates page. For API-driven workflows, you will typically reference a template by its ID, which you can find in the template catalog under each blueprint’s “API” tab.
  • Decks are the finished presentations. When you call the generate endpoint, Preso combines your chosen brand kit, template, and content data, then assembles a polished, editable deck. You get back a deck ID and a shareable link. You can also export it to PowerPoint, Google Slides, or PDF.

If you are familiar with document-generation APIs like Gamma’s approach to auto-generating documents and decks, you will notice a difference: Preso puts brand control at the center, not just layout. The brand kit ensures every color swatch and font weight survives the generation, which matters when a deck carries your logo into a boardroom.

Now let us use these pieces.

Step 3: Generating Your First Deck from a Template

We will pick a specific template and fire off a minimal deck generation call. For this example, assume you are a marketing team that needs a campaign wrap-up deck. The marketing strategy and planning decks template was built exactly for that use case. Its API tab shows the template ID (let us say tpl_mktg1) and the expected JSON structure.

Here is a sample request:

curl -X POST https://api.trypreso.com/decks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brand_id": "brd_abc123",
    "template_id": "tpl_mktg1",
    "content": {
      "campaign_name": "Q2 Product Launch",
      "results_summary": "We saw a 22% lift in trial sign-ups and beat our lead-gen target by 15%.",
      "key_learnings": "Live demo sequences outperformed static ads. Twitter Spaces drove 8% of new pipeline.",
      "next_steps": "Double down on live demo cadence. Test retargeting to event attendees."
    }
  }'

The API returns a JSON object with deck_id and url. Open the url, and you will see a complete, on-brand presentation with slides titled, visualized, and copy populated from your input. No manual formatting. No alignment wrestling.

Numbers in the response will reflect what you actually entered. Preso does not fabricate data if you leave a field blank, but if you supply precise figures (like the 22% above), the slides will carry them through faithfully.

You can test this with any template from the deck templates library. For a sales use case, the account-tailored pitch decks personalized per prospect template accepts fields like prospect company name, pain points, and current stack so every deck feels custom.

Step 4: Customizing Slide Content with Data

The real leverage comes when you pipe live data into these templates. Instead of hardcoding static strings, you can connect your API caller to a CRM, a product analytics database, a customer success platform, or any internal system.

Imagine your sales team uses a discovery and demo decks built from a single brief template for every proposal. You already have the data: account name, industry, deal size, conversation notes. Write a script that listens for a deal advancing to the proposal stage, pulls the relevant fields, and sends them to the Preso endpoint.

Here is a condensed Python example:

import requests
import os
 
def generate_proposal_deck(opportunity):
    url = "https://api.trypreso.com/decks"
    headers = {
        "Authorization": f"Bearer {os.environ['PRESO_API_KEY']}",
        "Content-Type": "application/json"
    }
    payload = {
        "brand_id": "brd_abc123",
        "template_id": "tpl_sales2",
        "content": {
            "prospect_name": opportunity["account_name"],
            "industry": opportunity["industry"],
            "discovery_notes": opportunity["notes"],
            "proposed_solution": opportunity["solution"],
        }
    }
    response = requests.post(url, headers=headers, json=payload)
    deck = response.json()
    return deck["url"]

Now every rep gets a tailored deck without ever opening a slide editor. For teams using a CRM, you can wire this direct to the platform; the account-tailored pitch decks personalized per prospect template is designed to accept enriched data from Clay or Apollo, delivering a deck right inside Salesforce or HubSpot. No more dropping screenshots into a generic template.

The template catalog covers far more than sales. If you run a venue or event business, the event and venue sales proposals for weddings and conferences template takes fields like guest count, date, and plan preferences and turns them into a polished proposal. A hotel sales manager could trigger one from a website enquiry form.

When working with structured data, pay attention to the JSON shape each template expects. You can find exact schemas on the template detail page under the "API" section. If you need to transform nested data before sending it, tools like JSONSelect (similar to CSS selectors for JSON) are useful. The LivePreso documentation has a guide on working with API data that walks through JSONSelect and data binding patterns, which can inform your data prep layer.

Step 5: Adding AI-Powered Narrative and Voice-Over

A slide deck with only bullet points is a handout. The best presentations tell a story. Preso lets you attach a narrative to any deck, in any language, along with natural voice-overs. This approach is reminiscent of Google’s NotebookLM Audio Overviews but purpose-built for presentations.

You can include a narrative field in your API call that sets the speaking notes for each slide. For example:

"narrative": {
  "language": "es",
  "tone": "professional",
  "slides": [
    {"slide_index": 1, "notes": "Bienvenidos a nuestro resumen del trimestre. Hoy veremos..."},
    {"slide_index": 2, "notes": "Nuestras métricas principales muestran un crecimiento..."}
  ]
}

Preso generates a voice-over that matches the language and tone and embeds it into the deck. When you share the deck via the Preso viewer, recipients can play the narration like a guided walkthrough. This turns an email-attached PDF into an experience. For webinar and conference talk decks, a pre-recorded narrative means speakers have a polished script without memorizing slides.

If you want to go fully programmatic, you can generate the narrative with an LLM before sending it to Preso. Feed your raw content to a model, ask it to produce slide-by-slide speaking notes, package them into the narrative object, and include them in the same API call. The integration is straightforward because Preso treats the narrative as just another data field.

This capability also makes Preso useful for education. The course and curriculum decks across modules template, for instance, accepts structured lesson outlines. Add multilingual voice-overs, and you have a self-paced course that looks and sounds like it was produced by a design studio.

Step 6: Integrating Deck Generation into Your Product or Workflow

The API is designed not just for one-off scripts but for embedding into SaaS products, internal tools, and agent workflows. Many teams start by triggering decks from webhooks.

Consider a SaaS company that needs monthly investor updates. Every month, a query runs against your product database to fetch active users, churn, and revenue numbers. A simple cron job or a product analytics event (say, a Segment destination) can call the Preso API with the monthly investor updates and board decks template. The board gets a consistent, professional deck. The CEO never asks the finance team to "just pull a few slides together."

For agencies that build decks for clients, the speed advantage is even more pronounced. Instead of assembling each proposal by hand, account teams can fill a short brief in a web form, and the system calls the API. The new-business pitch and proposal decks, same-day template shows how a client brief becomes a ready-to-present deck within minutes. This workflow scales to dozens of pitches per week without adding headcount.

When integrating into your own product, consider the user experience. You might add a "Generate deck" button inside your dashboard that calls your backend, which then calls Preso. You can store the returned deck URL in your database and surface it to the user. Because Preso decks are editable, users can still tweak a slide if needed, but they skip the 40-minute setup.

The on-brand lecture slides from an outline template is a favorite for educational platforms. A teacher pastes a lecture outline into a text area, your platform sends it to Preso, and the next page displays a complete, branded slide deck for that module. Export to PDF or Google Slides is just a click away.

If you are building a commercial product around this, study how other developer-friendly APIs handle request volumes. The Build APIs with AI – 10 Minute Course with EchoAPI video provides a concise overview of API design patterns that work well with AI services, though the same principles apply to any headless generation tool.

Step 7: Automating at Scale with Triggers and the MCP Server

Once the integration proves its value, you will want to automate it fully. Preso offers two mechanisms for this: triggers and the MCP server.

Triggers are simple event-driven workflows. You define a condition ("when a new deal moves to proposal stage," "when a new customer completes onboarding") and map it to a template. Preso generates the deck and can deposit it into a drive, Slack, or back into your CRM. Learn more on the generate decks from your stack page. The beauty is that triggers run headlessly; no one needs to hit a button.

For even deeper integration, the MCP server (Model Context Protocol) lets an AI agent call Preso’s engine as a tool. If you run an AI-powered sales coach or an analytics co-pilot, it can surface the Preso skill set: "generate me a QBR deck for Acme Corp using last quarter's usage data." The server handles the interaction, and the agent gets back a ready-to-share deck URL. This is not an early concept; it is live and documented in the headless presentations overview.

To give you a concrete example: suppose you have a Clay table that enriches target accounts. A built-in enrichment step can call the Preso API and attach a generated pitch deck URL to each row. Your outbound reps open a spreadsheet and already have a personalized deck waiting. The account-tailored pitch decks personalized per prospect template was built for exactly that pattern.

Scale considerations: the API is built to handle concurrent generation requests. Test your workload, monitor response times, and for high-throughput scenarios, consider queuing generations. Preso’s team offers guidance on volume limits under your plan.

Pro Tips and Warnings for Production Use

Pro tips:

  • Test with a staging brand kit. Before sending automated decks to clients, create a test brand and validate output. It takes two minutes and catches data mismatches early.
  • Cache brand and template IDs. These rarely change. Hardcode them once after looking them up.
  • Design for partial fills. Not every slide needs every field. Templates gracefully handle missing keys; the slide layout adapts rather than breaking.
  • Use webhook endpoints. If you need to know when a deck is ready (large decks may take a few seconds), the API supports a webhook_url parameter. Your system can react asynchronously.

Warnings:

  • Never expose your API key in client-side code. Generate decks from a secure backend only. If you embed the key in a frontend, anyone can max your quota.
  • Respect rate limits. Spikes that fire hundreds of simultaneous requests may be throttled. Work with the documented limits and implement exponential backoff in your retry logic.
  • Review generated decks before sending. The AI is strong, but if your data contains placeholder text or edge-case characters, do a quick sanity check before it lands in a customer’s inbox.
  • Lock brand kits for external use. When building a product that serves multiple clients, always use locked brand kits (see the per-client brand kits with locked guardrails) to prevent accidental style drift.

Summary: Key Takeaways

Programmatic deck generation turns a manual design task into a composable, scalable workflow. Here is what to remember:

  • The Preso API takes a brand kit, a template, and structured content, and returns an on-brand, editable presentation.
  • With templates covering sales, marketing, investor updates, education, and more, you can launch decoupled generation for every department.
  • You can layer AI-powered narrative and voice-over to turn static slides into a presentation experience.
  • Triggers and the MCP server let you embed deck creation into CRMs, agent workflows, and product events, so the right deck arrives at the right time without human intervention.

Manual slides are a tax on creative focus. When you let your stack generate the deck, your team spends time on the message, not the alignment.

Ready to stop building decks by hand? Pick a template from the deck templates library, grab your API key, and generate your first deck today. Head over to trypreso.com and start on the pricing plan that fits your volume. Your next on-brand deck is one API call away.