Generate from approved templates
Turn one brief into an on-brand presentation, document, and social post from approved templates, then check, revise, and export.
A team approves a handful of templates once; every agent or script then produces content that uses their layout and theme without re-describing the brand each time. This page walks that loop for one brief with Gamma 5 (POST /agent/generations with templateId, or the generate_from_template MCP tool), with the REST call and the MCP tool for each step. You can read it without running anything; the calls are small enough to paste into a client.
Quick reference
Generate with
POST /agent/generationsandtemplateId(REST) orgenerate_from_templatewith a workspace template asgammaId(MCP); do not sendthemeIdwith a template.Tell the prompt how closely to follow the template; rules that should apply every time belong in the template's instructions and locks.
Poll until
statusiscompletedorfailed; the completed response carriesgamma.gammaId,gamma.gammaUrl,credits, and the export URL if you asked forexportAsand the export succeeded.Edit the generated gamma (
gamma.gammaId), not the template; one edit runs on a gamma at a time, and edits need edit access.Reads and exports are free; generations and edits consume credits.
The brief
Launch update for the Atlas analytics add-on: what shipped (three features), who it is for, pricing for the two tiers, and next quarter's roadmap. Audience: existing customers.
Three outputs, three approved templates in the workspace:
Launch deck for the customer webinar
"Product launch deck" (title, three feature cards, pricing table, roadmap, closing)
presentation
Release notes page for the help center
"Release notes" (summary, what's new, pricing, FAQ)
document
Announcement post
"Launch announcement" (one visual card with headline and three bullets)
social
Which templates work
Use POST /agent/generations with templateId. It runs Gamma 5 and accepts three kinds of starting point: a template saved in your workspace, any gamma in your workspace, or an official Gamma template from Explore. Your prompt decides how closely the result follows it, so say so: "Follow this template's structure and style exactly; only replace the content." Do not send themeId with templateId (the request fails with 400); the template's look is the brand.
For finer control over how the template is applied, put the rules in the template itself with template instructions: overall guidance in the template's settings (tone, audience, what must always be filled in), a note on each slide saying what belongs there, and a lock on any slide the generation must leave untouched, such as the cover, a legal disclaimer, or the pricing table. Gamma reads them on every generation from that template, so your prompt only needs to carry the brief. See What are template instructions and how can I use them? in the Help Center.
Find the IDs with GET /templates/search: workspaceTemplates[].id for your own, exploreTemplates[].id for official ones. Over MCP, the generate_from_template tool is the same call: it starts a Gamma 5 generation with the template you pass as gammaId pinned as its templateId; use a workspaceTemplates hit from search_templates.
Step 1: Generate from the template
One call per output. The template carries the layout and theme; the brief carries the content.
Repeat with the "Release notes" template ("format": "document") and the "Launch announcement" template ("format": "social"). Each call returns a gen_-prefixed generationId; poll GET /v1.0/agent/generations/{generationId} until status is completed or failed. The response carries gamma.gammaUrl, exportUrl when exportAs was set, and the credits charged. See Poll for results.
generate_from_template with:
gammaId is a template saved in the user's workspace (a workspaceTemplates hit from search_templates); the tool runs POST /agent/generations with it as templateId, so the format follows the template and themeId is not accepted. Repeat with the other two template IDs; poll get_generation_status with the returned gen_ id until status is completed or failed.
What came back for the deck: eight cards in the template's order, the three feature cards filled from the brief, the pricing table with the two tiers, roadmap and closing cards; the template's theme throughout. The document used the "Release notes" sections and wrote an FAQ from the brief; the social post is one card with the headline and three feature bullets. If a result drifts from the template, tighten the prompt ("keep every card, same order, same layouts") and regenerate; the structure is prompt-directed on the agent endpoint, so check it the first time you use a template.
Step 2: Check the result
read_gamma with gammaIdOrUrl set to the generation ID or gamma URL returns the content as text, so the agent can confirm the pricing tiers and feature names before anyone opens the deck.
GET /v1.0/gammas/{gammaId} returns metadata (title, card count, URL, timestamps), not content; the completed agent status also includes result.summary, the agent's own description of what it built. To check content, open gamma.gammaUrl or inspect the exported file.
Step 3: Revise one thing
The brief's pricing changed after generation: Business is $129, not $149. Edit the existing gamma rather than regenerating.
edit_gamma with the gamma URL and prompt: "In the pricing table, change the Business tier price to $129/mo." Poll get_edit_status until completed or failed; result.summary describes what changed.
Use the generated deck's id, not the template's; editing the template would change the template itself.
Poll GET /v1.0/agent/edits/{editId}. The completed response includes result.summary and the credits charged.
Edits change only what the instruction asks for; the rest of the gamma, including its theme and layout, stays as it was. Only one edit runs on a gamma at a time, so wait for completed before sending the next instruction. Edits need edit access to the gamma and are charged credits like generations.
Step 4: Export
export_gamma with the gamma URL and exportAs: "pptx" (or pdf, or png for a zip of card images). Poll get_export_status for the download URL.
POST /v1.0/gammas/{gammaId}/export with { "exportAs": "pptx" }, then GET /v1.0/exports/{exportId}.
Exports are free and work for any non-archived gamma in the connected workspace that the user can view. The deck went out as PPTX for the webinar, the release notes as PDF, and the social post as PNG.
When it fails
400 on POST /agent/generations with both themeId and templateId
They cannot be combined
Drop themeId; the template supplies the look
400 or not found for templateId
The ID is not a workspace template, a gamma in this workspace, or an Explore template, or the user cannot access it
Pick an id from GET /templates/search or GET /gammas/search
Result does not follow the template
The agent treats the template as a reference and your prompt did not ask it to keep the structure
Say "follow this template's structure exactly; only replace the content", and lock the slides that must never change in the template's instructions
failed with insufficient_credits
The workspace is out of credits
Add credits; reads and exports still work
Edit returns a permission error
The user has view access only
Ask the owner for edit access
Classic POST /generations/from-template rejects gammaId: not a template, multiple pages, part of a site, archived, Explore id, or over the card limit
Classic template eligibility
Use POST /agent/generations with templateId, or mark a single-page gamma as a template
What this gives you
Brand consistency without prompt engineering: the template carries layout and theme; the brief carries only the content.
A verifiable loop: generate, read, edit, export, each with a status you can poll and a credit charge you can see.
One pattern for three formats;
formatand the template decide whether the result is a deck, a document, or a post.
Related
Brand, template, and editing controls: which properties are preserved, which can change, and whether each is enforced, a default, or up to your prompt
Connect your own agent to Gamma: connecting an agent to run this loop
POST /agent/generations: parameter details for Gamma 5 generationGenerate from template (Classic): the Classic REST route for existing integrations
Last updated
Was this helpful?