Templates API
Hosted templates with typed variables, versions and previews.
10 operations. Guide: Build emails from templates. Requests and responses are JSON with snake_case fields; authenticate with Authorization: Bearer <api key>. The examples assume a client built as in SDKs and the command line.
Create a hosted template
POST /v1/templates
Block documents are rendered by the platform; html accepts pre-rendered markup (React Email compiled by the CLI) with {{variables}}. The platform never executes caller code.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | 1 to 100 characters. |
alias | string or null | no | At most 100 characters. |
subject | string or null | no | At most 998 characters. |
from | string or null | no | An email address, optionally with a display name as Name <address>. 3 to 998 characters. |
reply_to | string or array of string | no | One address, or an array of up to 50. |
document | object | no | |
document. | 1 | yes | |
document. | object | no | Default {"width":600,"background":"#f4f4f5","font":"system"}. |
document. | integer | no | 320 to 800. Default 600. |
document. | string | no | Default "#f4f4f5". |
document. | one of "system", "serif", "mono" | no | Default "system". |
document. | string | no | At most 2000 characters. |
document. | array of object | yes | At most 200 items. |
document. | "heading" | yes | |
document. | one of "1", "2", "3" | no | Default "1". |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "paragraph" | yes | |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "image" | yes | |
document. | string | yes | |
document. | string | yes | At most 500 characters. |
document. | string | no | |
document. | integer | no | 16 to 1200. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "button" | yes | |
document. | string | yes | 1 to 200 characters. |
document. | string | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "divider" | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "spacer" | yes | |
document. | integer | yes | 4 to 200. |
document. | "html" | yes | |
document. | string | yes | At most 200000 characters. |
document. | "columns" | yes | |
document. | array of object | yes | At most 3 items. |
document. | array of object | yes | At most 20 items. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
html | string | no | At most 1048576 characters. |
text | string | no | |
variables | array of object | no | At most 100 items. |
variables[]. | string | yes | 1 to 64 characters. |
variables[]. | one of "string", "number", "boolean" | yes | |
variables[]. | string or number or boolean or null | yes | |
variables[]. | boolean | no | |
publish | boolean | no | Default false. |
Response
201 Created: Template.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | A UUID. |
object | "template" | yes | |
project_id | string | yes | A UUID. |
name | string | yes | |
alias | string or null | yes | |
status | one of "draft", "published" | yes | |
engine | one of "blocks", "html" | yes | |
current_version | integer | yes | |
published_version | integer or null | yes | |
subject | string or null | yes | |
from | string or null | yes | |
reply_to | array of string | yes | |
document | object or null | yes | |
document. | 1 | yes | |
document. | object | no | Default {"width":600,"background":"#f4f4f5","font":"system"}. |
document. | integer | no | 320 to 800. Default 600. |
document. | string | no | Default "#f4f4f5". |
document. | one of "system", "serif", "mono" | no | Default "system". |
document. | string | no | At most 2000 characters. |
document. | array of object | yes | At most 200 items. |
document. | "heading" | yes | |
document. | one of "1", "2", "3" | no | Default "1". |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "paragraph" | yes | |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "image" | yes | |
document. | string | yes | |
document. | string | yes | At most 500 characters. |
document. | string | no | |
document. | integer | no | 16 to 1200. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "button" | yes | |
document. | string | yes | 1 to 200 characters. |
document. | string | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "divider" | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "spacer" | yes | |
document. | integer | yes | 4 to 200. |
document. | "html" | yes | |
document. | string | yes | At most 200000 characters. |
document. | "columns" | yes | |
document. | array of object | yes | At most 3 items. |
document. | array of object | yes | At most 20 items. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
html | string or null | yes | |
text | string or null | yes | |
variables | array of object | yes | |
variables[]. | string | yes | 1 to 64 characters. |
variables[]. | one of "string", "number", "boolean" | yes | |
variables[]. | string or number or boolean or null | yes | |
variables[]. | boolean | yes | |
created_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
updated_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
published_at | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X POST https://api.minket.com/v1/templates \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Receipt","alias":"receipt","subject":"Your receipt for order {{order}}","html":"<p>Thanks for order {{order}}.</p>","publish":true}'const result = await minket.templates.create({
name: "Receipt",
alias: "receipt",
subject: "Your receipt for order {{order}}",
html: "<p>Thanks for order {{order}}.</p>",
publish: true
});minket api createTemplate --body '{"name":"Receipt","alias":"receipt","subject":"Your receipt for order {{order}}","html":"<p>Thanks for order {{order}}.</p>","publish":true}'from minket.api.templates import create_template
from minket.models import CreateTemplateBody
result = create_template.sync(client=client, body=CreateTemplateBody.from_dict({"name":"Receipt","alias":"receipt","subject":"Your receipt for order {{order}}","html":"<p>Thanks for order {{order}}.</p>","publish":true}))var body minket.CreateTemplateJSONRequestBody
res, err := client.CreateTemplateWithResponse(ctx, body)List templates
GET /v1/templates
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | no | Default 20. |
after | query | string | no | A UUID. |
before | query | string | no | A UUID. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "list" | yes | |
data | array of object | yes | |
data[]. | string | yes | A UUID. |
data[]. | "template" | yes | |
data[]. | string | yes | A UUID. |
data[]. | string | yes | |
data[]. | string or null | yes | |
data[]. | one of "draft", "published" | yes | |
data[]. | one of "blocks", "html" | yes | |
data[]. | integer | yes | |
data[]. | integer or null | yes | |
data[]. | string or null | yes | |
data[]. | string or null | yes | |
data[]. | array of string | yes | |
data[]. | array of object | yes | |
data[]. | string | yes | 1 to 64 characters. |
data[]. | one of "string", "number", "boolean" | yes | |
data[]. | string or number or boolean or null | yes | |
data[]. | boolean | yes | |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
has_more | boolean | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/templates \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.list();minket api listTemplatesfrom minket.api.templates import list_templates
result = list_templates.sync(client=client)res, err := client.ListTemplatesWithResponse(ctx, &minket.ListTemplatesParams{})Get a template (by id or alias)
GET /v1/templates/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response
200 Success: Template.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | A UUID. |
object | "template" | yes | |
project_id | string | yes | A UUID. |
name | string | yes | |
alias | string or null | yes | |
status | one of "draft", "published" | yes | |
engine | one of "blocks", "html" | yes | |
current_version | integer | yes | |
published_version | integer or null | yes | |
subject | string or null | yes | |
from | string or null | yes | |
reply_to | array of string | yes | |
document | object or null | yes | |
document. | 1 | yes | |
document. | object | no | Default {"width":600,"background":"#f4f4f5","font":"system"}. |
document. | integer | no | 320 to 800. Default 600. |
document. | string | no | Default "#f4f4f5". |
document. | one of "system", "serif", "mono" | no | Default "system". |
document. | string | no | At most 2000 characters. |
document. | array of object | yes | At most 200 items. |
document. | "heading" | yes | |
document. | one of "1", "2", "3" | no | Default "1". |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "paragraph" | yes | |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "image" | yes | |
document. | string | yes | |
document. | string | yes | At most 500 characters. |
document. | string | no | |
document. | integer | no | 16 to 1200. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "button" | yes | |
document. | string | yes | 1 to 200 characters. |
document. | string | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "divider" | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "spacer" | yes | |
document. | integer | yes | 4 to 200. |
document. | "html" | yes | |
document. | string | yes | At most 200000 characters. |
document. | "columns" | yes | |
document. | array of object | yes | At most 3 items. |
document. | array of object | yes | At most 20 items. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
html | string or null | yes | |
text | string or null | yes | |
variables | array of object | yes | |
variables[]. | string | yes | 1 to 64 characters. |
variables[]. | one of "string", "number", "boolean" | yes | |
variables[]. | string or number or boolean or null | yes | |
variables[]. | boolean | yes | |
created_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
updated_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
published_at | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.get("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api getTemplate 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.templates import get_template
result = get_template.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.GetTemplateWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")Update a template (creates a new draft version)
PATCH /v1/templates/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | 1 to 100 characters. |
alias | string or null | no | At most 100 characters. |
subject | string or null | no | At most 998 characters. |
from | string or null | no | An email address, optionally with a display name as Name <address>. 3 to 998 characters. |
reply_to | string or array of string | no | One address, or an array of up to 50. |
document | object | no | |
document. | 1 | yes | |
document. | object | no | Default {"width":600,"background":"#f4f4f5","font":"system"}. |
document. | integer | no | 320 to 800. Default 600. |
document. | string | no | Default "#f4f4f5". |
document. | one of "system", "serif", "mono" | no | Default "system". |
document. | string | no | At most 2000 characters. |
document. | array of object | yes | At most 200 items. |
document. | "heading" | yes | |
document. | one of "1", "2", "3" | no | Default "1". |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "paragraph" | yes | |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "image" | yes | |
document. | string | yes | |
document. | string | yes | At most 500 characters. |
document. | string | no | |
document. | integer | no | 16 to 1200. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "button" | yes | |
document. | string | yes | 1 to 200 characters. |
document. | string | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "divider" | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "spacer" | yes | |
document. | integer | yes | 4 to 200. |
document. | "html" | yes | |
document. | string | yes | At most 200000 characters. |
document. | "columns" | yes | |
document. | array of object | yes | At most 3 items. |
document. | array of object | yes | At most 20 items. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
html | string | no | At most 1048576 characters. |
text | string | no | |
variables | array of object | no | At most 100 items. |
variables[]. | string | yes | 1 to 64 characters. |
variables[]. | one of "string", "number", "boolean" | yes | |
variables[]. | string or number or boolean or null | yes | |
variables[]. | boolean | no | |
publish | boolean | no | Default false. |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "template" | yes | |
id | string | yes | A UUID. |
current_version | integer | yes | |
published_version | integer or null | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X PATCH https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject":"Receipt for order {{order}}"}'const result = await minket.templates.update("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", {
subject: "Receipt for order {{order}}"
});minket api updateTemplate 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b --body '{"subject":"Receipt for order {{order}}"}'from minket.api.templates import update_template
from minket.models import UpdateTemplateBody
result = update_template.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client, body=UpdateTemplateBody.from_dict({"subject":"Receipt for order {{order}}"}))var body minket.UpdateTemplateJSONRequestBody
res, err := client.UpdateTemplateWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", body)Delete a template
DELETE /v1/templates/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "template" | yes | |
id | string | yes | |
deleted | true | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X DELETE https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.delete("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api deleteTemplate 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.templates import delete_template
result = delete_template.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.DeleteTemplateWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")Publish the current draft version
POST /v1/templates/{id}/publish
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "template" | yes | |
id | string | yes | A UUID. |
current_version | integer | yes | |
published_version | integer or null | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X POST https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/publish \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.publish("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api publishTemplate 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.templates import publish_template
result = publish_template.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.PublishTemplateWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")Duplicate a template
POST /v1/templates/{id}/duplicate
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response
201 Created: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "template" | yes | |
id | string | yes | A UUID. |
current_version | integer | yes | |
published_version | integer or null | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X POST https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/duplicate \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.duplicate("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api duplicateTemplate 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.templates import duplicate_template
result = duplicate_template.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.DuplicateTemplateWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")List a template's versions
GET /v1/templates/{id}/versions
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
object | "list" | yes | |
data | array of object | yes | |
data[]. | integer | yes | |
data[]. | string or null | yes | |
data[]. | object or null | yes | |
data[]. | 1 | yes | |
data[]. | object | no | Default {"width":600,"background":"#f4f4f5","font":"system"}. |
data[]. | integer | no | 320 to 800. Default 600. |
data[]. | string | no | Default "#f4f4f5". |
data[]. | one of "system", "serif", "mono" | no | Default "system". |
data[]. | string | no | At most 2000 characters. |
data[]. | array of object | yes | At most 200 items. |
data[]. | "heading" | yes | |
data[]. | one of "1", "2", "3" | no | Default "1". |
data[]. | string | yes | At most 20000 characters. |
data[]. | object | no | |
data[]. | "paragraph" | yes | |
data[]. | string | yes | At most 20000 characters. |
data[]. | object | no | |
data[]. | "image" | yes | |
data[]. | string | yes | |
data[]. | string | yes | At most 500 characters. |
data[]. | string | no | |
data[]. | integer | no | 16 to 1200. |
data[]. | object | no | |
data[]. | "button" | yes | |
data[]. | string | yes | 1 to 200 characters. |
data[]. | string | yes | |
data[]. | object | no | |
data[]. | "divider" | yes | |
data[]. | object | no | |
data[]. | "spacer" | yes | |
data[]. | integer | yes | 4 to 200. |
data[]. | "html" | yes | |
data[]. | string | yes | At most 200000 characters. |
data[]. | "columns" | yes | |
data[]. | array of object | yes | At most 3 items. |
data[]. | object | no | |
data[]. | string or null | yes | |
data[]. | string or null | yes | |
data[]. | array of object | yes | |
data[]. | string | yes | 1 to 64 characters. |
data[]. | one of "string", "number", "boolean" | yes | |
data[]. | string or number or boolean or null | yes | |
data[]. | boolean | yes | |
data[]. | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
data[]. | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
has_more | boolean | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/versions \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.versions("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b");minket api listTemplateVersions 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5bfrom minket.api.templates import list_template_versions
result = list_template_versions.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client)res, err := client.ListTemplateVersionsWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b")Get one version
GET /v1/templates/{id}/versions/{version}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
version | path | integer | yes |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
version | integer | yes | |
subject | string or null | yes | |
document | object or null | yes | |
document. | 1 | yes | |
document. | object | no | Default {"width":600,"background":"#f4f4f5","font":"system"}. |
document. | integer | no | 320 to 800. Default 600. |
document. | string | no | Default "#f4f4f5". |
document. | one of "system", "serif", "mono" | no | Default "system". |
document. | string | no | At most 2000 characters. |
document. | array of object | yes | At most 200 items. |
document. | "heading" | yes | |
document. | one of "1", "2", "3" | no | Default "1". |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "paragraph" | yes | |
document. | string | yes | At most 20000 characters. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "image" | yes | |
document. | string | yes | |
document. | string | yes | At most 500 characters. |
document. | string | no | |
document. | integer | no | 16 to 1200. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "button" | yes | |
document. | string | yes | 1 to 200 characters. |
document. | string | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "divider" | yes | |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
document. | "spacer" | yes | |
document. | integer | yes | 4 to 200. |
document. | "html" | yes | |
document. | string | yes | At most 200000 characters. |
document. | "columns" | yes | |
document. | array of object | yes | At most 3 items. |
document. | array of object | yes | At most 20 items. |
document. | object | no | |
document. | string | no | |
document. | string | no | |
document. | one of "left", "center", "right" | no | |
document. | integer | no | 0 to 80. |
html | string or null | yes | |
text | string or null | yes | |
variables | array of object | yes | |
variables[]. | string | yes | 1 to 64 characters. |
variables[]. | one of "string", "number", "boolean" | yes | |
variables[]. | string or number or boolean or null | yes | |
variables[]. | boolean | yes | |
published_at | string (date-time) or null | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
created_at | string (date-time) | yes | An ISO 8601 timestamp with timezone, for example 2026-10-24T18:00:00.000Z. |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/versions/1 \
-H "Authorization: Bearer $MINKET_API_KEY"const result = await minket.templates.version("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", 1);minket api getTemplateVersion 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b 1from minket.api.templates import get_template_version
result = get_template_version.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", 1, client=client)res, err := client.GetTemplateVersionWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", 1)Render a template with variables
POST /v1/templates/{id}/preview
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
variables | map of string or number or boolean or null | no | |
version | integer | no |
Response
200 Success: object.
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | yes | |
html | string | yes | |
text | string | yes | |
missing | array of string | yes |
Errors: 400, 401, 403, 404, 409, 422, 429, 500, with the error body.
Examples
curl -X POST https://api.minket.com/v1/templates/019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b/preview \
-H "Authorization: Bearer $MINKET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"variables":{"order":"10452"}}'const result = await minket.templates.preview("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", {
variables: {
order: "10452"
}
});minket api previewTemplate 019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b --body '{"variables":{"order":"10452"}}'from minket.api.templates import preview_template
from minket.models import PreviewTemplateBody
result = preview_template.sync("019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", client=client, body=PreviewTemplateBody.from_dict({"variables":{"order":"10452"}}))var body minket.PreviewTemplateJSONRequestBody
res, err := client.PreviewTemplateWithResponse(ctx, "019a2b3c-4d5e-7f60-8a9b-0c1d2e3f4a5b", body)