# List Designs

## API Overview

The Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs).

The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your email needs](/docs/sendgrid/ui/sending-email/working-with-marketing-campaigns-email-designs/), 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.

## Operation overview

```json
{"path":"https://api.sendgrid.com/v3/designs","method":"get","servers":[{"url":"https://api.sendgrid.com","description":"for global users and subusers"},{"url":"https://api.eu.sendgrid.com","description":"for EU regional subusers"}]}
```

**This endpoint allows you to retrieve a list of designs already stored in your Design Library**.

A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below.

By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter.

## Operation details

### Authentication

API Key

### Headers

```json
[{"in":"header","name":"Authorization","required":true,"default":"Bearer <<YOUR_API_KEY_HERE>>","schema":{"type":"string"}}]
```

### Query string

```json
[{"name":"page_size","in":"query","description":"number of results to return","schema":{"type":"integer","minimum":0,"default":100},"refName":"#/components/parameters/DesignsQueryStringsPageSize","modelName":"__components_parameters_DesignsQueryStringsPageSize"},{"name":"page_token","in":"query","description":"token corresponding to a specific page of results, as provided by metadata","schema":{"type":"string"},"refName":"#/components/parameters/DesignsQueryStringsPageToken","modelName":"__components_parameters_DesignsQueryStringsPageToken"},{"name":"summary","in":"query","description":"set to false to return all fields","schema":{"type":"boolean","default":true},"refName":"#/components/parameters/DesignsQueryStringsSummary","modelName":"__components_parameters_DesignsQueryStringsSummary"}]
```

### Responses

```json
[{"responseCode":"200","schema":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"array","items":{"title":"Design Output - Summary","example":{"result":[{"id":"3247eaea-c912-42a3-b0bc-60bdaf210396","name":"Welcome Email","generate_plain_content":true,"thumbnail_url":"//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/llny8o5b3m636z92p7hbjnmq1jvpka39p370jwtin2s1wxv7x1sgm0y5fk518d0s.png","subject":"Welcom to the Cake or Pie Cafe","created_at":"2021-04-09T17:29:46Z","updated_at":"2021-04-09T17:29:55Z","editor":"code","categories":["welcome","new customer"]},{"id":"02dfd792-f31f-439a-a79e-5c47fbcfdbac","name":"Monthly Promo","generate_plain_content":true,"thumbnail_url":"//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/hfyxahd7ues2ajuoeoqq2xe6ibdasl1q89ox0y9ncya2ftpoicssmtf9ddus4c39.png","subject":"Free Dozen Cupcakes","created_at":"2021-04-09T17:29:21Z","updated_at":"2021-04-09T17:29:42Z","editor":"design","categories":["promo","coupon"]},{"id":"e54be823-19ef-4c6f-8b60-efd7514f492d","name":"Duplicate: Ingrid & Anders","generate_plain_content":true,"thumbnail_url":"//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/12kni9gjpyb9uxmwr9vk7unycjr70u95zoyhe9sg2zounul2zg7dih1s20k13q2z.png","subject":"Welcome to Ingrid & Anders!","created_at":"2020-10-09T17:33:46Z","updated_at":"2021-04-07T19:57:52Z","editor":"design","categories":[]}],"_metadata":{"self":"https://api.sendgrid.com/v3/designs?page_token=vHdvHCg0w1F-TmWJcPNpTEnFY2aPEmRBHONwOgZ6TgJbX2_I","count":3}},"type":"object","refName":"DesignOutputSummary","modelName":"DesignOutputSummary","properties":{"id":{"type":"string","description":"ID of the Design.","format":"uuid"},"updated_at":{"type":"string","description":"Datetime that Design was last updated.","format":"ISO 8601 date-time"},"created_at":{"type":"string","description":"Datetime that Design was created.","format":"ISO 8601 date-time"},"thumbnail_url":{"type":"string","description":"A Thumbnail preview of the template's html content."},"name":{"type":"string","description":"The name of the new design.","default":"Duplicate: <original design name>"},"editor":{"type":"string","description":"The editor used in the UI.","enum":["code","design"],"refName":"Editor","modelName":"Editor"}}}},"_metadata":{"title":"_metadata","type":"object","refName":"Metadata","modelName":"Metadata","properties":{"prev":{"type":"string","format":"uri"},"self":{"type":"string","format":"uri"},"next":{"type":"string","format":"uri"},"count":{"type":"integer","minimum":0}}}}},"examples":{"response":{"value":{"result":[{"id":"3247eaea-c912-42a3-b0bc-60bdaf210396","name":"Welcome Email","generate_plain_content":true,"thumbnail_url":"//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/llny8o5b3m636z92p7hbjnmq1jvpka39p370jwtin2s1wxv7x1sgm0y5fk518d0s.png","subject":"Welcom to the Cake or Pie Cafe","created_at":"2021-04-09T17:29:46Z","updated_at":"2021-04-09T17:29:55Z","editor":"code","categories":["welcome","new customer"]},{"id":"02dfd792-f31f-439a-a79e-5c47fbcfdbac","name":"Monthly Promo","generate_plain_content":true,"thumbnail_url":"//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/hfyxahd7ues2ajuoeoqq2xe6ibdasl1q89ox0y9ncya2ftpoicssmtf9ddus4c39.png","subject":"Free Dozen Cupcakes","created_at":"2021-04-09T17:29:21Z","updated_at":"2021-04-09T17:29:42Z","editor":"design","categories":["promo","coupon"]},{"id":"e54be823-19ef-4c6f-8b60-efd7514f492d","name":"Duplicate: Ingrid & Anders","generate_plain_content":true,"thumbnail_url":"//us-east-2-production-thumbnail-bucket.s3.amazonaws.com/12kni9gjpyb9uxmwr9vk7unycjr70u95zoyhe9sg2zounul2zg7dih1s20k13q2z.png","subject":"Welcome to Ingrid & Anders!","created_at":"2020-10-09T17:33:46Z","updated_at":"2021-04-07T19:57:52Z","editor":"design","categories":[]}],"_metadata":{"self":"https://api.sendgrid.com/v3/designs?page_token=vHdvHCg0w1F-TmWJcPNpTEnFY2aPEmRBHONwOgZ6TgJbX2_I","count":3}}}}}}}}]
```

List Designs

```js
const client = require("@sendgrid/client");
client.setApiKey(process.env.SENDGRID_API_KEY);

const queryParams = { summary: true };

const request = {
  url: `/v3/designs`,
  method: "GET",
  qs: queryParams,
};

client
  .request(request)
  .then(([response, body]) => {
    console.log(response.statusCode);
    console.log(response.body);
  })
  .catch((error) => {
    console.error(error);
  });
```

```python
import os
from sendgrid import SendGridAPIClient


sg = SendGridAPIClient(os.environ.get("SENDGRID_API_KEY"))

params = {"summary": "true"}

response = sg.client.designs.get(query_params=params)

print(response.status_code)
print(response.body)
print(response.headers)
```

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SendGrid;

public class Program {
    public static async Task Main() {
        string apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");
        var client = new SendGridClient(apiKey);

        var queryParams = @"{'summary': true}";

        var response = await client.RequestAsync(
            method: SendGridClient.Method.GET, urlPath: "designs", queryParams: queryParams);

        Console.WriteLine(response.StatusCode);
        Console.WriteLine(response.Body.ReadAsStringAsync().Result);
        Console.WriteLine(response.Headers.ToString());
    }
}
```

```java
import com.sendgrid.*;
import java.io.IOException;

public class Example {
    public static void main(String[] args) throws IOException {
        try {
            SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
            Request request = new Request();
            request.setMethod(Method.GET);
            request.setEndpoint("/designs");
            request.addQueryParam("summary", "true");
            Response response = sg.api(request);
            System.out.println(response.getStatusCode());
            System.out.println(response.getBody());
            System.out.println(response.getHeaders());
        } catch (IOException ex) {
            throw ex;
        }
    }
}
```

```go
package main

import (
	"fmt"
	"github.com/sendgrid/sendgrid-go"
	"os"
)

func main() {
	apiKey := os.Getenv("SENDGRID_API_KEY")
	host := "https://api.sendgrid.com"
	request := sendgrid.GetRequest(apiKey, "/v3/designs", host)
	request.Method = "GET"
	queryParams := make(map[string]string)
	queryParams["summary"] = "true"
	request.QueryParams = queryParams
	response, err := sendgrid.API(request)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(response.StatusCode)
		fmt.Println(response.Body)
		fmt.Println(response.Headers)
	}
}
```

```php
<?php
// Uncomment the next line if you're using a dependency loader (such as Composer) (recommended)
// require 'vendor/autoload.php';

// Uncomment next line if you're not using a dependency loader (such as Composer)
// require_once '<PATH TO>/sendgrid-php.php';

$apiKey = getenv("SENDGRID_API_KEY");
$sg = new \SendGrid($apiKey);
$query_params = json_decode('{
    "summary": "true"
}');

try {
    $response = $sg->client->designs()->get(null, $query_params);
    print $response->statusCode() . "\n";
    print_r($response->headers());
    print $response->body() . "\n";
} catch (Exception $ex) {
    echo "Caught exception: " . $ex->getMessage();
}
```

```ruby
require 'sendgrid-ruby'
include SendGrid

sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
params = JSON.parse('{
  "summary": true
}')

response = sg.client.designs.get(query_params: params)
puts response.status_code
puts response.headers
puts response.body
```

```bash
curl -G -X GET "https://api.sendgrid.com/v3/designs?summary=true" \
--header "Authorization: Bearer $SENDGRID_API_KEY"
```
