Early Preview
This API is in early preview and may be subject to change. Please contact your account manager if you are interested in trying the Branding API.
Use this API to create or update a message template. This endpoint accepts a partial payload but only updates the provided values by its type and language locale.
Resource URL
https://<subdomain>.onelogin.com/api/2/branding/brands/:brand_id/templates/:template_type/:localeHeader Parameters
Authorization required string | Set to Set The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: In order to use the Branding API your API Credentials must be created after 21st October 2020. |
Content-Type required string | Set to application/json. |
Resource Parameter
brand_id required integer | Unique identifier for the branding object. |
template_type required string | The message template type. |
locale required string | The 2 character language locale for the template. e.g. |
Request Parameters
template required string | The content body for the message. The template parameters vary based on the type of template. Templates can also contain placeholder values that will be substituted at the time of sending a message.
Placeholder values include SMS
Placeholder values include |
Request Body
- SMS
{
"template": {
"subject": "Email MFA App Verification Code",
"html": "<html><head></head><body><p>Here is the code: {{otp_code}}</p></body></html>",
"plain": "Here is the code: {{otp_code}}"
}
}{
"template": {
"message": "Here is the code: {{otp_code}}"
}
}
```json
</div>
</div>
<h2>Sample Responses</h2>
<div class="tab-group">
<ul class="tab-links">
<li class="t-link status-200 active" data-tab="1">200 Ok</li>
<li class="t-link status-401" data-tab="2">401 Unauthorized</li>
<li class="t-link status-404" data-tab="3">404 Not Found</li>
<li class="t-link status-422" data-tab="4">422 Unprocessable Entity</li>
</ul>
<div class="tab-views">
<div class="t-view active" data-tab="1">
```json
{
"id": 1,
"account_id": 1,
"locale": "en",
"type": "email_code_app_verification",
"template_class": "email_mfa_template",
"template": {
"subject": "Email MFA App Verification Code",
"html": "<html><head></head><body><p>Here is the code: {{otp_code}}</p></body></html>",
"plain": "Here is the code: {{otp_code}}"
},
"updated_at": "2022-08-31T00:03:27.734Z",
"brand_id": 1
}{
"name": "UnauthorizedError",
"message": "The request requires user authentication."
}When the template type is unknown:
{
"name": "NotFoundError",
"message": "Unknown Content Template type: \"unknown\"",
"statusCode": 404
}
```xml
<h4>When the locale is unknown:</h4>
```json
{
"name": "NotFoundError",
"message": "Unknown Content Template locale: \"unknown\"",
"statusCode": 404
}{
"name": "UnprocessableEntityError",
"message": {
"template/plain": "Value must be a string.",
"template": "should match exactly one schema in oneOf"
},
"statusCode": 422
}