The Designs API offers the ability to manage assets stored in the Twilio SendGrid Design Library.
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.
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.
Bearer <<YOUR_API_KEY_HERE>>
The ID of the pre-built Design you want to duplicate.
application/json
Optional
The name of the new design.
Duplicate: <original design name>
Optional
The editor used in the UI.
code
design
The name of the new design.
Duplicate: <original design name>
The editor used in the UI.
code
design
The HTML content of the Design.
1048576
Plain text content of the Design.
1048576
Default: <generated from html_content if left empty>
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const id = "f15982c1-a82c-4e87-a6b2-a4a63b4b7644";5const data = {6name: "Ahoy, Cake or Pie Cafe!",7editor: "design",8};910const request = {11url: `/v3/designs/pre-builts/${id}`,12method: "POST",13body: data,14};1516client17.request(request)18.then(([response, body]) => {19console.log(response.statusCode);20console.log(response.body);21})22.catch((error) => {23console.error(error);24});