This module allows you to create and manage categories within your Marketing Emails.

create

Create a new Category.

Parameter Required Requirements Description
category Yes None The name that will be used for the Category being created.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/category/create.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&category=CATEGORY

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/newsletter/category/create.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&category=CATEGORY

Response

1
2
3
<result>
   <message>success</message>
</result>

add

Assign a Category to an existing Marketing Email.

Parameter Required Requirements Description
category Yes Must be an existing Category. The Category that will be added to the marketing email.
name Yes Must be an existing Marketing Email The Marketing Email to which the categories will be added.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/category/add.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&category=CATEGORY&name=NEWSLETTER

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/newsletter/category/add.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&category=CATEGORY&name=NEWSLETTER

Response

1
2
3
<result>
   <message>success</message>
</result>

remove

Remove specific categories, or all categories from a Marketing Email.\

Parameter Required Requirements Description
name Yes Must be an existing Marketing Email The Marketing Email that will have Category(ies) deleted from it.
category No Must be an existing category currently added to the Marketing Email Remove the Category with this name. If the category is not specified. all categories will be deleted from the Marketing Email.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/category/remove.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&category=CATEGORY&name=NEWSLETTER

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/api/newsletter/category/remove.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&category=CATEGORY&name=NEWSLETTER

Response

1
2
3
<result>
   <message>success</message>
</result>

list

List all categories.

Parameter Required Requirements Description
category No Must be an existing Category Search to see if a specific Category exists rather than a list of all Categories.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/newsletter/category/list.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
[ { "category": "CATEGORY" }, { "category": "CATEGORY2" } ]

Call

POST https://api.sendgrid.com/api/newsletter/category/list.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
<categories>
   <category>
      <category>CATEGORY</category>
   </category>
   <category>
      <category>CATEGORY2</category>
   </category>
</categories>