> For the complete documentation index, see [llms.txt](https://developers.gamma.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gamma.app/management/search-templates.md).

# GET /templates/search

Search workspace templates and official Gamma explore templates. With a query, workspace hits rank by title and body text relevance and may fall back to last-edited order.

Search workspace templates and official Gamma explore templates in one request, with optional relevance ranking when you pass `q`.

## Search templates

> Search the caller's workspace templates and the official Gamma explore templates. Returns two lists. With a query, workspace templates use best-effort relevance ranking against title and body text and may fall back to last-edited browse order, while explore templates use their best-effort ranking. An empty query returns both lists in browse order. Workspace browse results use last-edited order, most recent first. Workspace template IDs can be passed as the gammaId to generate-from-template, which validates eligibility at generation time and may reject some templates, such as multi-page or site-bound ones. Explore templates (the official Gamma templates) are not accepted as the gammaId for generate-from-template.

```json
{"openapi":"3.0.0","info":{"title":"Gamma Public API","version":"1.0"},"tags":[{"name":"public-api","description":"Public API endpoints for external integrations"}],"servers":[{"url":"https://public-api.gamma.app","description":"Production"}],"security":[{"api-key":[]},{"bearer":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key for authentication"},"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"OAuth bearer token for authentication"}},"schemas":{"SearchTemplatesResponse":{"type":"object","properties":{"workspaceTemplates":{"description":"Hits from the caller's workspace templates. With a query, hits use best-effort relevance ranking and may fall back to last-edited browse order. Without a query, hits are ordered by last edit, most recent first. IDs can be passed as the gammaId to generate-from-template, which validates eligibility at generation time and may reject some templates.","type":"array","items":{"$ref":"#/components/schemas/WorkspaceTemplateSearchHit"}},"workspaceDegraded":{"type":"boolean","description":"True when workspace relevance ranking failed and workspaceTemplates use last-edited browse order. Omitted otherwise."},"exploreTemplates":{"description":"Hits from the official Gamma templates, relevance-ranked when a query is\nprovided. Ranking is best-effort. Not accepted as the gammaId for\ngenerate-from-template.","type":"array","items":{"$ref":"#/components/schemas/ExploreTemplateSearchHit"}}},"required":["workspaceTemplates","exploreTemplates"]},"WorkspaceTemplateSearchHit":{"type":"object","properties":{"id":{"type":"string","description":"Template identifier, to pass as the gammaId to generate-from-template"},"title":{"type":"string","nullable":true,"description":"Template title, or null if untitled"},"url":{"type":"string","description":"URL to view the template"},"previewUrl":{"type":"string","nullable":true,"description":"Screenshot URL, or null if unavailable. Usually signed so it loads without a Gamma session; a signed URL expires after about 7 days, so re-fetch it rather than storing it."}},"required":["id","title","url","previewUrl"]},"ExploreTemplateSearchHit":{"type":"object","properties":{"id":{"type":"string","description":"Template identifier. Not accepted as the gammaId for generate-from-template."},"title":{"type":"string","nullable":true,"description":"Template title, or null if untitled"},"url":{"type":"string","description":"URL to view the template"},"thumbnailUrl":{"type":"string","nullable":true,"description":"Thumbnail image URL, or null if unavailable"},"previewUrl":{"type":"string","nullable":true,"description":"Preview image URL, or null if unavailable"}},"required":["id","title","url","thumbnailUrl","previewUrl"]}}},"paths":{"/v1.0/templates/search":{"get":{"description":"Search the caller's workspace templates and the official Gamma explore templates. Returns two lists. With a query, workspace templates use best-effort relevance ranking against title and body text and may fall back to last-edited browse order, while explore templates use their best-effort ranking. An empty query returns both lists in browse order. Workspace browse results use last-edited order, most recent first. Workspace template IDs can be passed as the gammaId to generate-from-template, which validates eligibility at generation time and may reject some templates, such as multi-page or site-bound ones. Explore templates (the official Gamma templates) are not accepted as the gammaId for generate-from-template.","operationId":"searchTemplates","parameters":[{"name":"q","required":false,"in":"query","description":"Search query. Workspace templates use best-effort relevance ranking against title and body text and may fall back to last-edited browse order. Explore templates use their ranked search. When omitted, both lists are a browse.","schema":{"maxLength":2000,"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Maximum number of hits to return per list (1-25)","schema":{"minimum":1,"maximum":25,"type":"number"}}],"responses":{"200":{"description":"Search results retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchTemplatesResponse"}}}},"400":{"description":"Invalid query parameters"},"401":{"description":"Invalid or missing credentials"}},"summary":"Search templates","tags":["public-api"]}}}}
```

{% hint style="info" %}
Returns `workspaceTemplates` and `exploreTemplates` separately. With `q`, workspace templates rank by best-effort relevance on title and body text and may fall back to last-edited order; `workspaceDegraded` is true when that fallback occurred. Explore templates use their own ranked search. Workspace template IDs can be passed as `gammaId` to [POST /generations/from-template](https://developers.gamma.app/generations-classic/create-from-template.md); eligibility is validated at generation time and some templates may be rejected (for example, multi-page or site-bound ones). Explore templates (the official Gamma templates) are not accepted as the `gammaId` for generate-from-template. When present, each workspace hit's `previewUrl` is a signed screenshot URL that usually loads without a Gamma session; it expires after about 7 days, so re-fetch this endpoint rather than storing preview URLs long term. Omit `q` to browse both lists; use `limit` (1–25) to cap hits per list. Supports `X-API-KEY` or OAuth Bearer token.
{% endhint %}

## Related

* [POST /generations/from-template](https://developers.gamma.app/generations-classic/create-from-template.md) to generate from a workspace template ID
* [Generate from template](https://developers.gamma.app/guides/create-from-template-api-parameters-explained.md) for workflow and parameter guidance
* [GET /gammas/search](https://developers.gamma.app/management/search-gammas.md) to search existing gammas by title and body text


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.gamma.app/management/search-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
