Skip to contentSkip to navigationSkip to topbar
On this page

Create a Sender



API Overview

api-overview page anchor

POST/v3/marketing/senders

Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)

This endpoint allows you to create a new Sender.

You may create up to 100 unique Senders.

Senders are required to be verified before use. If your domain has been authenticated, a new Sender will auto verify on creation. Otherwise an email will be sent to the from.email.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
authorizationstring
required
Default: Bearer <<YOUR_API_KEY_HERE>>

onBehalfOfstring

Optional

The on-behalf-of header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be "account-id" followed by the customer account's ID (e.g., on-behalf-of: account-id <account-id>). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., on-behalf-of: <subuser-username>). See On Behalf Of for more information.

Encoding type:application/json
Schema
Property nameTypeRequiredDescriptionChild properties
nicknamestring
required

A nickname for the Sender. Not used for sending.


fromobject
required

replyToobject
required

addressstring
required

The physical address of the Sender.


address2string

Optional

Additional Sender address information.


citystring
required

The city of the Sender.


statestring

Optional

The state of the Sender.


zipstring

Optional

The zipcode of the Sender.


countrystring
required

The country of the Sender.

201401403404500
SchemaExample
Property nameTypeRequiredDescriptionChild properties
idinteger

Optional

The unique identifier of the Sender.


nicknamestring

Optional

A nickname for the Sender. Not used for sending.


fromobject

Optional


replyToobject

Optional


addressstring

Optional

The physical address of the Sender.


address2string

Optional

Additional Sender address information.


citystring

Optional

The city of the Sender.


statestring

Optional

The state of the Sender.


zipstring

Optional

The zipcode of the Sender.


countrystring

Optional

The country of the Sender.


verifiedboolean

Optional

A boolean flag indicating whether the Sender is verified or not. Only verified Senders can be used to send email.


lockedboolean

Optional

A boolean flag that is true when the Sender is associated with a campaign in Draft, Scheduled, or In Progress status. You cannot update or delete a locked Sender.


updatedAtinteger

Optional

The time the Sender was last updated.


createdAtinteger

Optional

The time the Sender was created.

Create a SenderLink to code sample: Create a Sender
1
const client = require("@sendgrid/client");
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const data = {
5
address: "Unit 3856 Box 3973\nDPO AA 31194",
6
city: "New Matthew",
7
country: "Myanmar",
8
from: {
9
email: "brian12@example.net",
10
name: "name",
11
},
12
nickname: "nickname",
13
reply_to: {
14
email: "brian12@example.net",
15
name: "name",
16
},
17
};
18
19
const request = {
20
url: `/v3/marketing/senders`,
21
method: "POST",
22
body: data,
23
};
24
25
client
26
.request(request)
27
.then(([response, body]) => {
28
console.log(response.statusCode);
29
console.log(response.body);
30
})
31
.catch((error) => {
32
console.error(error);
33
});