Skip to content
Registry StackDocsv0.39.0

Render a template version of the active package with the given locale and data, for a sender whose profile lists the template. Nothing is persisted; the body is byte-identical to `messagingctl preview --format json`.

POST
/v1/templates/{template_id}/versions/{version}/preview
curl --request POST \
--url https://example.com/v1/templates/example/versions/example/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "data": "example", "locale": "example" }'
template_id
required
string
>= 1 characters
version
required
string
>= 1 characters
Media typeapplication/json
object
data
required

The template data, validated against the template version’s schema before rendering.

locale
required

A locale the template version declares.

string
Examplegenerated
{
"data": "example",
"locale": "example"
}

The operation succeeded.

Media typeapplication/json
object
channel
required
string
Allowed values: email sms
locale
required
string
packageDigest
required
string
/^sha256:[0-9a-f]{64}$/
parts
required
object
html
string
subject
string
text
required
string
sms

The segment count, for an SMS template only.

object
encoding
required
string
Allowed values: gsm7 ucs2
segments
required
integer
>= 1
units
required
integer
template
required
object
id
required
string
version
required
string
Example
{
"channel": "email",
"sms": {
"encoding": "gsm7"
}
}

A problem: request.invalid.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: request.invalid
Example
{
"code": "request.invalid",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: authentication.refused.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: authentication.refused
Example
{
"code": "authentication.refused",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}
WWW-Authenticate
required
string
Allowed value: Bearer

The bearer challenge.

A problem: operation.not-authorized, profile.not-authorized.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: operation.not-authorized profile.not-authorized
Example
{
"code": "operation.not-authorized",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: template.not-found.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: template.not-found
Example
{
"code": "template.not-found",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: request.method-not-allowed.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: request.method-not-allowed
Example
{
"code": "request.method-not-allowed",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: request.body-too-large.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: request.body-too-large
Example
{
"code": "request.body-too-large",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: request.unsupported-media-type.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: request.unsupported-media-type
Example
{
"code": "request.unsupported-media-type",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: request.unprocessable, template.data-invalid, template.locale-unavailable, template.render-refused, content.too-large.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: request.unprocessable template.data-invalid template.locale-unavailable template.render-refused content.too-large
Example
{
"code": "request.unprocessable",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}

A problem: service.unavailable.

Media typeapplication/problem+json
object
code
required
string
Allowed values: authentication.refused callback.unreadable callback.unverified content.invalid content.too-large content.too-many-segments idempotency.expired idempotency.key-reused message.dispatch-started message.not-visible message.terminal operation.not-authorized profile.not-authorized quota.exceeded rate-limit.exceeded request.body-too-large request.invalid request.method-not-allowed request.not-found request.unprocessable request.unsupported-media-type service.unavailable template.data-invalid template.locale-unavailable template.not-found template.render-refused
detail
required
string
status
required
integer
title
required
string
traceId
required
string
type
required
string
Allowed values: https://id.registrystack.org/problems/registry-messaging/authentication/refused https://id.registrystack.org/problems/registry-messaging/callback/unreadable https://id.registrystack.org/problems/registry-messaging/callback/unverified https://id.registrystack.org/problems/registry-messaging/content/invalid https://id.registrystack.org/problems/registry-messaging/content/too-large https://id.registrystack.org/problems/registry-messaging/content/too-many-segments https://id.registrystack.org/problems/registry-messaging/idempotency/expired https://id.registrystack.org/problems/registry-messaging/idempotency/key-reused https://id.registrystack.org/problems/registry-messaging/message/dispatch-started https://id.registrystack.org/problems/registry-messaging/message/not-visible https://id.registrystack.org/problems/registry-messaging/message/terminal https://id.registrystack.org/problems/registry-messaging/operation/not-authorized https://id.registrystack.org/problems/registry-messaging/profile/not-authorized https://id.registrystack.org/problems/registry-messaging/quota/exceeded https://id.registrystack.org/problems/registry-messaging/rate-limit/exceeded https://id.registrystack.org/problems/registry-messaging/request/body-too-large https://id.registrystack.org/problems/registry-messaging/request/invalid https://id.registrystack.org/problems/registry-messaging/request/method-not-allowed https://id.registrystack.org/problems/registry-messaging/request/not-found https://id.registrystack.org/problems/registry-messaging/request/unprocessable https://id.registrystack.org/problems/registry-messaging/request/unsupported-media-type https://id.registrystack.org/problems/registry-messaging/service/unavailable https://id.registrystack.org/problems/registry-messaging/template/data-invalid https://id.registrystack.org/problems/registry-messaging/template/locale-unavailable https://id.registrystack.org/problems/registry-messaging/template/not-found https://id.registrystack.org/problems/registry-messaging/template/render-refused
code
required
Allowed values: service.unavailable
Example
{
"code": "service.unavailable",
"type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"
}
Retry-After
required
integer
>= 1

Whole seconds to wait before trying again.