From 14d67fa9c831897d4be3fb911acdf7ee7696bd72 Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Mon, 29 Oct 2018 14:51:16 -0400 Subject: [PATCH 1/6] Remove references to "Whitelabel". --- .../senderauthentication.go} | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) rename examples/{whitelabel/whitelabel.go => senderauthentication/senderauthentication.go} (88%) diff --git a/examples/whitelabel/whitelabel.go b/examples/senderauthentication/senderauthentication.go similarity index 88% rename from examples/whitelabel/whitelabel.go rename to examples/senderauthentication/senderauthentication.go index 95080225..89d7e5f2 100644 --- a/examples/whitelabel/whitelabel.go +++ b/examples/senderauthentication/senderauthentication.go @@ -7,7 +7,7 @@ import ( "os" ) -// Createadomainwhitelabel : Create a domain whitelabel. +// Createadomainauthentication : Create a domain authentication. // POST /whitelabel/domains func Createadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -36,7 +36,7 @@ func Createadomainwhitelabel() { } } -// Listalldomainwhitelabels : List all domain whitelabels. +// Listalldomainauthentications : List all domain authentications. // GET /whitelabel/domains func Listalldomainwhitelabels() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -60,7 +60,7 @@ func Listalldomainwhitelabels() { } } -// Getthedefaultdomainwhitelabel : Get the default domain whitelabel. +// Getthedefaultdomainauthentication : Get the default domain authentication. // GET /whitelabel/domains/default func Getthedefaultdomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -77,7 +77,7 @@ func Getthedefaultdomainwhitelabel() { } } -// Listthedomainwhitelabelassociatedwiththegivenuser : List the domain whitelabel associated with the given user. +// Listthedomainauthenticationassociatedwiththegivenuser : List the domain authentication associated with the given user. // GET /whitelabel/domains/subuser func Listthedomainwhitelabelassociatedwiththegivenuser() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -94,7 +94,7 @@ func Listthedomainwhitelabelassociatedwiththegivenuser() { } } -// Disassociateadomainwhitelabelfromagivenuser : Disassociate a domain whitelabel from a given user. +// Disassociateadomainauthenticationfromagivenuser : Disassociate a domain authentication from a given user. // DELETE /whitelabel/domains/subuser func Disassociateadomainwhitelabelfromagivenuser() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -111,7 +111,7 @@ func Disassociateadomainwhitelabelfromagivenuser() { } } -// Updateadomainwhitelabel : Update a domain whitelabel. +// Updateadomainauthentication : Update a domain authentication. // PATCH /whitelabel/domains/{domain_id} func Updateadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -132,7 +132,7 @@ func Updateadomainwhitelabel() { } } -// Retrieveadomainwhitelabel : Retrieve a domain whitelabel. +// Retrieveadomainauthentication : Retrieve a domain authentication. // GET /whitelabel/domains/{domain_id} func Retrieveadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -149,7 +149,7 @@ func Retrieveadomainwhitelabel() { } } -// Deleteadomainwhitelabel : Delete a domain whitelabel. +// Deleteadomainauthentication : Delete a domain authentication. // DELETE /whitelabel/domains/{domain_id} func Deleteadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -166,7 +166,7 @@ func Deleteadomainwhitelabel() { } } -// Associateadomainwhitelabelwithagivenuser : Associate a domain whitelabel with a given user. +// Associateadomainauthenticationwithagivenuser : Associate a domain authentication with a given user. // POST /whitelabel/domains/{domain_id}/subuser func Associateadomainwhitelabelwithagivenuser() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -186,7 +186,7 @@ func Associateadomainwhitelabelwithagivenuser() { } } -// AddanIPtoadomainwhitelabel : Add an IP to a domain whitelabel. +// AddanIPtoadomainauthentication : Add an IP to a domain authentication. // POST /whitelabel/domains/{id}/ips func AddanIPtoadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -206,7 +206,7 @@ func AddanIPtoadomainwhitelabel() { } } -// RemoveanIPfromadomainwhitelabel : Remove an IP from a domain whitelabel. +// RemoveanIPfromadomainauthentication : Remove an IP from a domain authentication. // DELETE /whitelabel/domains/{id}/ips/{ip} func RemoveanIPfromadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -223,7 +223,7 @@ func RemoveanIPfromadomainwhitelabel() { } } -// Validateadomainwhitelabel : Validate a domain whitelabel. +// Validateadomainauthentication : Validate a domain authentication. // POST /whitelabel/domains/{id}/validate func Validateadomainwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -240,7 +240,7 @@ func Validateadomainwhitelabel() { } } -// CreateanIPwhitelabel : Create an IP whitelabel +// CreateanreverseDNS : Create reverse DNS // POST /whitelabel/ips func CreateanIPwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -262,7 +262,7 @@ func CreateanIPwhitelabel() { } } -// RetrieveallIPwhitelabels : Retrieve all IP whitelabels +// RetrieveallreverseDNSrecords : Retrieve all reverse DNS records // GET /whitelabel/ips func RetrieveallIPwhitelabels() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -284,7 +284,7 @@ func RetrieveallIPwhitelabels() { } } -// RetrieveanIPwhitelabel : Retrieve an IP whitelabel +// RetrieveareverseDNSrecord : Retrieve a reverse DNS record // GET /whitelabel/ips/{id} func RetrieveanIPwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -301,7 +301,7 @@ func RetrieveanIPwhitelabel() { } } -// DeleteanIPwhitelabel : Delete an IP whitelabel +// DeleteareverseDNSrecord : Delete a reverse DNS record // DELETE /whitelabel/ips/{id} func DeleteanIPwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -318,7 +318,7 @@ func DeleteanIPwhitelabel() { } } -// ValidateanIPwhitelabel : Validate an IP whitelabel +// ValidateareverseDNSrecord : Validate a reverse DNS record // POST /whitelabel/ips/{id}/validate func ValidateanIPwhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -335,7 +335,7 @@ func ValidateanIPwhitelabel() { } } -// CreateaLinkWhitelabel : Create a Link Whitelabel +// Createalinkbranding : Create a branded link // POST /whitelabel/links func CreateaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -361,7 +361,7 @@ func CreateaLinkWhitelabel() { } } -// Retrievealllinkwhitelabels : Retrieve all link whitelabels +// Retrievealllinkbrands : Retrieve all link brands // GET /whitelabel/links func Retrievealllinkwhitelabels() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -381,7 +381,7 @@ func Retrievealllinkwhitelabels() { } } -// RetrieveaDefaultLinkWhitelabel : Retrieve a Default Link Whitelabel +// RetrieveaDefaultLinkBranding : Retrieve a Default Link Branding // GET /whitelabel/links/default func RetrieveaDefaultLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -401,7 +401,7 @@ func RetrieveaDefaultLinkWhitelabel() { } } -// RetrieveAssociatedLinkWhitelabel : Retrieve Associated Link Whitelabel +// RetrieveAssociatedLinkBranding : Retrieve Associated Link Branding // GET /whitelabel/links/subuser func RetrieveAssociatedLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -421,7 +421,7 @@ func RetrieveAssociatedLinkWhitelabel() { } } -// DisassociateaLinkWhitelabel : Disassociate a Link Whitelabel +// DisassociateaLinkBranding : Disassociate a Link Branding // DELETE /whitelabel/links/subuser func DisassociateaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -441,7 +441,7 @@ func DisassociateaLinkWhitelabel() { } } -// UpdateaLinkWhitelabel : Update a Link Whitelabel +// UpdateaLinkBranding : Update a Link Branding // PATCH /whitelabel/links/{id} func UpdateaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -461,7 +461,7 @@ func UpdateaLinkWhitelabel() { } } -// RetrieveaLinkWhitelabel : Retrieve a Link Whitelabel +// RetrieveaLinkBranding : Retrieve a Link Branding // GET /whitelabel/links/{id} func RetrieveaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -478,7 +478,7 @@ func RetrieveaLinkWhitelabel() { } } -// DeleteaLinkWhitelabel : Delete a Link Whitelabel +// DeleteaLinkBranding : Delete a Link Branding // DELETE /whitelabel/links/{id} func DeleteaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -495,7 +495,7 @@ func DeleteaLinkWhitelabel() { } } -// ValidateaLinkWhitelabel : Validate a Link Whitelabel +// ValidateaLinkBranding : Validate a Link Branding // POST /whitelabel/links/{id}/validate func ValidateaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") @@ -512,7 +512,7 @@ func ValidateaLinkWhitelabel() { } } -// AssociateaLinkWhitelabel : Associate a Link Whitelabel +// AssociateaLinkBranding : Associate a Link Branding // POST /whitelabel/links/{link_id}/subuser func AssociateaLinkWhitelabel() { apiKey := os.Getenv("SENDGRID_API_KEY") From 537382b26c860a88dc9fd5f9281578203e9b2c7e Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Mon, 29 Oct 2018 15:14:15 -0400 Subject: [PATCH 2/6] Remove references to "Whitelabel" --- USAGE.md | 2319 +++++++++++++++++++++++++++--------------------------- 1 file changed, 1159 insertions(+), 1160 deletions(-) diff --git a/USAGE.md b/USAGE.md index e6e3e862..362526cb 100644 --- a/USAGE.md +++ b/USAGE.md @@ -36,14 +36,13 @@ host := "https://api.sendgrid.com" * [PARTNER SETTINGS](#partner-settings) * [SCOPES](#scopes) * [SENDERS](#senders) +* [SENDER AUTHENTICATION](#sender-authentication) * [STATS](#stats) * [SUBUSERS](#subusers) * [SUPPRESSION](#suppression) * [TEMPLATES](#templates) * [TRACKING SETTINGS](#tracking-settings) * [USER](#user) -* [WHITELABEL](#whitelabel) - # ACCESS SETTINGS @@ -2310,7 +2309,7 @@ if err != nil { **This endpoint allows you to retrieve a list of all assigned and unassigned IPs.** -Response includes warm up status, pools, assigned subusers, and whitelabel info. The start_date field corresponds to when warmup started for that IP. +Response includes warm up status, pools, assigned subusers, and authentication info. The start_date field corresponds to when warmup started for that IP. A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. @@ -2365,7 +2364,7 @@ if err != nil { IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -2393,7 +2392,7 @@ if err != nil { IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -2418,7 +2417,7 @@ if err != nil { IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -2446,7 +2445,7 @@ if err != nil { IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -2471,7 +2470,7 @@ if err != nil { IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. -IP pools can only be used with whitelabeled IP addresses. +IP pools can only be used with authenticated IP addresses. If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools. @@ -3508,7 +3507,7 @@ if err != nil { *You may create up to 100 unique sender identities.* -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### POST /senders @@ -3546,7 +3545,7 @@ if err != nil { **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### GET /senders @@ -3567,7 +3566,7 @@ if err != nil { **This endpoint allows you to update a sender identity.** -Updates to `from.email` require re-verification. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Updates to `from.email` require re-verification. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`. Partial updates are allowed, but fields that are marked as "required" in the POST (create) endpoint must not be nil if that field is included in the PATCH request. @@ -3607,7 +3606,7 @@ if err != nil { **This endpoint allows you to retrieve a specific sender identity.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### GET /senders/{sender_id} @@ -3628,7 +3627,7 @@ if err != nil { **This endpoint allows you to delete one of your sender identities.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### DELETE /senders/{sender_id} @@ -3649,7 +3648,7 @@ if err != nil { **This endpoint allows you to resend a sender identity verification email.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise an email will be sent to the `from.email`. ### POST /senders/{sender_id}/resend_verification @@ -3666,62 +3665,37 @@ if err != nil { } ``` - -# STATS - -## Retrieve global email statistics - -**This endpoint allows you to retrieve all of your global email statistics between a given date range.** - -Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. - -### GET /stats - -```go -request := sendgrid.GetRequest(apiKey, "/v3/stats", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["aggregated_by"] = "day" -queryParams["limit"] = "1" -queryParams["start_date"] = "2016-01-01" -queryParams["end_date"] = "2016-04-01" -queryParams["offset"] = "1" -request.QueryParams = queryParams -response, err := sendgrid.API(request) -if err != nil { - log.Println(err) -} else { - fmt.Println(response.StatusCode) - fmt.Println(response.Body) - fmt.Println(response.Headers) -} -``` + +# SENDER AUTHENTICATION - -# SUBUSERS +## Create an authenticated domain. -## Create Subuser +**This endpoint allows you to create a domain authentication for one of your domains.** -This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. +If you are creating a domain authentication that you would like a subuser to use, you have two options: +1. Use the "username" parameter. This allows you to create am authenticated subuser. This means the subuser is able to see and modify the created authentication. +2. Use the Association workflow (see Associate Domain section). This allows you to assign a domain authentication created by the parent to a subuser. This means the subuser will default to the assigned domain authentication, but will not be able to see or modify that authentication. However, if the subuser creates their own domain authentication it will overwrite the assigned domain authentication. -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### POST /subusers +### POST /whitelabel/domains ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains", host) request.Method = "POST" request.Body = []byte(` { - "email": "John@example.com", + "automatic_security": false, + "custom_spf": true, + "default": true, + "domain": "example.com", "ips": [ - "1.1.1.1", - "2.2.2.2" + "192.168.1.1", + "192.168.1.2" ], - "password": "johns_password", - "username": "John@example.com" + "subdomain": "news", + "username": "john@example.com" }`) response, err := sendgrid.API(request) if err != nil { @@ -3733,22 +3707,24 @@ if err != nil { } ``` -## List all Subusers +## List all domain authentications. -This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. +**This endpoint allows you to retrieve a list of all domain authentications you have created.** -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### GET /subusers + +### GET /whitelabel/domains ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains", host) request.Method = "GET" queryParams := make(map[string]string) queryParams["username"] = "test_string" +queryParams["domain"] = "test_string" +queryParams["exclude_subusers"] = "true" queryParams["limit"] = "1" queryParams["offset"] = "1" request.QueryParams = queryParams @@ -3762,20 +3738,24 @@ if err != nil { } ``` -## Retrieve Subuser Reputations +## Get the default domain authentication. -Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating. +**This endpoint allows you to retrieve the default authentication for a domain.** -This endpoint allows you to request the reputations for your subusers. +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -### GET /subusers/reputations +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| domain | string |The domain to find a default domain whitelabel for. | + +### GET /whitelabel/domains/default ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/reputations", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/default", host) request.Method = "GET" -queryParams := make(map[string]string) -queryParams["usernames"] = "test_string" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -3786,29 +3766,26 @@ if err != nil { } ``` -## Retrieve email statistics for your subusers. +## List the domain authentication associated with the given user. -**This endpoint allows you to retrieve the email statistics for the given subusers.** +**This endpoint allows you to retrieve all of the domain authentications that have been assigned to a specific subuser.** -You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### GET /subusers/stats +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| username | string | Username of the subuser to find associated whitelabels for. | + +### GET /whitelabel/domains/subuser ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/stats", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/subuser", host) request.Method = "GET" -queryParams := make(map[string]string) -queryParams["end_date"] = "2016-04-01" -queryParams["aggregated_by"] = "day" -queryParams["limit"] = "1" -queryParams["offset"] = "1" -queryParams["start_date"] = "2016-01-01" -queryParams["subusers"] = "test_string" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -3819,30 +3796,26 @@ if err != nil { } ``` -## Retrieve monthly stats for all subusers +## Disassociate a domain authentication from a given user. -**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** +**This endpoint allows you to disassociate a specific domain authentication from a subuser.** -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: -`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### GET /subusers/stats/monthly +## URI Parameters +| URI Parameter | Type | Required? | Description | +|---|---|---|---| +| username | string | required | Username for the subuser to find associated whitelabels for. | + +### DELETE /whitelabel/domains/subuser ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/stats/monthly", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["subuser"] = "test_string" -queryParams["limit"] = "1" -queryParams["sort_by_metric"] = "test_string" -queryParams["offset"] = "1" -queryParams["date"] = "test_string" -queryParams["sort_by_direction"] = "asc" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/subuser", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -3853,29 +3826,23 @@ if err != nil { } ``` -## Retrieve the totals for each email statistic metric for all subusers. - -**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** +## Update a domain authentication. +**This endpoint allows you to update the settings for a domain authentication.** -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### GET /subusers/stats/sums +### PATCH /whitelabel/domains/{domain_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/stats/sums", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["end_date"] = "2016-04-01" -queryParams["aggregated_by"] = "day" -queryParams["limit"] = "1" -queryParams["sort_by_metric"] = "test_string" -queryParams["offset"] = "1" -queryParams["start_date"] = "2016-01-01" -queryParams["sort_by_direction"] = "asc" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}", host) +request.Method = "PATCH" +request.Body = []byte(` { + "custom_spf": true, + "default": false +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -3886,23 +3853,20 @@ if err != nil { } ``` -## Enable/disable a subuser +## Retrieve a domain authentication. -This endpoint allows you to enable or disable a subuser. +**This endpoint allows you to retrieve a specific domain authentication.** -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### PATCH /subusers/{subuser_name} + +### GET /whitelabel/domains/{domain_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}", host) -request.Method = "PATCH" -request.Body = []byte(` { - "disabled": false -}`) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -3913,19 +3877,18 @@ if err != nil { } ``` -## Delete a subuser +## Delete a domain authentication. -This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved. +**This endpoint allows you to delete a domain authentication.** -For more information about Subusers: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) -* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) -### DELETE /subusers/{subuser_name} +### DELETE /whitelabel/domains/{domain_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}", host) request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { @@ -3937,23 +3900,29 @@ if err != nil { } ``` -## Update IPs assigned to a subuser +## Associate a domain authentication with a given user. -Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well. +**This endpoint allows you to associate a specific domain authentication with a subuser.** -More information: +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html) -* [IPs can be whitelabeled](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/ips.html) +Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools. -### PUT /subusers/{subuser_name}/ips +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| domain_id | integer | ID of the domain whitelabel to associate with the subuser. | + +### POST /whitelabel/domains/{domain_id}/subuser ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/ips", host) -request.Method = "PUT" -request.Body = []byte(` [ - "127.0.0.1" -]`) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}/subuser", host) +request.Method = "POST" +request.Body = []byte(` { + "username": "jane@example.com" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -3964,18 +3933,26 @@ if err != nil { } ``` -## Update Monitor Settings for a subuser +## Add an IP to a domain authentication. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to add an IP address to a domain authentication.** -### PUT /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| id | integer | ID of the domain to which you are adding an IP | + +### POST /whitelabel/domains/{id}/ips ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) -request.Method = "PUT" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{id}/ips", host) +request.Method = "POST" request.Body = []byte(` { - "email": "example@example.com", - "frequency": 500 + "ip": "192.168.0.1" }`) response, err := sendgrid.API(request) if err != nil { @@ -3987,19 +3964,25 @@ if err != nil { } ``` -## Create monitor settings +## Remove an IP from a domain authenticaiton. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to remove a domain's IP address from that domain's authentication.** -### POST /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| id | integer | ID of the domain whitelabel to delete the IP from. | +| ip | string | IP to remove from the domain whitelabel. | + +### DELETE /whitelabel/domains/{id}/ips/{ip} ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) -request.Method = "POST" -request.Body = []byte(` { - "email": "example@example.com", - "frequency": 50000 -}`) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{id}/ips/{ip}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4010,15 +3993,24 @@ if err != nil { } ``` -## Retrieve monitor settings for a subuser +## Validate a domain authentication. -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to validate a domain authentication. If it fails, it will return an error message describing why the domain could not be validated.** -### GET /subusers/{subuser_name}/monitor +A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. + +For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| id | integer |ID of the domain whitelabel to validate. | + +### POST /whitelabel/domains/{id}/validate ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{id}/validate", host) +request.Method = "POST" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4029,15 +4021,26 @@ if err != nil { } ``` -## Delete monitor settings +## Create reverse DNS -Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. +**This endpoint allows you to create a reverse DNS record.** -### DELETE /subusers/{subuser_name}/monitor +When creating a reverse DNS record, you should use the same subdomain that you used when you created a domain authentication. + +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. + +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). + +### POST /whitelabel/ips ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips", host) +request.Method = "POST" +request.Body = []byte(` { + "domain": "example.com", + "ip": "192.168.1.1", + "subdomain": "email" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4048,27 +4051,24 @@ if err != nil { } ``` -## Retrieve the monthly email statistics for a single subuser +## Retrieve all reverse DNS records -**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.** +**This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.** -While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192."). -When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: -`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). -### GET /subusers/{subuser_name}/stats/monthly +### GET /whitelabel/ips ```go -request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/stats/monthly", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips", host) request.Method = "GET" queryParams := make(map[string]string) -queryParams["date"] = "test_string" -queryParams["sort_by_direction"] = "asc" +queryParams["ip"] = "test_string" queryParams["limit"] = "1" -queryParams["sort_by_metric"] = "test_string" queryParams["offset"] = "1" request.QueryParams = queryParams response, err := sendgrid.API(request) @@ -4081,28 +4081,19 @@ if err != nil { } ``` - -# SUPPRESSION - -## Retrieve all blocks +## Retrieve an reverse DNS record -**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.** +**This endpoint allows you to retrieve a reverse DNS record.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). -### GET /suppression/blocks +### GET /whitelabel/ips/{id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips/{id}", host) request.Method = "GET" -queryParams := make(map[string]string) -queryParams["start_time"] = "1" -queryParams["limit"] = "1" -queryParams["end_time"] = "1" -queryParams["offset"] = "1" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4113,31 +4104,19 @@ if err != nil { } ``` -## Delete blocks - -**This endpoint allows you to delete all email addresses on your blocks list.** - -There are two options for deleting blocked emails: +## Delete an reverse DNS record -1. You can delete all blocked emails by setting `delete_all` to true in the request body. -2. You can delete some blocked emails by specifying the email addresses in an array in the request body. +**This endpoint allows you to delete a reverse DNS record.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). -### DELETE /suppression/blocks +### DELETE /whitelabel/ips/{id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips/{id}", host) request.Method = "DELETE" -request.Body = []byte(` { - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4148,19 +4127,19 @@ if err != nil { } ``` -## Retrieve a specific block +## Validate a reverse DNS -**This endpoint allows you to retrieve a specific email address from your blocks list.** +**This endpoint allows you to validate a reverse DNS record.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). -### GET /suppression/blocks/{email} +### POST /whitelabel/ips/{id}/validate ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks/{email}", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips/{id}/validate", host) +request.Method = "POST" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4171,19 +4150,28 @@ if err != nil { } ``` -## Delete a specific block +## Create a Branded Link -**This endpoint allows you to delete a specific email address from your blocks list.** +**This endpoint allows you to create a new link branding.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### DELETE /suppression/blocks/{email} +### POST /whitelabel/links ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks/{email}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links", host) +request.Method = "POST" +request.Body = []byte(` { + "default": true, + "domain": "example.com", + "subdomain": "mail" +}`) +queryParams := make(map[string]string) +queryParams["limit"] = "1" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4194,25 +4182,21 @@ if err != nil { } ``` -## Retrieve all bounces - -**This endpoint allows you to retrieve all of your bounces.** +## Retrieve all link brandings -Bounces are messages that are returned to the server that sent it. +**This endpoint allows you to retrieve all link brandings.** -For more information see: +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### GET /suppression/bounces +### GET /whitelabel/links ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links", host) request.Method = "GET" queryParams := make(map[string]string) -queryParams["start_time"] = "1" -queryParams["end_time"] = "1" +queryParams["limit"] = "1" request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { @@ -4224,32 +4208,29 @@ if err != nil { } ``` -## Delete bounces - -**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.** +## Retrieve a Default Link Branding -Bounces are messages that are returned to the server that sent it. +**This endpoint allows you to retrieve the default link branding.** -For more information see: +Default link branding is the actual link branding to be used when sending messages. If there are multiple link brandings, the default is determined by the following order: + -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes. +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### DELETE /suppression/bounces +### GET /whitelabel/links/default ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces", host) -request.Method = "DELETE" -request.Body = []byte(` { - "delete_all": true, - "emails": [ - "example@example.com", - "example2@example.com" - ] -}`) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/default", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["domain"] = "test_string" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4260,23 +4241,26 @@ if err != nil { } ``` -## Retrieve a Bounce +## Retrieve Associated Link Branding -**This endpoint allows you to retrieve a specific bounce for a given email address.** +**This endpoint allows you to retrieve the associated link branding for a subuser.** -Bounces are messages that are returned to the server that sent it. +Link branding can be associated with subusers from the parent account. This functionality allows +subusers to send mail using their parent's link brands. To associate a link branding, the parent account +must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface. -For more information see: +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### GET /suppression/bounces/{email} +### GET /whitelabel/links/subuser ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces/{email}", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/subuser", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["username"] = "test_string" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4287,25 +4271,25 @@ if err != nil { } ``` -## Delete a bounce +## Disassociate a Link Branding -**This endpoint allows you to remove an email address from your bounce list.** +**This endpoint allows you to disassociate a link branding from a subuser.** -Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list. +Link branding can be associated with subusers from the parent account. This functionality allows +subusers to send mail using their parent's link brands. To associate a link branding, the parent account +must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface. -For more information see: +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information -* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### DELETE /suppression/bounces/{email} +### DELETE /whitelabel/links/subuser ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces/{email}", host) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/subuser", host) request.Method = "DELETE" queryParams := make(map[string]string) -queryParams["email_address"] = "example@example.com" +queryParams["username"] = "test_string" request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { @@ -4317,27 +4301,22 @@ if err != nil { } ``` -## Retrieve all invalid emails - -**This endpoint allows you to retrieve a list of all invalid email addresses.** +## Update a Link Branding -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to update a specific link branding. You can use this endpoint to change a branded link's default status.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### GET /suppression/invalid_emails +### PATCH /whitelabel/links/{id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["start_time"] = "1" -queryParams["limit"] = "1" -queryParams["end_time"] = "1" -queryParams["offset"] = "1" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}", host) +request.Method = "PATCH" +request.Body = []byte(` { + "default": true +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4348,33 +4327,19 @@ if err != nil { } ``` -## Delete invalid emails - -**This endpoint allows you to remove email addresses from your invalid email address list.** - -There are two options for deleting invalid email addresses: - -1) You can delete all invalid email addresses by setting `delete_all` to true in the request body. -2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body. +## Retrieve a Link Branding -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to retrieve a specific link branding.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### DELETE /suppression/invalid_emails +### GET /whitelabel/links/{id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails", host) -request.Method = "DELETE" -request.Body = []byte(` { - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}`) +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4385,21 +4350,19 @@ if err != nil { } ``` -## Retrieve a specific invalid email - -**This endpoint allows you to retrieve a specific invalid email addresses.** +## Delete a Link Branding -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to delete a link branding.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### GET /suppression/invalid_emails/{email} +### DELETE /whitelabel/links/{id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails/{email}", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4410,21 +4373,19 @@ if err != nil { } ``` -## Delete a specific invalid email - -**This endpoint allows you to remove a specific email address from the invalid email address list.** +## Validate a Link Branding -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +**This endpoint allows you to validate a link branding.** -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). -### DELETE /suppression/invalid_emails/{email} +### POST /whitelabel/links/{id}/validate ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails/{email}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}/validate", host) +request.Method = "POST" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4435,19 +4396,26 @@ if err != nil { } ``` -## Retrieve a specific spam report +## Associate a Link Branding -**This endpoint allows you to retrieve a specific spam report.** +**This endpoint allows you to associate a link whitelabel with a subuser account.** -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. +Link branding can be associated with subusers from the parent account. This functionality allows +subusers to send mail using their parent's link brands. To associate a link branding, the parent account +must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface. -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. -### GET /suppression/spam_report/{email} +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/). + +### POST /whitelabel/links/{link_id}/subuser ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_report/{email}", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{link_id}/subuser", host) +request.Method = "POST" +request.Body = []byte(` { + "username": "jane@example.com" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4458,46 +4426,25 @@ if err != nil { } ``` -## Delete a specific spam report + +# STATS -**This endpoint allows you to delete a specific spam report.** +## Retrieve global email statistics -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. +**This endpoint allows you to retrieve all of your global email statistics between a given date range.** -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. -### DELETE /suppression/spam_report/{email} - -```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_report/{email}", host) -request.Method = "DELETE" -response, err := sendgrid.API(request) -if err != nil { - log.Println(err) -} else { - fmt.Println(response.StatusCode) - fmt.Println(response.Body) - fmt.Println(response.Headers) -} -``` - -## Retrieve all spam reports - -**This endpoint allows you to retrieve all spam reports.** - -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. - -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). - -### GET /suppression/spam_reports +### GET /stats ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_reports", host) +request := sendgrid.GetRequest(apiKey, "/v3/stats", host) request.Method = "GET" queryParams := make(map[string]string) -queryParams["start_time"] = "1" +queryParams["aggregated_by"] = "day" queryParams["limit"] = "1" -queryParams["end_time"] = "1" +queryParams["start_date"] = "2016-01-01" +queryParams["end_date"] = "2016-04-01" queryParams["offset"] = "1" request.QueryParams = queryParams response, err := sendgrid.API(request) @@ -4510,30 +4457,31 @@ if err != nil { } ``` -## Delete spam reports - -**This endpoint allows you to delete your spam reports.** + +# SUBUSERS -There are two options for deleting spam reports: +## Create Subuser -1) You can delete all spam reports by setting "delete_all" to true in the request body. -2) You can delete some spam reports by specifying the email addresses in an array in the request body. +This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. -[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. +For more information about Subusers: -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) -### DELETE /suppression/spam_reports +### POST /subusers ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_reports", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/subusers", host) +request.Method = "POST" request.Body = []byte(` { - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] + "email": "John@example.com", + "ips": [ + "1.1.1.1", + "2.2.2.2" + ], + "password": "johns_password", + "username": "John@example.com" }`) response, err := sendgrid.API(request) if err != nil { @@ -4545,21 +4493,23 @@ if err != nil { } ``` -## Retrieve all global suppressions +## List all Subusers -**This endpoint allows you to retrieve a list of all email address that are globally suppressed.** +This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API. -A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html). +For more information about Subusers: -### GET /suppression/unsubscribes +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) + +### GET /subusers ```go -request := sendgrid.GetRequest(apiKey, "/v3/suppression/unsubscribes", host) +request := sendgrid.GetRequest(apiKey, "/v3/subusers", host) request.Method = "GET" queryParams := make(map[string]string) -queryParams["start_time"] = "1" +queryParams["username"] = "test_string" queryParams["limit"] = "1" -queryParams["end_time"] = "1" queryParams["offset"] = "1" request.QueryParams = queryParams response, err := sendgrid.API(request) @@ -4572,25 +4522,20 @@ if err != nil { } ``` - -# TEMPLATES - -## Create a transactional template. - -**This endpoint allows you to create a transactional template.** +## Retrieve Subuser Reputations -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +This endpoint allows you to request the reputations for your subusers. -### POST /templates +### GET /subusers/reputations ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates", host) -request.Method = "POST" -request.Body = []byte(` { - "name": "example_name" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/reputations", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["usernames"] = "test_string" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4601,19 +4546,29 @@ if err != nil { } ``` -## Retrieve all transactional templates. +## Retrieve email statistics for your subusers. -**This endpoint allows you to retrieve all transactional templates.** +**This endpoint allows you to retrieve the email statistics for the given subusers.** -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. -### GET /templates +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). + +### GET /subusers/stats ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates", host) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/stats", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["end_date"] = "2016-04-01" +queryParams["aggregated_by"] = "day" +queryParams["limit"] = "1" +queryParams["offset"] = "1" +queryParams["start_date"] = "2016-01-01" +queryParams["subusers"] = "test_string" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4624,23 +4579,30 @@ if err != nil { } ``` -## Edit a transactional template. +## Retrieve monthly stats for all subusers -**This endpoint allows you to edit a transactional template.** +**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: +`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). -### PATCH /templates/{template_id} +### GET /subusers/stats/monthly ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}", host) -request.Method = "PATCH" -request.Body = []byte(` { - "name": "new_example_name" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/stats/monthly", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["subuser"] = "test_string" +queryParams["limit"] = "1" +queryParams["sort_by_metric"] = "test_string" +queryParams["offset"] = "1" +queryParams["date"] = "test_string" +queryParams["sort_by_direction"] = "asc" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4651,20 +4613,29 @@ if err != nil { } ``` -## Retrieve a single transactional template. +## Retrieve the totals for each email statistic metric for all subusers. -**This endpoint allows you to retrieve a single transactional template.** +**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). -### GET /templates/{template_id} +### GET /subusers/stats/sums ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}", host) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/stats/sums", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["end_date"] = "2016-04-01" +queryParams["aggregated_by"] = "day" +queryParams["limit"] = "1" +queryParams["sort_by_metric"] = "test_string" +queryParams["offset"] = "1" +queryParams["start_date"] = "2016-01-01" +queryParams["sort_by_direction"] = "asc" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4675,20 +4646,23 @@ if err != nil { } ``` -## Delete a template. - -**This endpoint allows you to delete a transactional template.** +## Enable/disable a subuser -Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. +This endpoint allows you to enable or disable a subuser. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +For more information about Subusers: +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) -### DELETE /templates/{template_id} +### PATCH /subusers/{subuser_name} ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}", host) +request.Method = "PATCH" +request.Body = []byte(` { + "disabled": false +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4699,28 +4673,20 @@ if err != nil { } ``` -## Create a new transactional template version. - -**This endpoint allows you to create a new version of a template.** +## Delete a subuser -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates. +This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved. -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +For more information about Subusers: +* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html) +* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html) -### POST /templates/{template_id}/versions +### DELETE /subusers/{subuser_name} ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions", host) -request.Method = "POST" -request.Body = []byte(` { - "active": 1, - "html_content": "<%body%>", - "name": "example_version_name", - "plain_content": "<%body%>", - "subject": "<%subject%>", - "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4731,32 +4697,23 @@ if err != nil { } ``` -## Edit a transactional template version. - -**This endpoint allows you to edit a version of one of your transactional templates.** +## Update IPs assigned to a subuser -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates. +Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well. -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +More information: -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html) +* [Setup Reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) -### PATCH /templates/{template_id}/versions/{version_id} +### PUT /subusers/{subuser_name}/ips ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}", host) -request.Method = "PATCH" -request.Body = []byte(` { - "active": 1, - "html_content": "<%body%>", - "name": "updated_example_name", - "plain_content": "<%body%>", - "subject": "<%subject%>" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/ips", host) +request.Method = "PUT" +request.Body = []byte(` [ + "127.0.0.1" +]`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4767,25 +4724,19 @@ if err != nil { } ``` -## Retrieve a specific transactional template version. - -**This endpoint allows you to retrieve a specific version of a template.** - -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. - -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +## Update Monitor Settings for a subuser -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -### GET /templates/{template_id}/versions/{version_id} +### PUT /subusers/{subuser_name}/monitor ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) +request.Method = "PUT" +request.Body = []byte(` { + "email": "example@example.com", + "frequency": 500 +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4796,25 +4747,19 @@ if err != nil { } ``` -## Delete a transactional template version. - -**This endpoint allows you to delete one of your transactional template versions.** - -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. - -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +## Create monitor settings -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -### DELETE /templates/{template_id}/versions/{version_id} +### POST /subusers/{subuser_name}/monitor ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) +request.Method = "POST" +request.Body = []byte(` { + "email": "example@example.com", + "frequency": 50000 +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4825,26 +4770,15 @@ if err != nil { } ``` -## Activate a transactional template version. - -**This endpoint allows you to activate a version of one of your templates.** - -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. - - -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +## Retrieve monitor settings for a subuser -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -### POST /templates/{template_id}/versions/{version_id}/activate +### GET /subusers/{subuser_name}/monitor ```go -request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}/activate", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4855,26 +4789,15 @@ if err != nil { } ``` - -# TRACKING SETTINGS - -## Retrieve Tracking Settings - -**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.** - -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +## Delete monitor settings -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -### GET /tracking_settings +### DELETE /subusers/{subuser_name}/monitor ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["limit"] = "1" -queryParams["offset"] = "1" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/monitor", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4885,22 +4808,29 @@ if err != nil { } ``` -## Update Click Tracking Settings +## Retrieve the monthly email statistics for a single subuser -**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.** +**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.** -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: +`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. -### PATCH /tracking_settings/click +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). + +### GET /subusers/{subuser_name}/stats/monthly ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/click", host) -request.Method = "PATCH" -request.Body = []byte(` { - "enabled": true -}`) +request := sendgrid.GetRequest(apiKey, "/v3/subusers/{subuser_name}/stats/monthly", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["date"] = "test_string" +queryParams["sort_by_direction"] = "asc" +queryParams["limit"] = "1" +queryParams["sort_by_metric"] = "test_string" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4911,19 +4841,28 @@ if err != nil { } ``` -## Retrieve Click Track Settings + +# SUPPRESSION -**This endpoint allows you to retrieve your current click tracking setting.** +## Retrieve all blocks -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.** -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -### GET /tracking_settings/click +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). + +### GET /suppression/blocks ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/click", host) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["start_time"] = "1" +queryParams["limit"] = "1" +queryParams["end_time"] = "1" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -4934,30 +4873,30 @@ if err != nil { } ``` -## Update Google Analytics Settings +## Delete blocks -**This endpoint allows you to update your current setting for Google Analytics.** +**This endpoint allows you to delete all email addresses on your blocks list.** -For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). +There are two options for deleting blocked emails: -We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). +1. You can delete all blocked emails by setting `delete_all` to true in the request body. +2. You can delete some blocked emails by specifying the email addresses in an array in the request body. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### PATCH /tracking_settings/google_analytics +### DELETE /suppression/blocks ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/google_analytics", host) -request.Method = "PATCH" +request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks", host) +request.Method = "DELETE" request.Body = []byte(` { - "enabled": true, - "utm_campaign": "website", - "utm_content": "", - "utm_medium": "email", - "utm_source": "sendgrid.com", - "utm_term": "" + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] }`) response, err := sendgrid.API(request) if err != nil { @@ -4969,22 +4908,18 @@ if err != nil { } ``` -## Retrieve Google Analytics Settings - -**This endpoint allows you to retrieve your current setting for Google Analytics.** - -For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). +## Retrieve a specific block -We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). +**This endpoint allows you to retrieve a specific email address from your blocks list.** -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### GET /tracking_settings/google_analytics +### GET /suppression/blocks/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/google_analytics", host) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks/{email}", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -4996,24 +4931,19 @@ if err != nil { } ``` -## Update Open Tracking Settings - -**This endpoint allows you to update your current settings for open tracking.** +## Delete a specific block -Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +**This endpoint allows you to delete a specific email address from your blocks list.** -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### PATCH /tracking_settings/open +### DELETE /suppression/blocks/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/open", host) -request.Method = "PATCH" -request.Body = []byte(` { - "enabled": true -}`) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/blocks/{email}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5024,21 +4954,26 @@ if err != nil { } ``` -## Get Open Tracking Settings +## Retrieve all bounces -**This endpoint allows you to retrieve your current settings for open tracking.** +**This endpoint allows you to retrieve all of your bounces.** -Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +Bounces are messages that are returned to the server that sent it. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information see: -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) -### GET /tracking_settings/open +### GET /suppression/bounces ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/open", host) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["start_time"] = "1" +queryParams["end_time"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5049,28 +4984,31 @@ if err != nil { } ``` -## Update Subscription Tracking Settings +## Delete bounces -**This endpoint allows you to update your current settings for subscription tracking.** +**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.** -Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +Bounces are messages that are returned to the server that sent it. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information see: -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -### PATCH /tracking_settings/subscription +Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes. + +### DELETE /suppression/bounces ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/subscription", host) -request.Method = "PATCH" +request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces", host) +request.Method = "DELETE" request.Body = []byte(` { - "enabled": true, - "html_content": "html content", - "landing": "landing page html", - "plain_content": "text content", - "replace": "replacement tag", - "url": "url" + "delete_all": true, + "emails": [ + "example@example.com", + "example2@example.com" + ] }`) response, err := sendgrid.API(request) if err != nil { @@ -5082,20 +5020,22 @@ if err != nil { } ``` -## Retrieve Subscription Tracking Settings +## Retrieve a Bounce -**This endpoint allows you to retrieve your current settings for subscription tracking.** +**This endpoint allows you to retrieve a specific bounce for a given email address.** -Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +Bounces are messages that are returned to the server that sent it. -You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information see: -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -### GET /tracking_settings/subscription +### GET /suppression/bounces/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/subscription", host) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces/{email}", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5107,26 +5047,26 @@ if err != nil { } ``` - -# USER - -## Get a user's account information. - -**This endpoint allows you to retrieve your user account details.** +## Delete a bounce -Your user's account information includes the user's account type and reputation. +**This endpoint allows you to remove an email address from your bounce list.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list. -For more information about your user profile: +For more information see: -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information +* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -### GET /user/account +### DELETE /suppression/bounces/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/account", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/suppression/bounces/{email}", host) +request.Method = "DELETE" +queryParams := make(map[string]string) +queryParams["email_address"] = "example@example.com" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5137,17 +5077,27 @@ if err != nil { } ``` -## Retrieve your credit balance +## Retrieve all invalid emails -**This endpoint allows you to retrieve the current credit balance for your account.** +**This endpoint allows you to retrieve a list of all invalid email addresses.** -Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html). +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -### GET /user/credits +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. + +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). + +### GET /suppression/invalid_emails ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/credits", host) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["start_time"] = "1" +queryParams["limit"] = "1" +queryParams["end_time"] = "1" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5158,23 +5108,32 @@ if err != nil { } ``` -## Update your account email address +## Delete invalid emails -**This endpoint allows you to update the email address currently on file for your account.** +**This endpoint allows you to remove email addresses from your invalid email address list.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +There are two options for deleting invalid email addresses: -For more information about your user profile: +1) You can delete all invalid email addresses by setting `delete_all` to true in the request body. +2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -### PUT /user/email +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. + +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). + +### DELETE /suppression/invalid_emails ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/email", host) -request.Method = "PUT" +request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails", host) +request.Method = "DELETE" request.Body = []byte(` { - "email": "example@example.com" + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] }`) response, err := sendgrid.API(request) if err != nil { @@ -5186,20 +5145,20 @@ if err != nil { } ``` -## Retrieve your account email address +## Retrieve a specific invalid email -**This endpoint allows you to retrieve the email address currently on file for your account.** +**This endpoint allows you to retrieve a specific invalid email addresses.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -For more information about your user profile: +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). -### GET /user/email +### GET /suppression/invalid_emails/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/email", host) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails/{email}", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5211,25 +5170,21 @@ if err != nil { } ``` -## Update your password +## Delete a specific invalid email -**This endpoint allows you to update your password.** +**This endpoint allows you to remove a specific email address from the invalid email address list.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. -For more information about your user profile: +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). -### PUT /user/password +### DELETE /suppression/invalid_emails/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/password", host) -request.Method = "PUT" -request.Body = []byte(` { - "new_password": "new_password", - "old_password": "old_password" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/invalid_emails/{email}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5240,28 +5195,19 @@ if err != nil { } ``` -## Update a user's profile - -**This endpoint allows you to update your current profile details.** - -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +## Retrieve a specific spam report -For more information about your user profile: +**This endpoint allows you to retrieve a specific spam report.** -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. -It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH. +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### PATCH /user/profile +### GET /suppression/spam_report/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/profile", host) -request.Method = "PATCH" -request.Body = []byte(` { - "city": "Orange", - "first_name": "Example", - "last_name": "User" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_report/{email}", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5272,19 +5218,19 @@ if err != nil { } ``` -## Get a user's profile +## Delete a specific spam report -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +**This endpoint allows you to delete a specific spam report.** -For more information about your user profile: +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### GET /user/profile +### DELETE /suppression/spam_report/{email} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/profile", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_report/{email}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5295,24 +5241,25 @@ if err != nil { } ``` -## Cancel or pause a scheduled send +## Retrieve all spam reports -**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.** +**This endpoint allows you to retrieve all spam reports.** -If the maximum number of cancellations/pauses are added, HTTP 400 will -be returned. +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). -### POST /user/scheduled_sends +### GET /suppression/spam_reports ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends", host) -request.Method = "POST" -request.Body = []byte(` { - "batch_id": "YOUR_BATCH_ID", - "status": "pause" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_reports", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["start_time"] = "1" +queryParams["limit"] = "1" +queryParams["end_time"] = "1" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5323,17 +5270,31 @@ if err != nil { } ``` -## Retrieve all scheduled sends +## Delete spam reports -**This endpoint allows you to retrieve all cancel/paused scheduled send information.** +**This endpoint allows you to delete your spam reports.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +There are two options for deleting spam reports: -### GET /user/scheduled_sends +1) You can delete all spam reports by setting "delete_all" to true in the request body. +2) You can delete some spam reports by specifying the email addresses in an array in the request body. + +[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid. + +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). + +### DELETE /suppression/spam_reports ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/suppression/spam_reports", host) +request.Method = "DELETE" +request.Body = []byte(` { + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5344,20 +5305,23 @@ if err != nil { } ``` -## Update user scheduled send information +## Retrieve all global suppressions -**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** +**This endpoint allows you to retrieve a list of all email address that are globally suppressed.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html). -### PATCH /user/scheduled_sends/{batch_id} +### GET /suppression/unsubscribes ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends/{batch_id}", host) -request.Method = "PATCH" -request.Body = []byte(` { - "status": "pause" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/suppression/unsubscribes", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["start_time"] = "1" +queryParams["limit"] = "1" +queryParams["end_time"] = "1" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5368,17 +5332,25 @@ if err != nil { } ``` -## Retrieve scheduled send + +# TEMPLATES -**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** +## Create a transactional template. -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +**This endpoint allows you to create a transactional template.** -### GET /user/scheduled_sends/{batch_id} +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. + +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). + +### POST /templates ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends/{batch_id}", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/templates", host) +request.Method = "POST" +request.Body = []byte(` { + "name": "example_name" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5389,17 +5361,19 @@ if err != nil { } ``` -## Delete a cancellation or pause of a scheduled send +## Retrieve all transactional templates. + +**This endpoint allows you to retrieve all transactional templates.** -**This endpoint allows you to delete the cancellation/pause of a scheduled send.** +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### DELETE /user/scheduled_sends/{batch_id} +### GET /templates ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends/{batch_id}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/templates", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5410,22 +5384,22 @@ if err != nil { } ``` -## Update Enforced TLS settings +## Edit a transactional template. -**This endpoint allows you to update your current Enforced TLS settings.** +**This endpoint allows you to edit a transactional template.** -The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### PATCH /user/settings/enforced_tls + +### PATCH /templates/{template_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/settings/enforced_tls", host) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}", host) request.Method = "PATCH" request.Body = []byte(` { - "require_tls": true, - "require_valid_cert": false + "name": "new_example_name" }`) response, err := sendgrid.API(request) if err != nil { @@ -5437,18 +5411,19 @@ if err != nil { } ``` -## Retrieve current Enforced TLS settings. +## Retrieve a single transactional template. -**This endpoint allows you to retrieve your current Enforced TLS settings.** +**This endpoint allows you to retrieve a single transactional template.** -The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### GET /user/settings/enforced_tls + +### GET /templates/{template_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/settings/enforced_tls", host) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5460,24 +5435,20 @@ if err != nil { } ``` -## Update your username +## Delete a template. -**This endpoint allows you to update the username for your account.** +**This endpoint allows you to delete a transactional template.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -For more information about your user profile: +Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### PUT /user/username +### DELETE /templates/{template_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/username", host) -request.Method = "PUT" -request.Body = []byte(` { - "username": "test_username" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5488,21 +5459,28 @@ if err != nil { } ``` -## Retrieve your username +## Create a new transactional template version. -**This endpoint allows you to retrieve your current account username.** +**This endpoint allows you to create a new version of a template.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates. -For more information about your user profile: +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### GET /user/username +### POST /templates/{template_id}/versions ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/username", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions", host) +request.Method = "POST" +request.Body = []byte(` { + "active": 1, + "html_content": "<%body%>", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5513,35 +5491,31 @@ if err != nil { } ``` -## Update Event Notification Settings +## Edit a transactional template version. -**This endpoint allows you to update your current event webhook settings.** +**This endpoint allows you to edit a version of one of your transactional templates.** -If an event type is marked as `true`, then the event webhook will include information about that event. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates. -SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | -### PATCH /user/webhooks/event/settings +### PATCH /templates/{template_id}/versions/{version_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/event/settings", host) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}", host) request.Method = "PATCH" request.Body = []byte(` { - "bounce": true, - "click": true, - "deferred": true, - "delivered": true, - "dropped": true, - "enabled": true, - "group_resubscribe": true, - "group_unsubscribe": true, - "open": true, - "processed": true, - "spam_report": true, - "unsubscribe": true, - "url": "url" + "active": 1, + "html_content": "<%body%>", + "name": "updated_example_name", + "plain_content": "<%body%>", + "subject": "<%subject%>" }`) response, err := sendgrid.API(request) if err != nil { @@ -5553,20 +5527,24 @@ if err != nil { } ``` -## Retrieve Event Webhook settings +## Retrieve a specific transactional template version. -**This endpoint allows you to retrieve your current event webhook settings.** +**This endpoint allows you to retrieve a specific version of a template.** -If an event type is marked as `true`, then the event webhook will include information about that event. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | -### GET /user/webhooks/event/settings +### GET /templates/{template_id}/versions/{version_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/event/settings", host) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5578,22 +5556,25 @@ if err != nil { } ``` -## Test Event Notification Settings +## Delete a transactional template version. -**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.** +**This endpoint allows you to delete one of your transactional template versions.** -SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). -### POST /user/webhooks/event/test +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | + +### DELETE /templates/{template_id}/versions/{version_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/event/test", host) -request.Method = "POST" -request.Body = []byte(` { - "url": "url" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5604,23 +5585,26 @@ if err != nil { } ``` -## Create a parse setting +## Activate a transactional template version. -**This endpoint allows you to create a new inbound parse setting.** +**This endpoint allows you to activate a version of one of your templates.** -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. -### POST /user/webhooks/parse/settings + +For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). + +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | + +### POST /templates/{template_id}/versions/{version_id}/activate ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings", host) +request := sendgrid.GetRequest(apiKey, "/v3/templates/{template_id}/versions/{version_id}/activate", host) request.Method = "POST" -request.Body = []byte(` { - "hostname": "myhostname.com", - "send_raw": false, - "spam_check": true, - "url": "http://email.myhosthame.com" -}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5631,17 +5615,26 @@ if err != nil { } ``` -## Retrieve all parse settings + +# TRACKING SETTINGS -**This endpoint allows you to retrieve all of your current inbound parse settings.** +## Retrieve Tracking Settings -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.** -### GET /user/webhooks/parse/settings +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. + +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### GET /tracking_settings ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings", host) +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings", host) request.Method = "GET" +queryParams := make(map[string]string) +queryParams["limit"] = "1" +queryParams["offset"] = "1" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5652,21 +5645,21 @@ if err != nil { } ``` -## Update a parse setting +## Update Click Tracking Settings -**This endpoint allows you to update a specific inbound parse setting.** +**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.** -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -### PATCH /user/webhooks/parse/settings/{hostname} +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### PATCH /tracking_settings/click ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings/{hostname}", host) +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/click", host) request.Method = "PATCH" request.Body = []byte(` { - "send_raw": true, - "spam_check": false, - "url": "http://newdomain.com/parse" + "enabled": true }`) response, err := sendgrid.API(request) if err != nil { @@ -5678,16 +5671,18 @@ if err != nil { } ``` -## Retrieve a specific parse setting +## Retrieve Click Track Settings -**This endpoint allows you to retrieve a specific inbound parse setting.** +**This endpoint allows you to retrieve your current click tracking setting.** -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -### GET /user/webhooks/parse/settings/{hostname} +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### GET /tracking_settings/click ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings/{hostname}", host) +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/click", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5699,17 +5694,58 @@ if err != nil { } ``` -## Delete a parse setting +## Update Google Analytics Settings + +**This endpoint allows you to update your current setting for Google Analytics.** + +For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). + +We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). + +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. + +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### PATCH /tracking_settings/google_analytics + +```go +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/google_analytics", host) +request.Method = "PATCH" +request.Body = []byte(` { + "enabled": true, + "utm_campaign": "website", + "utm_content": "", + "utm_medium": "email", + "utm_source": "sendgrid.com", + "utm_term": "" +}`) +response, err := sendgrid.API(request) +if err != nil { + log.Println(err) +} else { + fmt.Println(response.StatusCode) + fmt.Println(response.Body) + fmt.Println(response.Headers) +} +``` + +## Retrieve Google Analytics Settings -**This endpoint allows you to delete a specific inbound parse setting.** +**This endpoint allows you to retrieve your current setting for Google Analytics.** -The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). +For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445). -### DELETE /user/webhooks/parse/settings/{hostname} +We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html). + +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. + +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### GET /tracking_settings/google_analytics ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings/{hostname}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/google_analytics", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5720,26 +5756,24 @@ if err != nil { } ``` -## Retrieves Inbound Parse Webhook statistics. +## Update Open Tracking Settings -**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** +**This endpoint allows you to update your current settings for open tracking.** -SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments. +Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. -There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -### GET /user/webhooks/parse/stats +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### PATCH /tracking_settings/open ```go -request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/stats", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["aggregated_by"] = "day" -queryParams["limit"] = "test_string" -queryParams["start_date"] = "2016-01-01" -queryParams["end_date"] = "2016-04-01" -queryParams["offset"] = "test_string" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/open", host) +request.Method = "PATCH" +request.Body = []byte(` { + "enabled": true +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5750,38 +5784,21 @@ if err != nil { } ``` - -# WHITELABEL - -## Create a domain whitelabel. +## Get Open Tracking Settings -**This endpoint allows you to create a whitelabel for one of your domains.** +**This endpoint allows you to retrieve your current settings for open tracking.** -If you are creating a domain whitelabel that you would like a subuser to use, you have two options: -1. Use the "username" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser is able to see and modify the created whitelabel. -2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their own whitelabel it will overwrite the assigned whitelabel. +Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### POST /whitelabel/domains +### GET /tracking_settings/open ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains", host) -request.Method = "POST" -request.Body = []byte(` { - "automatic_security": false, - "custom_spf": true, - "default": true, - "domain": "example.com", - "ips": [ - "192.168.1.1", - "192.168.1.2" - ], - "subdomain": "news", - "username": "john@example.com" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/open", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5792,27 +5809,29 @@ if err != nil { } ``` -## List all domain whitelabels. +## Update Subscription Tracking Settings -**This endpoint allows you to retrieve a list of all domain whitelabels you have created.** +**This endpoint allows you to update your current settings for subscription tracking.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### GET /whitelabel/domains +### PATCH /tracking_settings/subscription ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["username"] = "test_string" -queryParams["domain"] = "test_string" -queryParams["exclude_subusers"] = "true" -queryParams["limit"] = "1" -queryParams["offset"] = "1" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/subscription", host) +request.Method = "PATCH" +request.Body = []byte(` { + "enabled": true, + "html_content": "html content", + "landing": "landing page html", + "plain_content": "text content", + "replace": "replacement tag", + "url": "url" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5823,23 +5842,20 @@ if err != nil { } ``` -## Get the default domain whitelabel. +## Retrieve Subscription Tracking Settings -**This endpoint allows you to retrieve the default whitelabel for a domain.** +**This endpoint allows you to retrieve your current settings for subscription tracking.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| domain | string |The domain to find a default domain whitelabel for. | +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### GET /whitelabel/domains/default +### GET /tracking_settings/subscription ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/default", host) +request := sendgrid.GetRequest(apiKey, "/v3/tracking_settings/subscription", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5851,25 +5867,25 @@ if err != nil { } ``` -## List the domain whitelabel associated with the given user. + +# USER -**This endpoint allows you to retrieve all of the whitelabels that have been assigned to a specific subuser.** +## Get a user's account information. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +**This endpoint allows you to retrieve your user account details.** -Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. +Your user's account information includes the user's account type and reputation. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| username | string | Username of the subuser to find associated whitelabels for. | +For more information about your user profile: -### GET /whitelabel/domains/subuser +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### GET /user/account ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/subuser", host) +request := sendgrid.GetRequest(apiKey, "/v3/user/account", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5881,26 +5897,17 @@ if err != nil { } ``` -## Disassociate a domain whitelabel from a given user. - -**This endpoint allows you to disassociate a specific whitelabel from a subuser.** - -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. - -Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. +## Retrieve your credit balance -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +**This endpoint allows you to retrieve the current credit balance for your account.** -## URI Parameters -| URI Parameter | Type | Required? | Description | -|---|---|---|---| -| username | string | required | Username for the subuser to find associated whitelabels for. | +Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html). -### DELETE /whitelabel/domains/subuser +### GET /user/credits ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/subuser", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/user/credits", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5911,22 +5918,23 @@ if err != nil { } ``` -## Update a domain whitelabel. +## Update your account email address + +**This endpoint allows you to update the email address currently on file for your account.** -**This endpoint allows you to update the settings for a domain whitelabel.** +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +For more information about your user profile: -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### PATCH /whitelabel/domains/{domain_id} +### PUT /user/email ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}", host) -request.Method = "PATCH" +request := sendgrid.GetRequest(apiKey, "/v3/user/email", host) +request.Method = "PUT" request.Body = []byte(` { - "custom_spf": true, - "default": false + "email": "example@example.com" }`) response, err := sendgrid.API(request) if err != nil { @@ -5938,19 +5946,20 @@ if err != nil { } ``` -## Retrieve a domain whitelabel. +## Retrieve your account email address -**This endpoint allows you to retrieve a specific domain whitelabel.** +**This endpoint allows you to retrieve the email address currently on file for your account.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about your user profile: +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### GET /whitelabel/domains/{domain_id} +### GET /user/email ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}", host) +request := sendgrid.GetRequest(apiKey, "/v3/user/email", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -5962,19 +5971,25 @@ if err != nil { } ``` -## Delete a domain whitelabel. +## Update your password + +**This endpoint allows you to update your password.** -**This endpoint allows you to delete a domain whitelabel.** +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +For more information about your user profile: -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### DELETE /whitelabel/domains/{domain_id} +### PUT /user/password ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/user/password", host) +request.Method = "PUT" +request.Body = []byte(` { + "new_password": "new_password", + "old_password": "old_password" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -5985,28 +6000,27 @@ if err != nil { } ``` -## Associate a domain whitelabel with a given user. +## Update a user's profile -**This endpoint allows you to associate a specific domain whitelabel with a subuser.** +**This endpoint allows you to update your current profile details.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. +For more information about your user profile: -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| domain_id | integer | ID of the domain whitelabel to associate with the subuser. | +It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH. -### POST /whitelabel/domains/{domain_id}/subuser +### PATCH /user/profile ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{domain_id}/subuser", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/user/profile", host) +request.Method = "PATCH" request.Body = []byte(` { - "username": "jane@example.com" + "city": "Orange", + "first_name": "Example", + "last_name": "User" }`) response, err := sendgrid.API(request) if err != nil { @@ -6018,27 +6032,19 @@ if err != nil { } ``` -## Add an IP to a domain whitelabel. - -**This endpoint allows you to add an IP address to a domain whitelabel.** +## Get a user's profile -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +For more information about your user profile: -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer | ID of the domain to which you are adding an IP | +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### POST /whitelabel/domains/{id}/ips +### GET /user/profile ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{id}/ips", host) -request.Method = "POST" -request.Body = []byte(` { - "ip": "192.168.0.1" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/user/profile", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6049,25 +6055,24 @@ if err != nil { } ``` -## Remove an IP from a domain whitelabel. - -**This endpoint allows you to remove a domain's IP address from that domain's whitelabel.** +## Cancel or pause a scheduled send -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.** -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +If the maximum number of cancellations/pauses are added, HTTP 400 will +be returned. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer | ID of the domain whitelabel to delete the IP from. | -| ip | string | IP to remove from the domain whitelabel. | +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### DELETE /whitelabel/domains/{id}/ips/{ip} +### POST /user/scheduled_sends ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{id}/ips/{ip}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends", host) +request.Method = "POST" +request.Body = []byte(` { + "batch_id": "YOUR_BATCH_ID", + "status": "pause" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6078,24 +6083,17 @@ if err != nil { } ``` -## Validate a domain whitelabel. - -**This endpoint allows you to validate a domain whitelabel. If it fails, it will return an error message describing why the whitelabel could not be validated.** - -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. - -For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) +## Retrieve all scheduled sends -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer |ID of the domain whitelabel to validate. | +**This endpoint allows you to retrieve all cancel/paused scheduled send information.** -### POST /whitelabel/domains/{id}/validate +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. + +### GET /user/scheduled_sends ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/domains/{id}/validate", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6106,25 +6104,19 @@ if err != nil { } ``` -## Create an IP whitelabel - -**This endpoint allows you to create an IP whitelabel.** - -When creating an IP whitelable, you should use the same subdomain that you used when you created a domain whitelabel. +## Update user scheduled send information -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### POST /whitelabel/ips +### PATCH /user/scheduled_sends/{batch_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends/{batch_id}", host) +request.Method = "PATCH" request.Body = []byte(` { - "domain": "example.com", - "ip": "192.168.1.1", - "subdomain": "email" + "status": "pause" }`) response, err := sendgrid.API(request) if err != nil { @@ -6136,26 +6128,17 @@ if err != nil { } ``` -## Retrieve all IP whitelabels - -**This endpoint allows you to retrieve all of the IP whitelabels that have been created by this account.** - -You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192."). +## Retrieve scheduled send -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### GET /whitelabel/ips +### GET /user/scheduled_sends/{batch_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips", host) +request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends/{batch_id}", host) request.Method = "GET" -queryParams := make(map[string]string) -queryParams["ip"] = "test_string" -queryParams["limit"] = "1" -queryParams["offset"] = "1" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6166,19 +6149,17 @@ if err != nil { } ``` -## Retrieve an IP whitelabel - -**This endpoint allows you to retrieve an IP whitelabel.** +## Delete a cancellation or pause of a scheduled send -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +**This endpoint allows you to delete the cancellation/pause of a scheduled send.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. -### GET /whitelabel/ips/{id} +### DELETE /user/scheduled_sends/{batch_id} ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips/{id}", host) -request.Method = "GET" +request := sendgrid.GetRequest(apiKey, "/v3/user/scheduled_sends/{batch_id}", host) +request.Method = "DELETE" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6189,19 +6170,23 @@ if err != nil { } ``` -## Delete an IP whitelabel +## Update Enforced TLS settings -**This endpoint allows you to delete an IP whitelabel.** +**This endpoint allows you to update your current Enforced TLS settings.** -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. -### DELETE /whitelabel/ips/{id} +### PATCH /user/settings/enforced_tls ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips/{id}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/user/settings/enforced_tls", host) +request.Method = "PATCH" +request.Body = []byte(` { + "require_tls": true, + "require_valid_cert": false +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6212,19 +6197,19 @@ if err != nil { } ``` -## Validate an IP whitelabel +## Retrieve current Enforced TLS settings. -**This endpoint allows you to validate an IP whitelabel.** +**This endpoint allows you to retrieve your current Enforced TLS settings.** -A IP whitelabel consists of a subdomain and domain that will be used to generate a reverse DNS record for a given IP. Once SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated. +The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/ips.html). +**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description. -### POST /whitelabel/ips/{id}/validate +### GET /user/settings/enforced_tls ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/ips/{id}/validate", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/user/settings/enforced_tls", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6235,28 +6220,24 @@ if err != nil { } ``` -## Create a Link Whitelabel +## Update your username + +**This endpoint allows you to update the username for your account.** -**This endpoint allows you to create a new link whitelabel.** +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +For more information about your user profile: -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### POST /whitelabel/links +### PUT /user/username ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/user/username", host) +request.Method = "PUT" request.Body = []byte(` { - "default": true, - "domain": "example.com", - "subdomain": "mail" + "username": "test_username" }`) -queryParams := make(map[string]string) -queryParams["limit"] = "1" -queryParams["offset"] = "1" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6267,22 +6248,21 @@ if err != nil { } ``` -## Retrieve all link whitelabels +## Retrieve your username + +**This endpoint allows you to retrieve your current account username.** -**This endpoint allows you to retrieve all link whitelabels.** +Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +For more information about your user profile: -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) -### GET /whitelabel/links +### GET /user/username ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links", host) +request := sendgrid.GetRequest(apiKey, "/v3/user/username", host) request.Method = "GET" -queryParams := make(map[string]string) -queryParams["limit"] = "1" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6293,29 +6273,36 @@ if err != nil { } ``` -## Retrieve a Default Link Whitelabel +## Update Event Notification Settings -**This endpoint allows you to retrieve the default link whitelabel.** +**This endpoint allows you to update your current event webhook settings.** -Default link whitelabel is the actual link whitelabel to be used when sending messages. If there are multiple link whitelabels, the default is determined by the following order: - +If an event type is marked as `true`, then the event webhook will include information about that event. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. -### GET /whitelabel/links/default +### PATCH /user/webhooks/event/settings ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/default", host) -request.Method = "GET" -queryParams := make(map[string]string) -queryParams["domain"] = "test_string" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/event/settings", host) +request.Method = "PATCH" +request.Body = []byte(` { + "bounce": true, + "click": true, + "deferred": true, + "delivered": true, + "dropped": true, + "enabled": true, + "group_resubscribe": true, + "group_unsubscribe": true, + "open": true, + "processed": true, + "spam_report": true, + "unsubscribe": true, + "url": "url" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6326,26 +6313,21 @@ if err != nil { } ``` -## Retrieve Associated Link Whitelabel +## Retrieve Event Webhook settings -**This endpoint allows you to retrieve the associated link whitelabel for a subuser.** +**This endpoint allows you to retrieve your current event webhook settings.** -Link whitelables can be associated with subusers from the parent account. This functionality allows -subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account -must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface. +If an event type is marked as `true`, then the event webhook will include information about that event. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. -### GET /whitelabel/links/subuser +### GET /user/webhooks/event/settings ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/subuser", host) +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/event/settings", host) request.Method = "GET" -queryParams := make(map[string]string) -queryParams["username"] = "test_string" -request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6356,26 +6338,22 @@ if err != nil { } ``` -## Disassociate a Link Whitelabel - -**This endpoint allows you to disassociate a link whitelabel from a subuser.** +## Test Event Notification Settings -Link whitelables can be associated with subusers from the parent account. This functionality allows -subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account -must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface. +**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.** -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. -### DELETE /whitelabel/links/subuser +### POST /user/webhooks/event/test ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/subuser", host) -request.Method = "DELETE" -queryParams := make(map[string]string) -queryParams["username"] = "test_string" -request.QueryParams = queryParams +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/event/test", host) +request.Method = "POST" +request.Body = []byte(` { + "url": "url" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6386,21 +6364,22 @@ if err != nil { } ``` -## Update a Link Whitelabel - -**This endpoint allows you to update a specific link whitelabel. You can use this endpoint to change a link whitelabel's default status.** +## Create a parse setting -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to create a new inbound parse setting.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### PATCH /whitelabel/links/{id} +### POST /user/webhooks/parse/settings ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}", host) -request.Method = "PATCH" +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings", host) +request.Method = "POST" request.Body = []byte(` { - "default": true + "hostname": "myhostname.com", + "send_raw": false, + "spam_check": true, + "url": "http://email.myhosthame.com" }`) response, err := sendgrid.API(request) if err != nil { @@ -6412,18 +6391,16 @@ if err != nil { } ``` -## Retrieve a Link Whitelabel - -**This endpoint allows you to retrieve a specific link whitelabel.** +## Retrieve all parse settings -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to retrieve all of your current inbound parse settings.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### GET /whitelabel/links/{id} +### GET /user/webhooks/parse/settings ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}", host) +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings", host) request.Method = "GET" response, err := sendgrid.API(request) if err != nil { @@ -6435,19 +6412,22 @@ if err != nil { } ``` -## Delete a Link Whitelabel - -**This endpoint allows you to delete a link whitelabel.** +## Update a parse setting -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to update a specific inbound parse setting.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### DELETE /whitelabel/links/{id} +### PATCH /user/webhooks/parse/settings/{hostname} ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}", host) -request.Method = "DELETE" +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings/{hostname}", host) +request.Method = "PATCH" +request.Body = []byte(` { + "send_raw": true, + "spam_check": false, + "url": "http://newdomain.com/parse" +}`) response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6458,19 +6438,17 @@ if err != nil { } ``` -## Validate a Link Whitelabel - -**This endpoint allows you to validate a link whitelabel.** +## Retrieve a specific parse setting -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to retrieve a specific inbound parse setting.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). -### POST /whitelabel/links/{id}/validate +### GET /user/webhooks/parse/settings/{hostname} ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{id}/validate", host) -request.Method = "POST" +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings/{hostname}", host) +request.Method = "GET" response, err := sendgrid.API(request) if err != nil { log.Println(err) @@ -6481,26 +6459,47 @@ if err != nil { } ``` -## Associate a Link Whitelabel +## Delete a parse setting + +**This endpoint allows you to delete a specific inbound parse setting.** -**This endpoint allows you to associate a link whitelabel with a subuser account.** +The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html). + +### DELETE /user/webhooks/parse/settings/{hostname} + +```go +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/settings/{hostname}", host) +request.Method = "DELETE" +response, err := sendgrid.API(request) +if err != nil { + log.Println(err) +} else { + fmt.Println(response.StatusCode) + fmt.Println(response.Body) + fmt.Println(response.Headers) +} +``` -Link whitelables can be associated with subusers from the parent account. This functionality allows -subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account -must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface. +## Retrieves Inbound Parse Webhook statistics. -Email link whitelabels allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net. +**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments. -### POST /whitelabel/links/{link_id}/subuser +There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). + +### GET /user/webhooks/parse/stats ```go -request := sendgrid.GetRequest(apiKey, "/v3/whitelabel/links/{link_id}/subuser", host) -request.Method = "POST" -request.Body = []byte(` { - "username": "jane@example.com" -}`) +request := sendgrid.GetRequest(apiKey, "/v3/user/webhooks/parse/stats", host) +request.Method = "GET" +queryParams := make(map[string]string) +queryParams["aggregated_by"] = "day" +queryParams["limit"] = "test_string" +queryParams["start_date"] = "2016-01-01" +queryParams["end_date"] = "2016-04-01" +queryParams["offset"] = "test_string" +request.QueryParams = queryParams response, err := sendgrid.API(request) if err != nil { log.Println(err) From 8fb80f70c62824cd98c38744b455847e57860cfd Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Mon, 29 Oct 2018 15:16:59 -0400 Subject: [PATCH 3/6] Update "Whitelabel" to "Authentication" --- USE_CASES.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/USE_CASES.md b/USE_CASES.md index 31732150..b32f777a 100644 --- a/USE_CASES.md +++ b/USE_CASES.md @@ -10,7 +10,7 @@ This documentation provides examples for specific use cases. Please [open an iss * [Sections](#sections) * [Attachments](#attachments) * [How to View Email Statistics](#email-stats) -* [How to Setup a Domain Whitelabel](#whitelabel-domain) +* [How to Setup Domain Authentication](#domain-authentication) # Transactional Templates @@ -1541,12 +1541,12 @@ func main() { } ``` - -### How to Setup a Domain Whitelabel -You can find documentation for how to setup a domain whitelabel via the UI [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/setup_domain_whitelabel.html). -Find more information about all of SendGrid's whitelabeling related documentation [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/index.html). + +### How to Setup Domain Authentication +You can find documentation for how to setup domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). +Find more information about all of SendGrid's authentication related documentation [here](https://sendgrid.com/docs/ui/account-and-settings/). -To create a Domain Whitelabel Via the API: +To create a Domain Authentication Via the API: ``` package main From 8beccbcc9cfb8842dfb3207a99cb3b8b7deca28f Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Mon, 29 Oct 2018 15:21:07 -0400 Subject: [PATCH 4/6] Remove references to "Whitelabel" --- USE_CASES.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/USE_CASES.md b/USE_CASES.md index 31732150..e8368392 100644 --- a/USE_CASES.md +++ b/USE_CASES.md @@ -10,7 +10,7 @@ This documentation provides examples for specific use cases. Please [open an iss * [Sections](#sections) * [Attachments](#attachments) * [How to View Email Statistics](#email-stats) -* [How to Setup a Domain Whitelabel](#whitelabel-domain) +* [How to Setup Domain Authentication](#domain-authentication) # Transactional Templates @@ -1541,12 +1541,12 @@ func main() { } ``` - -### How to Setup a Domain Whitelabel -You can find documentation for how to setup a domain whitelabel via the UI [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/setup_domain_whitelabel.html). -Find more information about all of SendGrid's whitelabeling related documentation [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/index.html). + +### How to Setup Domain Authentication +You can find documentation for how to setup a domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). +Find more information about all of SendGrid's authentication related documentation [here](https://sendgrid.com/docs/ui/account-and-settings/). -To create a Domain Whitelabel Via the API: +To create a Domain Authentication Via the API: ``` package main From 90e09b3730ed6a71969f831873203ab302327ea9 Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Thu, 1 Nov 2018 11:28:42 -0400 Subject: [PATCH 5/6] Fix typos --- USAGE.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/USAGE.md b/USAGE.md index 362526cb..6e044d7a 100644 --- a/USAGE.md +++ b/USAGE.md @@ -3774,7 +3774,7 @@ A domain authentication allows you to remove the via or sent on behalf of messag Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ## URI Parameters | URI Parameter | Type | Description | @@ -3804,7 +3804,7 @@ A domain authentication allows you to remove the via or sent on behalf of messag Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ## URI Parameters | URI Parameter | Type | Required? | Description | @@ -3832,7 +3832,7 @@ if err != nil { A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ### PATCH /whitelabel/domains/{domain_id} @@ -3859,7 +3859,7 @@ if err != nil { A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ### GET /whitelabel/domains/{domain_id} @@ -3883,7 +3883,7 @@ if err != nil { A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ### DELETE /whitelabel/domains/{domain_id} @@ -3908,7 +3908,7 @@ A domain authentication allows you to remove the via or sent on behalf of messag Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ## URI Parameters | URI Parameter | Type | Description | @@ -3939,7 +3939,7 @@ if err != nil { A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ## URI Parameters | URI Parameter | Type | Description | @@ -3970,7 +3970,7 @@ if err != nil { A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ## URI Parameters | URI Parameter | Type | Description | @@ -3999,7 +3999,7 @@ if err != nil { A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. -For more information on domain authentication, please see our [User Guide]((https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) +For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) ## URI Parameters | URI Parameter | Type | Description | @@ -4021,7 +4021,7 @@ if err != nil { } ``` -## Create reverse DNS +## Create reverse DNS record **This endpoint allows you to create a reverse DNS record.** @@ -4398,7 +4398,7 @@ if err != nil { ## Associate a Link Branding -**This endpoint allows you to associate a link whitelabel with a subuser account.** +**This endpoint allows you to associate a link branding with a subuser account.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link brands. To associate a link branding, the parent account From 338760305dee4d469b379cd0b9e45911406186d6 Mon Sep 17 00:00:00 2001 From: chandler Date: Wed, 28 Nov 2018 14:19:21 -0500 Subject: [PATCH 6/6] Fix white label references in Use Cases folder --- use-cases/README.md | 2 +- ...omain-whitelabel.md => setup-domain-authentication.md} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename use-cases/{setup-domain-whitelabel.md => setup-domain-authentication.md} (64%) diff --git a/use-cases/README.md b/use-cases/README.md index 00c96294..0e5a7634 100644 --- a/use-cases/README.md +++ b/use-cases/README.md @@ -10,4 +10,4 @@ This documentation provides examples for specific use cases. Please [open an iss * [Sections](sections.md) * [Attachments](attachments.md) * [How to View Email Statistics](view-email-stats.md) -* [How to Setup a Domain Whitelabel](setup-domain-whitelabel.md) \ No newline at end of file +* [How to Setup a Domain Authentication](setup-domain-authentication.md) \ No newline at end of file diff --git a/use-cases/setup-domain-whitelabel.md b/use-cases/setup-domain-authentication.md similarity index 64% rename from use-cases/setup-domain-whitelabel.md rename to use-cases/setup-domain-authentication.md index e9463a85..25f3f8af 100644 --- a/use-cases/setup-domain-whitelabel.md +++ b/use-cases/setup-domain-authentication.md @@ -1,9 +1,9 @@ -## How to Setup a Domain Whitelabel +## How to Setup a Domain Authentication -You can find documentation for how to setup a domain whitelabel via the UI [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/setup_domain_whitelabel.html). -Find more information about all of SendGrid's whitelabeling related documentation [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/index.html). +You can find documentation for how to setup a domain authentication via the UI [here](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). +Find more information about all of SendGrid's authentication related documentation [here](https://sendgrid.com/docs/ui/account-and-settings/). -To create a Domain Whitelabel Via the API: +To create a Domain authentication Via the API: ``` package main