This endpoint allows you to add, view, or remove marketing emails.

add

Create a new Marketing Email.

Parameter Required Requirements Description
identity Yes Must be an existing Identity The Identity that will be used for the Marketing Email being created.
name Yes None The name that will be used for the Marketing Email being created.
subject Yes None The subject that will be used for the Marketing Email being created.
text Yes None The text portion of the Marketing Email being created.
html Yes None The html portion of the Marketing Email being created.

Call

POST https://api.sendgrid.com/api/newsletter/add.json
POST Data identity=Sender_Address&name=SendGrid_Test&subject=testsubject&text=testtextbody&html=%3Chtml%3E%3Cp%3Etest_html_body%3C%2Fp%3E%3C%2Fhtml%3E&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
//success
{
  "message": "success"
}

//error
{
"error":"error in [parameter]: [parameter] is required" (where [parameter] is from above)
}

Call

POST https://api.sendgrid.com/api/newsletter/add.xml
POST Data identity=Sender_Address&name=SendGrid_Test&subject=testsubject&text=testtextbody&html=%3Chtml%3E%3Cp%3Etest_html_body%3C%2Fp%3E%3C%2Fhtml%3E&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>success</message>
</result>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<errors>
  <error>error in [parameter]: [parameter] is required</error> (where [parameter] is from above)
</errors>

edit

Edit an existing Marketing Email.

Parameter Required Requirements Description
name Yes Must be an existing Identity The name of the Marketing Email being updated.
newname Yes None The new name for the Marketing Email being edited.
identity Yes Must be an existing Identity The new Identity for the Marketing Email being edited.
subject Yes None The new subject that will be used for the Marketing Email being edited.
text Yes None The new text portion of the Marketing Email being edited.
html Yes None The new html portion of the Marketing Email being edited.

Call

POST https://api.sendgrid.com/api/newsletter/edit.json
POST Data identity=Sender_Address&name=SendGrid_Edit_Test&newname=new_name_test&subject=test_subject&text=test_text&html=%3Chtml%3E%3Cp%3ETest_html_text%3C%2Fp%3E%3C%2Fhtml%3E&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
//success
{
  "message": "success"
}

//error{
  "error":"error in [parameter]: [parameter] is required" (where [parameter] is from above)
}

Call

POST https://api.sendgrid.com/api/newsletter/edit.xml
POST Data identity=Sender_Address&name=SendGrid_Edit_Test&newname=new_name_test&subject=test_subject&text=test_text&html=%3Chtml%3E%3Cp%3ETest_html_text%3C%2Fp%3E%3C%2Fhtml%3E&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>success</message>
</result>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<errors>
  <error>error in [parameter]: [parameter] is required</error> (where [parameter] is from above)
</errors>

get

Retrieve the contents of an existing Marketing Email.

Parameter Required Requirements Description
name Yes Must be an existing Marketing Email Retrieve the content of an existing Marketing Email.

Call

POST https://api.sendgrid.com/api/newsletter/get.json
POST Data name=SendGrid_Test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//success
{
  "can_edit": true,
  "name": "SendGrid NL Test",
  "text": null,
  "newsletter_id": 38074,
  "total_recipients": 1,
  "html": null,
  "type": "html",
  "date_schedule": null,
  "identity": "d22de3a53fac1abef944c80c19032c2c",
  "subject": null
}

//error
{
  "error":"error in [parameter]: [parameter] is required" (where [parameter] is from above)
}

Call

POST https://api.sendgrid.com/api/newsletter/get.xml
POST Data name=SendGrid_Test&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?xml version="1.0" encoding="ISO-8859-1"?>

<newsletter>
   <can_edit>True</can_edit>
   <name>SendGrid NL Test</name>
   <text/>
   <newsletter_id>38074</newsletter_id>
   <total_recipients>1</total_recipients>
   <html/>
   <type>html</type>
   <date_schedule/>
   <identity>d22de3a53fac1abef944c80c19032c2c</identity>
   <subject/>
</newsletter>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<errors>
  <error>error in [parameter]: [parameter] is required</error> (where [parameter] is from above)
</errors>

list

Retrieve a list of all existing Marketing Email.

Parameter Required Requirements Description
name No Must be an existing Marketing Email Search to see if a specific Marketing Email exists rather than a list of all Marketing Emails.

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//success
[
  {
    "name": "Just Testing",
    "newsletter_id": 560308
  },
  {
    "name": "LSRC",
    "newsletter_id": 560869
  },
  {
    "name": "LSRC test",
    "newsletter_id": 560908
  },
  {
    "name": "Test",
    "newsletter_id": 38074
  }
]
//error
{
 "error":"error in [parameter]: [parameter] is required" (where [parameter] is from above)

}

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="ISO-8859-1"?>

<newsletters>
   <newsletter>
      <name>Just Testing</name>
      <newsletter_id>560308</newsletter_id>
   </newsletter>
   <newsletter>
      <name>LSRC</name>
      <newsletter_id>560869</newsletter_id>
   </newsletter>
   <newsletter>
      <name>LSRC test</name>
      <newsletter_id>560908</newsletter_id>
   </newsletter>
   <newsletter>
      <name>Test</name>
      <newsletter_id>38074</newsletter_id>
   </newsletter>
</newsletters>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<errors>
  <error>error in [parameter]: [parameter] is required</error> (where [parameter] is from above)
</errors>

delete

Remove an existing Marketing Email.

Parameter Required Requirements Description
name Yes Must be an existing Marketing Email Remove the Marketing Email with this name.

Call

POST https://api.sendgrid.com/api/newsletter/delete.json
POST Data name=SendGrid_Test1&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
//success
{
  "message": "success"
}

//error
{
  "error":"error in [parameter]: [parameter] is required" (where [parameter] is from above)
}

Call

POST https://api.sendgrid.com/api/newsletter/delete.xml
POST Data name=SendGrid_Test1&api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>success</message>
</result>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<errors>
  <error>error in [parameter]: [parameter] is required</error> (where [parameter] is from above)
</errors>