> 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/create-templateasset.md). Agents can also search and read this documentation through its [MCP server](https://synap.ac/docs/~gitbook/mcp).

# Create TemplateAsset

Starts the upload of an image or a font for a managed template, as an admin of the main portal. The answer says where to send the file in upload, and the file then has to be completed. The address of the file is made by the server from the template and the asset, never from what is sent here. An image is a PNG, JPEG or WebP of up to 8388608 bytes, with no side longer than 8192 pixels and no more than 41943040 pixels in all, and not animated, or an SVG of up to 10485760 bytes, which is cleaned up when it is completed: scripts, links to other files and anything that is not drawn are removed. A font is a WOFF2, WOFF, TTF or OTF file of up to 3145728 bytes. A template can have up to 40 files that are ready or still being uploaded, and an upload has 60 minutes. A legacy template has no files, and neither can an archived one be given any.

```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":{"ObjectId":{"type":"string","description":"The primary key for each resource."},"TemplateAsset":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["TemplateAsset"]},"attributes":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["pending","ready","rejected"],"readOnly":true,"description":"Pending until the file has been checked by completing the asset, ready when it was accepted, rejected when it was refused. Only a ready asset can be used in a template."},"filename":{"type":"string","readOnly":true,"description":"The name of the file as it was uploaded, without control characters and up to 120 characters."},"contentType":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/svg+xml","font/woff2","font/woff","font/ttf","font/otf"],"readOnly":true},"size":{"type":"integer","readOnly":true,"description":"The size in bytes that was declared for the upload."},"bytes":{"type":"integer","nullable":true,"readOnly":true,"description":"The size in bytes of the file as it is stored. An SVG is stored after it has been cleaned up, so this can differ from the size that was declared. Null until the asset is ready."},"width":{"type":"integer","nullable":true,"readOnly":true,"description":"In pixels. For an SVG it is read from its width and height, or from its viewBox. Null until the asset is ready, and always null for a font."},"height":{"type":"integer","nullable":true,"readOnly":true,"description":"In pixels. For an SVG it is read from its width and height, or from its viewBox. Null until the asset is ready, and always null for a font."},"url":{"type":"string","nullable":true,"readOnly":true,"description":"The public address of the file. A template refers to the file by this address and by no other, and the address always is the same file. Null until the asset is ready."},"rejectionCode":{"type":"string","nullable":true,"readOnly":true,"description":"The code of the error that refused the file, such as template-asset-dimensions. Null unless the asset is rejected."},"expiresAt":{"type":"string","format":"date-time","readOnly":true,"description":"The time the upload has to be completed by, 60 minutes after the asset was created. An asset that has not been completed by then cannot be, and no longer counts towards the 40 a template can have."},"createdAt":{"type":"string","format":"date-time","readOnly":true},"upload":{"type":"object","readOnly":true,"required":["url","method","headers"],"description":"How to send the file, in the answer to creating the asset only. Send the file as the body of a request to the url with this method and exactly these headers, then complete the asset. The url can be used for an hour.","properties":{"url":{"type":"string","description":"The address the file is sent to."},"method":{"type":"string","enum":["PUT"]},"headers":{"type":"object","required":["Content-Type"],"description":"The headers to send with the file. The upload is refused unless the Content-Type is exactly this value and the body is exactly the size that was declared.","properties":{"Content-Type":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/svg+xml","font/woff2","font/woff","font/ttf","font/otf"]}}}}}}},"relationships":{"type":"object","properties":{"template":{"type":"object","description":"The managed template the file belongs to, which has to be in the portal of the requester, not archived. An asset belongs to one template and only that template can use it.","readOnly":true,"properties":{"data":{"type":"object","required":["id","type"],"nullable":false,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["Template"]}}}}}}}}},"BackgroundJob":{"type":"object","required":["id","type"],"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["BackgroundJob"]},"attributes":{"type":"object","properties":{"id":{"type":"string","readOnly":true},"createdAt":{"type":"string","readOnly":true},"timeStarted":{"type":"string","readOnly":true},"timeCompleted":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":true},"status":{"type":"string","enum":["queued","delayed","started","stalled","successful","failed","panic"],"readOnly":true},"progress":{"type":"number","readOnly":true},"message":{"type":"string","readOnly":true},"data":{"type":"array","readOnly":true,"items":{"type":"array","readOnly":true,"items":{"oneOf":[{"type":"string"},{"type":"object"}],"maxItems":2}}},"params":{"type":"object","readOnly":true},"error":{"type":"string","readOnly":true},"result":{"type":"object","readOnly":true,"nullable":true}}},"relationships":{"type":"object","properties":{}}}},"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"}}}}},"NotFoundApiError":{"type":"object","description":"The request resource could not be found.","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"}}}}},"ApiError":{"type":"object","description":"This is an error response structure. The id, status, code, title and detail will vary based on the error situation.","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":{"/template-assets":{"post":{"summary":"Create TemplateAsset","description":"Starts the upload of an image or a font for a managed template, as an admin of the main portal. The answer says where to send the file in upload, and the file then has to be completed. The address of the file is made by the server from the template and the asset, never from what is sent here. An image is a PNG, JPEG or WebP of up to 8388608 bytes, with no side longer than 8192 pixels and no more than 41943040 pixels in all, and not animated, or an SVG of up to 10485760 bytes, which is cleaned up when it is completed: scripts, links to other files and anything that is not drawn are removed. A font is a WOFF2, WOFF, TTF or OTF file of up to 3145728 bytes. A template can have up to 40 files that are ready or still being uploaded, and an upload has 60 minutes. A legacy template has no files, and neither can an archived one be given any.","tags":["Certificates"],"parameters":[],"requestBody":{"required":true,"content":{"application/vnd.api+json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["type","attributes","relationships"],"properties":{"type":{"type":"string","description":"Identifies the Resource.","enum":["TemplateAsset"]},"attributes":{"type":"object","additionalProperties":false,"required":["filename","contentType","size"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the file, for people to recognise it by. It is not used to find the file, and what is not a letter or a number is left out of the address of the file."},"contentType":{"type":"string","description":"The type of the file: image/png, image/jpeg, image/webp, image/svg+xml, font/woff2, font/woff, font/ttf, font/otf. Anything else is refused with template-asset-type-not-allowed. The upload is pinned to it, and the file is checked against it when the asset is completed."},"size":{"type":"integer","description":"The size of the file in bytes, from 1 to 8388608 for a PNG, JPEG or WebP, 10485760 for an SVG and 3145728 for a font. Anything outside is refused with template-asset-empty or template-asset-too-large. The upload is pinned to exactly this size."}}},"relationships":{"type":"object","required":["template"],"properties":{"template":{"type":"object","description":"The managed template the file belongs to, which has to be in the portal of the requester, not archived. An asset belongs to one template and only that template can use it.","readOnly":false,"properties":{"data":{"type":"object","required":["id","type"],"nullable":false,"properties":{"id":{"$ref":"#/components/schemas/ObjectId"},"type":{"type":"string","description":"Identifies the Resource.","enum":["Template"]}}}}}}}}}}}}}},"responses":{"201":{"description":"Created","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TemplateAsset"}}}}}},"202":{"description":"Accepted","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BackgroundJob"}}}}}},"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"}}}}}}},"404":{"description":"Not Found","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/NotFoundApiError"}}}}}}},"409":{"description":"Conflict","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"operationId":"templateAssets.createTemplateAsset"}}}}
```


---

# 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/create-templateasset.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.
