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 modify an existing message template. This endpoint accepts a partial payload but only updates the provided values.
Resource URL
https://<subdomain>.onelogin.com/api/2/branding/brands/:brand_id/templates/:template_idHeader 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_id required integer | Unique identifier for the template to return. |
Request Parameters
locale required string | The 2 character language locale for the template. e.g. en = English, es = Spanish |
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
{
"locale": "en",
"template": {
"subject": "Email MFA App Verification Code",
"html": "<html><head></head><body><p>Here is the {{code}}</p></body></html>",
"plain": "Please update your password by visiting this code: {{code}}"
}
}
```xml
<h2>Sample Responses</h2>
<div class="code-tabs">
<ul class="tab-links" role="tablist">
<li class="t-link active" data-tab="1" role="tab" aria-selected="true" tabindex="0">200 Ok</li>
<li class="t-link" data-tab="2" role="tab" aria-selected="false" tabindex="0">401 Unauthorized</li>
<li class="t-link" data-tab="3" role="tab" aria-selected="false" tabindex="0">422 Unprocessable Entity</li>
</ul>
<div class="tab-views">
```json
{
"id": 544880,
"account_id": 118462,
"locale": "en",
"type": "email_code_app_verification",
"template_class": "email_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": "2021-11-24T21:25:29.480Z",
"brand_id": 5
}{
"name": "UnauthorizedError",
"message": "The request requires user authentication."
}{
"name": "UnprocessableEntityError",
"message": "A template already exists with the give Brand ID, Template Type, and locale.",
"statusCode": 422
}
```json
</div>
</div>
<h2 id="postman-collection">Postman Collection</h2>
<p>Replace sample variables indicated by <code>{{ }}</code> with your actual values.</p>
<h2>Sample Code</h2>
<h3>cURL</h3>
<p>Replace sample values indicated by <code>< ></code> with your actual values.</p>
<h4><span>Update Account Brand</span></h4>
```bash
curl 'https://<subdomain>.onelogin.com/api/2/branding/brands/:brand_id/templates/:template_id' \
-X PUT \
-H "Authorization: bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"locale": "en",
"template": {
"subject": "Email MFA App Verification Code",
"html": "<html><head></head><body><p>Here is the {{otp_code}}</p></body></html>",
"plain": "Please update your password by visiting this code: {{otp_code}}"
}
}'Have a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.