Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Duplicate SendGrid Pre-built Design



API Overview

api-overview page anchor

The Designs API offers the ability to manage assets stored in the Twilio SendGrid Design Library(link takes you to an external page).

The Design Library is a feature-rich email layout tool and media repository. You can build designs for all your email needs, including Single Sends, Automations, and Dynamic Templates.

You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started.

The Designs API provides a RESTful interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design.


POST/v3/designs/pre-builts/{id}

Base url: https://api.sendgrid.com

This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs.

Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the name field blank, your duplicate will be assigned the name of the design it was copied from with the text "Duplicate: " prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the "List SendGrid Pre-built Designs" endpoint.

You can modify your duplicate’s name at the time of creation by passing an updated value to the name field when making the initial request. More on retrieving design IDs can be found above.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idstring<uuid>required

The ID of the pre-built Design you want to duplicate.

SchemaExample
Property nameTypeRequiredDescriptionChild properties
namestringOptional

The name of the new design.

Default: Duplicate: <original design name>

editorenum<string>Optional

The editor used in the UI.

Possible values:
codedesign
200400404
SchemaExample
Property nameTypeRequiredDescriptionChild properties
idstring<uuid>

ID of the Design.


updated_atstring<ISO 8601 date-time>

Datetime that Design was last updated.


created_atstring<ISO 8601 date-time>

Datetime that Design was created.


thumbnail_urlstring

A Thumbnail preview of the template's html content.


namestring

The name of the new design.

Default: Duplicate: <original design name>

editorenum<string>

The editor used in the UI.

Possible values:
codedesign

generate_plain_contentboolean

If true, plain_content is always generated from html_content. If false, plain_content is not altered.

Default: true

subjectstring

Subject of the Design.

Max length: 5000

categoriesarray[string]

The list of categories applied to the design


html_contentstring

The HTML content of the Design.

Max length: 1048576

plain_contentstring

Plain text content of the Design.

Max length: 1048576Default: <generated from html_content if left empty>

Duplicate SendGrid Pre-built Design

duplicate-sendgrid-pre-built-design page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_23
const client = require('@sendgrid/client');
_23
client.setApiKey(process.env.SENDGRID_API_KEY);
_23
_23
const id = "f15982c1-a82c-4e87-a6b2-a4a63b4b7644";
_23
const data = {
_23
"name": "Ahoy, Cake or Pie Cafe!",
_23
"editor": "design"
_23
};
_23
_23
const request = {
_23
url: `/v3/designs/pre-builts/${id}`,
_23
method: 'POST',
_23
body: data
_23
}
_23
_23
client.request(request)
_23
.then(([response, body]) => {
_23
console.log(response.statusCode);
_23
console.log(response.body);
_23
})
_23
.catch(error => {
_23
console.error(error);
_23
});


Rate this page: