Create Template

POST {{baseUrl}}/api/templates/

Create a new custom HTML template. If there are 1,000 or more templates in an account, creation will fail as there is a limit of 1,000 templates that can be created via the API. Request specific fields using sparse fieldsets.

Rate limits:
Burst: 10/s
Steady: 150/m

Scopes: Templates Write

Request Body

{"data"=>{"type"=>"template", "attributes"=>{"name"=>"Monthly Newsletter Template", "editor_type"=>"tempor eiusmod sunt", "html"=>"\n            <html>\n                <body>\n                    hello world\n                </body>\n            </html>\n        ", "text"=>"hello world", "return_fields"=>["in sint fugiat", "cillum ea"]}}}

HEADERS

KeyDatatypeRequiredDescription
revisionstring(Required) API endpoint revision (format: YYYY-MM-DD[.suffix])
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;data&quot;:{&quot;type&quot;:&quot;template&quot;,&quot;id&quot;:&quot;ullam&quot;,&quot;attributes&quot;:{&quot;company_id&quot;:&quot;COMPANY_ID&quot;,&quot;name&quot;:&quot;qui culpa eu sunt&quot;,&quot;editor_type&quot;:&quot;eu in laboris&quot;,&quot;html&quot;:&quot;laborum eiusmod aliquip&quot;,&quot;text&quot;:&quot;nulla aliquip eiusmod&quot;,&quot;created&quot;:&quot;2022-11-08T00:00:00&quot;,&quot;updated&quot;:&quot;2022-11-08T00:00:00&quot;},&quot;links&quot;:{&quot;self&quot;:&quot;http://sPUUdEPMFdBqpDfDGxxkhFXDDkPJvsGZ.mtlNeKbUZkf&quot;}}}