Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.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`.
const url = 'https://example.com/v1/templates/example/versions/example/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":"example","locale":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The template data, validated against the template version’s schema before rendering.
A locale the template version declares.
Examplegenerated
{ "data": "example", "locale": "example"}Responses
Section titled “Responses”The operation succeeded.
object
object
The segment count, for an SMS template only.
object
object
Example
{ "channel": "email", "sms": { "encoding": "gsm7" }}A problem: request.invalid.
object
Example
{ "code": "request.invalid", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}A problem: authentication.refused.
object
Example
{ "code": "authentication.refused", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}Headers
Section titled “Headers”The bearer challenge.
A problem: operation.not-authorized, profile.not-authorized.
object
Example
{ "code": "operation.not-authorized", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}A problem: template.not-found.
object
Example
{ "code": "template.not-found", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}A problem: request.method-not-allowed.
object
Example
{ "code": "request.method-not-allowed", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}A problem: request.body-too-large.
object
Example
{ "code": "request.body-too-large", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}A problem: request.unsupported-media-type.
object
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.
object
Example
{ "code": "request.unprocessable", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}A problem: service.unavailable.
object
Example
{ "code": "service.unavailable", "type": "https://id.registrystack.org/problems/registry-messaging/authentication/refused"}Headers
Section titled “Headers”Whole seconds to wait before trying again.