> For the complete documentation index, see [llms.txt](https://docs.welkinhealth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.welkinhealth.com/api-reference/messaging-templates.md).

# Messaging Templates

## Resolve template

> The request allows to resolve the selected message template. The response will include the entire text of the message, as well as the data that is substituted into the variables inside this template.\
> \
> resolverServiceType - possible values: EMAIL, CHAT, SMS, WHATSAPP\
> \
> templateName - name of the message template, which can be viewed in the Designer

```json
{"openapi":"3.0.3","info":{"title":"Welkin Health API","version":"1.0.0"},"tags":[{"name":"Messaging templates","description":""}],"servers":[{"url":"https://api.live.welkincloud.io","description":"Welkin Health production API"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token obtained from `POST /{tenantName}/admin/api_clients/{clientName}`. Valid for 60 minutes."}},"parameters":{"TenantName":{"name":"tenantName","in":"path","required":true,"description":"Your organization (tenant) name, e.g. `acme-health`","schema":{"type":"string"}},"InstanceName":{"name":"instanceName","in":"path","required":true,"description":"Your environment name: `live`, `sandbox`, or a custom name","schema":{"type":"string"}},"PatientId":{"name":"patientId","in":"path","required":true,"description":"UUID of the patient record","schema":{"type":"string","format":"uuid"}}},"schemas":{"MessageTemplateResolveResult":{"type":"object","properties":{"resolvedText":{"type":"string","nullable":true},"resolvedEmailEditorJson":{"type":"string","nullable":true},"textType":{"$ref":"#/components/schemas/MessageTemplateType"},"subject":{"type":"string","nullable":true},"dataContentVariables":{"type":"array","items":{"$ref":"#/components/schemas/MessageTemplateContent"}}}},"MessageTemplateType":{"type":"string","enum":["PLAIN_TEXT","RICH_TEXT","HTML"]},"MessageTemplateContent":{"type":"object","description":"Polymorphic on `contentType`. TEXT carries `textData`; LIST/TABLE carry `columns` + `structureData` (+ separatorType/borderType respectively); IMAGE carries `image`, `fileType`, `fileName`, `width`, `height`.","properties":{"contentType":{"$ref":"#/components/schemas/ContentType"},"variableName":{"type":"string"},"textData":{"type":"string","nullable":true},"columns":{"type":"array","items":{"type":"object","additionalProperties":true},"nullable":true},"structureData":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}},"nullable":true},"separatorType":{"type":"string","enum":["DASH","TAB"],"nullable":true},"borderType":{"type":"string","enum":["SOLID","TRANSPARENT"],"nullable":true},"image":{"type":"string","nullable":true},"fileType":{"type":"integer","nullable":true},"fileName":{"type":"string","nullable":true},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true}}},"ContentType":{"type":"string","enum":["TEXT","LIST","TABLE","IMAGE"]}},"responses":{"BadRequest":{"description":"Bad request — the request could not be understood or was missing required parameters."},"Unauthorized":{"description":"Unauthorized — the Bearer token is missing, expired, or invalid."},"Forbidden":{"description":"Forbidden — the API client role does not have permission for this resource. Check the role and security policy in Admin."},"NotFound":{"description":"Not found — the requested resource does not exist."},"TooManyRequests":{"description":"Too many requests — rate limit exceeded. Implement exponential backoff."},"InternalError":{"description":"Internal server error."}}},"paths":{"/{tenantName}/{instanceName}/patients/{patientId}/{resolverServiceType}/message-templates/resolve/{templateName}":{"post":{"summary":"Resolve template","tags":["Messaging templates"],"operationId":"Resolve_template","parameters":[{"$ref":"#/components/parameters/TenantName"},{"$ref":"#/components/parameters/InstanceName"},{"$ref":"#/components/parameters/PatientId"},{"name":"resolverServiceType","in":"path","required":true,"description":"`resolverServiceType` path parameter","schema":{"type":"string"}},{"name":"templateName","in":"path","required":true,"description":"`templateName` path parameter","schema":{"type":"string"}}],"responses":{"200":{"description":"Resolved template content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageTemplateResolveResult"}}}},"201":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}},"description":"The request allows to resolve the selected message template. The response will include the entire text of the message, as well as the data that is substituted into the variables inside this template.\n\nresolverServiceType - possible values: EMAIL, CHAT, SMS, WHATSAPP\n\ntemplateName - name of the message template, which can be viewed in the Designer"}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.welkinhealth.com/api-reference/messaging-templates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
