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

# Complete TemplateAsset

Checks the file that was uploaded, as an admin of the main portal, and when it is an acceptable image or font makes it ready, with its public address. A file that is not acceptable is refused with the code template-asset- followed by what is wrong (empty, size-mismatch, too-large, not-an-image, not-a-font, type-mismatch, corrupt, animated, dimensions or missing), and the asset is rejected for good. An upload that took longer than 60 minutes is refused with template-asset-expired. Completing a ready asset again answers it again, and completing a rejected one refuses it in the same way. When the check could not be made the answer is a server error and the asset stays pending, so completing it can be tried again.

```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"]}}}}}}}}},"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"}}}}}}},"paths":{"/template-assets/{object_id}/complete":{"post":{"summary":"Complete TemplateAsset","description":"Checks the file that was uploaded, as an admin of the main portal, and when it is an acceptable image or font makes it ready, with its public address. A file that is not acceptable is refused with the code template-asset- followed by what is wrong (empty, size-mismatch, too-large, not-an-image, not-a-font, type-mismatch, corrupt, animated, dimensions or missing), and the asset is rejected for good. An upload that took longer than 60 minutes is refused with template-asset-expired. Completing a ready asset again answers it again, and completing a rejected one refuses it in the same way. When the check could not be made the answer is a server error and the asset stays pending, so completing it can be tried again.","tags":["Certificates"],"parameters":[{"name":"object_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ObjectId"}}],"responses":{"200":{"description":"Success","content":{"application/vnd.api+json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/TemplateAsset"}}}}}},"400":{"description":"Bad Request. The file was refused, or the upload expired. The code says why, and the message can be shown to the person who uploaded it.","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: the requester is not an admin of the main portal.","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"}}}}}}}},"operationId":"templateAssets.completeTemplateAsset"}}}}
```


---

# 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/complete-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.
