POST /generations/from-template
Adapt, remix, or transform an existing Gamma. The template's structure is preserved by default and changes only when your prompt asks.
Start an asynchronous Classic generation by adapting an existing Gamma — swap content, retarget for a new audience, transform the subject, replace images, or restructure cards. The template's structure is preserved by default; it only changes when your prompt explicitly asks. New integrations can also use POST /agent/generations with templateId, which works differently: your prompt decides how much of the template's structure and look to keep, and themeId can't be combined with templateId.
When to use this endpoint
Use this instead of POST /generations when you have an existing Gamma whose layout, card count, or visual structure you want to keep. Provide the template's file ID as gammaId and describe what should change in prompt. Gamma preserves the template's structure by default — it only restructures cards when your prompt explicitly asks.
Key differences from /generations
Input
inputText (raw content)
prompt (change instructions) + gammaId (template file ID)
Structure
Gamma decides layout
Preserves template layout
Use case
Create from scratch
Remix, retarget, or translate existing content
What you get back
The response returns a generationId immediately. Poll GET /generations/{id} every 5 seconds until status is completed or failed. On completion, you receive gammaUrl, exportUrl (if exportAs was set), gammaId, and credits usage.
Creates an asynchronous generation job from a template Gamma with variable substitution.
API key for authentication
Export format for automatic export after generation
pdfPossible values: Text prompt describing what to generate
Q3 financial summary for investorsCustom title for the generated Gamma. If not provided, a title will be automatically generated from the content.
Q3 Financial SummaryThe File ID of the gamma to be used as a template. The File must contain exactly one Page.
gamma_abc123Theme ID to apply to the generated Gamma
theme_xyz789Folder to place the generated Gamma in.
folder_abcFolder to place the generated Gamma in. Accepts at most 1 folder ID. Ignored when folderId is provided.
["folder_abc"]Generation job created successfully
Unique identifier for the generation job
gen_xyz789Warnings about the request
Some template variables were not foundInvalid request or template not found
Invalid or missing API key
Insufficient credits
Feature not enabled for workspace
Rate limit exceeded, or a Free workspace has too many pending generation jobs started with an API key (code: workspace_concurrency_limit_exceeded, with a Retry-After header).
POST /v1.0/generations/from-template HTTP/1.1
Host: public-api.gamma.app
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 367
{
"exportAs": "pdf",
"prompt": "Q3 financial summary for investors",
"title": "Q3 Financial Summary",
"gammaId": "gamma_abc123",
"themeId": "theme_xyz789",
"imageOptions": {
"model": "flux-2-pro",
"style": "photorealistic"
},
"sharingOptions": {
"workspaceAccess": "view",
"externalAccess": "none",
"emailOptions": {
"access": "view",
"recipients": [
"user@example.com"
]
}
},
"folderId": "folder_abc"
}{
"generationId": "gen_xyz789",
"warnings": "Some template variables were not found"
}Full workflow with this endpoint, including failure cases: Generate from approved templates. What the template controls: Brand, template, and editing controls.
Related
GET /templates/search to find workspace template IDs for
gammaIdGenerate from template for workflow and parameter guidance
GET /generations/{id} for the polling step after creation
Last updated
Was this helpful?