> For the complete documentation index, see [llms.txt](https://synap.ac/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://synap.ac/docs/api/reference/certificates/list-templates.md). Agents can also search and read this documentation through its [MCP server](https://synap.ac/docs/~gitbook/mcp).

# List Templates

Without a kind, the legacy templates of the portal and the built in ones for the usage, by name, which is what the certificate pickers offer, open to everyone who is signed in. For a usage of exam or assignment they carry only what the pickers read: the name, the html, whether it is a built in one, the orientation and the preview. A kind of managed lists the managed templates only and any lists both, by name then id, for an educator, manager or admin. Those listings, and a usage of any, also report the usage, the kind, the status, the parts, the draft, whether the template is archived and the other fields of managed templates. They leave out archived templates unless isArchived asks for them. They also depend on the sub-portal of the requester. Someone who is not in a sub-portal sees every managed template of the portal, those limited to a sub-portal included. Someone in a sub-portal sees the managed templates limited to that sub-portal and those of the whole portal that are not marked as unavailable to sub-portals, archived ones under the same rule, and nothing else. The legacy templates and the built in ones are the same for everyone.

```json
{"openapi":"3.0.1","info":{"title":"Synap API","version":"3.0.0"},"tags":[{"name":"Certificates","description":"Endpoints related to Certificates."}],"servers":[{"url":"https://api.synap.ac/v3","description":"Production"},{"url":"https://api-stage.synap.ac/v3","description":"Staging"}],"security":[{"SessionAuth":[]},{"PATAuth":[]},{"AutomationAuth":[]},{"LegacySessionAuth":[]}],"components":{"securitySchemes":{"SessionAuth":{"type":"http","scheme":"bearer","description":"Authorize the request using a Session Token.","bearerFormat":"r:<token>"},"PATAuth":{"type":"http","scheme":"bearer","description":"Authorise the request using a personal access token.","bearerFormat":"p:"},"AutomationAuth":{"type":"http","scheme":"bearer","description":"Authorise the request with a short-lived token signed by the automations engine on behalf of a workflow owner.","bearerFormat":"a:<token>"},"LegacySessionAuth":{"type":"apiKey","description":"[Legacy] Authorize the request using a Session Token.","in":"header","name":"X-Syn-Session-Token"}},"schemas":{"Template":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["Template"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","description":"Up to 120 characters. It can be changed on a managed template, and not on a legacy one."},"htmlTemplate":{"type":"string","readOnly":true,"description":"The complete document of a legacy template. A managed template does not send it."},"isDefault":{"type":"boolean","readOnly":true,"description":"Whether this is one of the built in templates."},"orientation":{"type":"string","enum":["landscape","portrait"],"readOnly":true,"description":"The orientation certificates are issued in. It is set when a managed template is created, and changed by putting orientation in the draft and publishing the template."},"preview":{"type":"object","readOnly":true,"properties":{"svg":{"type":"string"},"image":{"type":"string"}}},"usage":{"type":"string","enum":["exam","assignment"],"readOnly":true,"description":"What the template is issued for. A template stored without a usage is reported as an exam template. It cannot change once a managed template exists."},"kind":{"type":"string","enum":["legacy","managed"],"readOnly":true,"description":"Managed templates are edited here. Legacy templates are written by Synap and cannot be edited, published or deleted here."},"status":{"type":"string","enum":["draft","published"],"readOnly":true,"description":"Draft until the first publish. Legacy templates are always published."},"hasUnpublishedChanges":{"type":"boolean","readOnly":true,"description":"Whether the draft differs from the published parts or stages a different orientation from the one being issued, or nothing has been published yet."},"shellVersion":{"type":"integer","nullable":true,"readOnly":true,"description":"The version of the Synap-owned shell the published parts were compiled with."},"parts":{"type":"object","required":["body","css"],"additionalProperties":false,"description":"The published parts. Managed templates only.","properties":{"body":{"type":"string","maxLength":200000,"description":"An HTML fragment that may contain Go template actions."},"css":{"type":"string","maxLength":200000,"description":"CSS, scoped to the content box when compiled."},"contentInset":{"type":"integer","minimum":0,"maximum":30,"default":10,"description":"Safe area inside the A4 sheet, in millimetres. Defaults to 10."},"background":{"type":"object","nullable":true,"required":["url","fit"],"additionalProperties":false,"description":"The image that fills the whole page behind the content. It can only be set here, as the style of the template cannot reach it. Null or left out for no background. The url has to be the address of an image uploaded to this template, and publishing or previewing refuses any address of another place.","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"The url of an image uploaded to this template."},"fit":{"type":"string","enum":["cover","contain","stretch"],"description":"How the image fills the page. Cover scales it until it covers the page and crops what does not fit, contain scales it until all of it fits in the page, and stretch fills the page whatever the proportions of the image."}}}},"nullable":true,"readOnly":true},"draft":{"type":"object","required":["body","css"],"additionalProperties":false,"description":"The parts being edited, with the orientation they will be published with, not yet published. Replaced as a whole when sent. Managed templates only.","properties":{"body":{"type":"string","maxLength":200000,"description":"An HTML fragment that may contain Go template actions."},"css":{"type":"string","maxLength":200000,"description":"CSS, scoped to the content box when compiled."},"contentInset":{"type":"integer","minimum":0,"maximum":30,"default":10,"description":"Safe area inside the A4 sheet, in millimetres. Defaults to 10."},"background":{"type":"object","nullable":true,"required":["url","fit"],"additionalProperties":false,"description":"The image that fills the whole page behind the content. It can only be set here, as the style of the template cannot reach it. Null or left out for no background. The url has to be the address of an image uploaded to this template, and publishing or previewing refuses any address of another place.","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"The url of an image uploaded to this template."},"fit":{"type":"string","enum":["cover","contain","stretch"],"description":"How the image fills the page. Cover scales it until it covers the page and crops what does not fit, contain scales it until all of it fits in the page, and stretch fills the page whatever the proportions of the image."}}},"orientation":{"type":"string","enum":["landscape","portrait"],"description":"The orientation the template is issued in once this draft is published. When a request leaves it out, the orientation already staged in the draft is kept, or the orientation being issued when nothing is staged."}},"nullable":true},"isArchived":{"type":"boolean","readOnly":false,"description":"Whether the template has been archived. Archived templates are listed only when asked for, cannot be chosen for new settings and cannot be edited until they are unarchived. Send true to archive a published template and false to unarchive it, on its own, as an admin of the main portal. Sending the value it already has changes nothing. Legacy templates are never archived."},"availableToSubPortals":{"type":"boolean","nullable":true,"description":"Whether sub-portals may use this template. Only a template that is not limited to a sub-portal has it: true unless it was set to false, and false means only the main portal may choose it for its exams and assignments, and the people of a sub-portal neither see it listed nor find it. Null for a template limited to a sub-portal and for a legacy template. It can be changed whenever the template is not archived, and only affects what is chosen from then on."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true}}},"relationships":{"type":"object","properties":{"subPortal":{"type":"object","description":"The sub-portal this template is limited to, which must belong to the portal of the requester. Empty for a template of the whole portal. It can only be set when the template is created. Only the people of that sub-portal and of the main portal see a template limited to a sub-portal.","readOnly":true,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["SubPortal"]}}}}},"owner":{"type":"object","description":"This is a resource linkage for a to-one relationship. It is like a Parse Pointer.","readOnly":true,"properties":{"data":{"type":"object","required":["id","type"],"nullable":true,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["User"]}}}}}}}}},"ObjectId":{"type":"string","description":"The primary key for each resource."},"BadRequestApiError":{"type":"object","description":"The request was invalid.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}},"UnauthorizedApiError":{"type":"object","description":"Unauthorized request.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}},"ForbiddenApiError":{"type":"object","description":"Forbidden request.","properties":{"id":{"type":"string","description":"Unique ID of this error occurrence."},"status":{"type":"string","description":"HTTP status code."},"code":{"type":"string","description":"Synap internal error code."},"title":{"type":"string"},"detail":{"type":"string"},"source":{"type":"object","properties":{"pointer":{"type":"string"},"parameter":{"type":"string"}}}}}}},"paths":{"/templates":{"get":{"summary":"List Templates","description":"Without a kind, the legacy templates of the portal and the built in ones for the usage, by name, which is what the certificate pickers offer, open to everyone who is signed in. For a usage of exam or assignment they carry only what the pickers read: the name, the html, whether it is a built in one, the orientation and the preview. A kind of managed lists the managed templates only and any lists both, by name then id, for an educator, manager or admin. Those listings, and a usage of any, also report the usage, the kind, the status, the parts, the draft, whether the template is archived and the other fields of managed templates. They leave out archived templates unless isArchived asks for them. They also depend on the sub-portal of the requester. Someone who is not in a sub-portal sees every managed template of the portal, those limited to a sub-portal included. Someone in a sub-portal sees the managed templates limited to that sub-portal and those of the whole portal that are not marked as unavailable to sub-portals, archived ones under the same rule, and nothing else. The legacy templates and the built in ones are the same for everyone.","tags":["Certificates"],"parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"object","properties":{"usage":{"type":"string","enum":["exam","assignment","any"],"description":"The usage to list. Exam when it is left out, and any lists both usages."},"kind":{"type":"string","enum":["legacy","managed","any"],"description":"Which templates to list. Legacy when it is left out. Managed and any need an educator, manager or admin, and list only the managed templates available to the sub-portal of the requester, when they are in one."},"isArchived":{"type":"string","enum":["true","false","any"],"description":"Omit or false for templates that are not archived, true for archived templates only, any for both. Legacy templates and the built in ones are never archived."}}}},{"name":"page","in":"query","required":false,"schema":{"type":"object","required":["limit","offset"],"properties":{"limit":{"type":"number","minimum":1},"offset":{"type":"number","minimum":0}}}}],"responses":{"200":{"description":"Success","content":{"application/vnd.api+json":{"schema":{"required":["data"],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"meta":{"type":"object","required":["total","pages","page","offset","limit"],"properties":{"total":{"type":"integer"},"totalWithoutFilters":{"type":"integer"},"pages":{"type":"integer"},"page":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"},"totalCount":{"type":"integer","deprecated":true},"resultCount":{"type":"integer","deprecated":true},"totalPages":{"type":"integer","deprecated":true},"currentPage":{"type":"integer","deprecated":true}}}}}}}},"400":{"description":"Bad Request","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/BadRequestApiError"}}}}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/UnauthorizedApiError"}}}}}}},"403":{"description":"Forbidden","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ForbiddenApiError"}}}}}}}},"operationId":"templates.findTemplates"}}}}
```


---

# 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://synap.ac/docs/api/reference/certificates/list-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.
