Table of Contents

Create a New Sender Address

Legacy Newsletter

Request

1
curl -X POST https://api.sendgrid.com/api/newsletter/identity/add.json -F api_user=SENDGRID_USERNAME -F api_key=SENDGRID_PASSWORD -F 'identity=Test Identity' -F 'name=Example User' -F 'email=example@example.com' -F 'address=929_Pearl_Street' -F 'city=Boulder' -F 'state=Colorado' -F 'zip=80302' -F 'country=US'

Response

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

Marketing Campaigns

Request

1
2
3
4
5
6
curl --request POST \
--url https://api.sendgrid.com/v3/senders \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json' \
--data '{"nickname":"My Sender ID","from":{"email":"example@example.com","name":"Example User"},"reply_to":{"email":"example@example.com","name":"Example User"},"address":"929 Pearl Street","city":"Boulder","state":"Colorado","zip":"80302","country":"US"}'

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "id": 1,
  "nickname": "My Sender ID",
  "from": {
    "email": "example@example.com",
    "name": "Example User"
  },
  "reply_to": {
    "email": "example@example.com",
    "name": "Example User"
  },
  "address": "929 Pearl Street",
  "city": "Boulder",
  "state": "Colorado",
  "zip": "80302",
  "country": "US",
  "verified": true,
  "updated_at": 1449872165,
  "created_at": 1449872165,
  "locked": false
}

Edit an Existing Sender Address

Legacy Newsletter

Request

1
curl -X POST https://api.sendgrid.com/api/newsletter/identity/edit.json -F api_user=SENDGRID_USERNAME -F api_key=SENDGRID_PASSWORD -F 'identity=Test Identity' -F 'name=Example User 2' -F 'email=example@example.com' -F 'address=929_Pearl_Street' -F 'city=Boulder' -F 'state=Colorado' -F 'zip=80302' -F 'country=US'

Response

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

Marketing Campaigns

First, get the appropriate Sender ID:

Request

1
2
3
4
5
curl --request GET \
--url https://api.sendgrid.com/v3/senders \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json'

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
{
  "result": [
    {
      "id": 1,
      "nickname": "My Sender ID",
      "from": {
        "email": "from@example.com",
        "name": "Example INC"
      },
      "reply_to": {
        "email": "replyto@example.com",
        "name": "Example INC"
      },
      "address": "123 Elm St.",
      "address_2": "Apt. 456",
      "city": "Denver",
      "state": "Colorado",
      "zip": "80202",
      "country": "United States",
      "verified": true,
      "updated_at": 1449872165,
      "created_at": 1449872165,
      "locked": false
    }
  ]
}

Then we can edit the Sender:

Request

1
2
3
4
5
6
curl --request PATCH \
--url https://api.sendgrid.com/v3/senders/{sender_id} \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json' \
--data '{"nickname":"My Sender ID","from":{"email":"example@example.com","name":"Example User 2"},"reply_to":{"email":"example@example.com","name":"Example User 2"},"address":"929 Pearl Street","city":"Boulder","state":"Colorado","zip":"80302","country":"US"}'

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "id": 1,
  "nickname": "My Sender ID",
  "from": {
    "email": "example@example.com",
    "name": "Example User 2"
  },
  "reply_to": {
    "email": "example@example.com",
    "name": "Example User 2"
  },
  "address": "929 Pearl Street",
  "city": "Boulder",
  "state": "Colorado",
  "zip": "80302",
  "country": "US",
  "verified": true,
  "updated_at": 1449872165,
  "created_at": 1449872165,
  "locked": false
}

Retrieve Information Associated With a Particular Sender Address

Legacy Newsletter

Request

1
curl -X POST https://api.sendgrid.com/api/newsletter/identity/get.json -F api_user=SENDGRID_USERNAME -F api_key=SENDGRID_PASSWORD -F 'identity=Sender_Address'

Response

1
2
3
4
5
6
7
8
9
10
11
{
  "city": "Boulder",
  "name": "Name",
  "zip": "80302",
  "replyto": "example@example.com",
  "country": "US",
  "state": "CO",
  "address": "929 Pearl Street",
  "email": "example@sendgrid.com",
  "identity": "Sender_Address"
}

Marketing Campaigns

Request

1
2
3
4
5
curl --request GET \
--url https://api.sendgrid.com/v3/senders \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json'

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
{
  "result": [
    {
      "id": 1,
      "nickname": "My Sender ID",
      "from": {
        "email": "from@example.com",
        "name": "Example INC"
      },
      "reply_to": {
        "email": "replyto@example.com",
        "name": "Example INC"
      },
      "address": "123 Elm St.",
      "address_2": "Apt. 456",
      "city": "Denver",
      "state": "Colorado",
      "zip": "80202",
      "country": "United States",
      "verified": true,
      "updated_at": 1449872165,
      "created_at": 1449872165,
      "locked": false
    }
  ]
}

List all Sender Addresses on Your Account, or Check if a Particular Sender Address Exists

Legacy Newsletter

Request

1
curl -X POST https://api.sendgrid.com/api/newsletter/identity/list.json -F api_user=SENDGRID_USERNAME -F api_key=SENDGRID_PASSWORD

Response

1
2
3
4
5
[
  {
    "identity": "Sender_Address"
  }
]

Marketing Campaigns

Request

1
2
3
4
5
curl --request GET \
--url https://api.sendgrid.com/v3/senders \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json'

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
{
  "result": [
    {
      "id": 1,
      "nickname": "My Sender ID",
      "from": {
        "email": "from@example.com",
        "name": "Example INC"
      },
      "reply_to": {
        "email": "replyto@example.com",
        "name": "Example INC"
      },
      "address": "123 Elm St.",
      "address_2": "Apt. 456",
      "city": "Denver",
      "state": "Colorado",
      "zip": "80202",
      "country": "United States",
      "verified": true,
      "updated_at": 1449872165,
      "created_at": 1449872165,
      "locked": false
    }
  ]
}

Remove a Sender Address From Your Account

Legacy Newsletter

Request

1
curl -X POST https://api.sendgrid.com/api/newsletter/identity/delete.json -F api_user=SENDGRID_USERNAME -F api_key=SENDGRID_PASSWORD -F 'identity=Sender_Address'

Response

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

Marketing Campaigns

First, we need to get the sender_id:

Request

1
2
3
4
5
curl --request GET \
--url https://api.sendgrid.com/v3/senders \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json'

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
{
  "result": [
    {
      "id": 1,
      "nickname": "My Sender ID",
      "from": {
        "email": "from@example.com",
        "name": "Example INC"
      },
      "reply_to": {
        "email": "replyto@example.com",
        "name": "Example INC"
      },
      "address": "123 Elm St.",
      "address_2": "Apt. 456",
      "city": "Denver",
      "state": "Colorado",
      "zip": "80202",
      "country": "United States",
      "verified": true,
      "updated_at": 1449872165,
      "created_at": 1449872165,
      "locked": false
    }
  ]
}

Then, we can delete the specified sender_id:

Request

1
2
3
4
5
curl --request DELETE \
--url https://api.sendgrid.com/v3/senders/{sender_id} \
--header 'accept: application/json' \
--header 'authorization: Bearer SENDGRID_API_KEY' \
--header 'content-type: application/json'

Response

1
HTTP/1.1 204