From ae2ff48ebb88d11c6e2a574fff6f1c0c1539d42c Mon Sep 17 00:00:00 2001 From: chandler Date: Thu, 1 Nov 2018 11:30:08 -0400 Subject: [PATCH 1/4] Remove references to 'whitelabel' Signed-off-by: chandler --- USAGE.md | 2090 +++++++++-------- USE_CASES.md | 10 +- .../senderauthentication.rb} | 54 +- 3 files changed, 1078 insertions(+), 1076 deletions(-) rename examples/{whitelabel/whitelabel.rb => senderauthentication/senderauthentication.rb} (88%) diff --git a/USAGE.md b/USAGE.md index 50494432..b396e678 100644 --- a/USAGE.md +++ b/USAGE.md @@ -29,13 +29,13 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) * [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) @@ -1782,7 +1782,7 @@ puts response.headers **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 authentica 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. @@ -2725,7 +2725,7 @@ puts response.headers *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 @@ -2757,7 +2757,7 @@ puts response.headers **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 @@ -2772,7 +2772,7 @@ puts response.headers **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. @@ -2807,7 +2807,7 @@ puts response.headers **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} @@ -2823,7 +2823,7 @@ puts response.headers **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} @@ -2839,7 +2839,7 @@ puts response.headers **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 @@ -2851,2184 +2851,2186 @@ puts response.status_code puts response.body puts response.headers ``` - -# 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 + +# SENDER AUTHENTICATION -```ruby -params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}') -response = sg.client.stats.get(query_params: params) -puts response.status_code -puts response.body -puts response.headers -``` - -# 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 ```ruby data = JSON.parse('{ - "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 = sg.client.subusers.post(request_body: data) +response = sg.client.whitelabel.domains.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## List all Subusers - -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. - -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) - -### GET /subusers +## List all domain authentications. +**This endpoint allows you to retrieve a list of all domain authentications you have created.** -```ruby -params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}') -response = sg.client.subusers.get(query_params: params) -puts response.status_code -puts response.body -puts response.headers -``` -## Retrieve Subuser Reputations +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. -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. +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/) -This endpoint allows you to request the reputations for your subusers. -### GET /subusers/reputations +### GET /whitelabel/domains ```ruby -params = JSON.parse('{"usernames": "test_string"}') -response = sg.client.subusers.reputations.get(query_params: params) +params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}') +response = sg.client.whitelabel.domains.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Retrieve email statistics for your subusers. +## Get the default domain authentication. -**This endpoint allows you to retrieve the email statistics for the given subusers.** +**This endpoint allows you to retrieve the default authentication for a domain.** -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. +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, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| domain | string |The domain to find a default domain whitelabel for. | -### GET /subusers/stats +### GET /whitelabel/domains/default ```ruby -params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}') -response = sg.client.subusers.stats.get(query_params: params) +response = sg.client.whitelabel.domains.default.get() puts response.status_code puts response.body puts response.headers ``` -## Retrieve monthly stats for all subusers +## List the domain authentication associated with the 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 retrieve all of the domain authentications that have been assigned to a specific 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 | Description | +|---|---|---| +| username | string | Username of the subuser to find associated whitelabels for. | + +### GET /whitelabel/domains/subuser ```ruby -params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}') -response = sg.client.subusers.stats.monthly.get(query_params: params) +response = sg.client.whitelabel.domains.subuser.get() puts response.status_code puts response.body puts response.headers ``` -## Retrieve the totals for each email statistic metric for all subusers. +## Disassociate a domain authentication from a given user. -**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** +**This endpoint allows you to disassociate a specific domain authentication from a 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/sums +## URI Parameters +| URI Parameter | Type | Required? | Description | +|---|---|---|---| +| username | string | required | Username for the subuser to find associated whitelabels for. | + +### DELETE /whitelabel/domains/subuser ```ruby -params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}') -response = sg.client.subusers.stats.sums.get(query_params: params) +response = sg.client.whitelabel.domains.subuser.delete() puts response.status_code puts response.body puts response.headers ``` -## Enable/disable a subuser +## Update a domain authentication. -This endpoint allows you to enable or disable a subuser. +**This endpoint allows you to update the settings for 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/) -### PATCH /subusers/{subuser_name} +### PATCH /whitelabel/domains/{domain_id} ```ruby data = JSON.parse('{ - "disabled": false + "custom_spf": true, + "default": false }') -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).patch(request_body: data) +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Delete a subuser +## Retrieve 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 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/) -### DELETE /subusers/{subuser_name} + +### GET /whitelabel/domains/{domain_id} ```ruby -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).delete() +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).get() puts response.status_code puts response.body puts response.headers ``` -## Update IPs assigned to a subuser +## Delete a domain authentication. -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 delete a domain authentication.** -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) +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/) -### PUT /subusers/{subuser_name}/ips +### DELETE /whitelabel/domains/{domain_id} ```ruby -data = JSON.parse('[ - "127.0.0.1" -]') -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).ips.put(request_body: data) +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).delete() puts response.status_code puts response.body puts response.headers ``` -## Update Monitor Settings for a subuser +## Associate a domain authentication with a given user. -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 associate a specific domain authentication with a subuser.** -### 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. + +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/) + +## 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 ```ruby data = JSON.parse('{ - "email": "example@example.com", - "frequency": 500 + "username": "jane@example.com" }') -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.put(request_body: data) +domain_id = "test_url_param" +response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Create monitor settings +## 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.** -### 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 to which you are adding an IP | + +### POST /whitelabel/domains/{id}/ips ```ruby data = JSON.parse('{ - "email": "example@example.com", - "frequency": 50000 + "ip": "192.168.0.1" }') -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.post(request_body: data) +id = "test_url_param" +response = sg.client.whitelabel.domains._(id).ips.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve monitor settings for a subuser +## 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.** -### 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 delete the IP from. | +| ip | string | IP to remove from the domain whitelabel. | + +### DELETE /whitelabel/domains/{id}/ips/{ip} ```ruby -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.get() +id = "test_url_param" +ip = "test_url_param" +response = sg.client.whitelabel.domains._(id).ips._(ip).delete() puts response.status_code puts response.body puts response.headers ``` -## Delete monitor settings +## 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.** -### DELETE /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 ```ruby -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).monitor.delete() +id = "test_url_param" +response = sg.client.whitelabel.domains._(id).validate.post() puts response.status_code puts response.body puts response.headers ``` -## Retrieve the monthly email statistics for a single subuser +## Create reverse DNS record -**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.** +**This endpoint allows you to create a reverse DNS 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 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. +When creating a reverse DNS record, you should use the same subdomain that you used when you created a domain authentication. -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 +### POST /whitelabel/ips ```ruby -params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}') -subuser_name = "test_url_param" -response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params) +data = JSON.parse('{ + "domain": "example.com", + "ip": "192.168.1.1", + "subdomain": "email" +}') +response = sg.client.whitelabel.ips.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` - -# SUPPRESSION +## Retrieve all reverse DNS records -## Retrieve all blocks +**This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.** -**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.** +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."). -[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 ```ruby -params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') -response = sg.client.suppression.blocks.get(query_params: params) +params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}') +response = sg.client.whitelabel.ips.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Delete blocks +## Retrieve an reverse DNS record -**This endpoint allows you to delete all email addresses on your blocks list.** +**This endpoint allows you to retrieve a reverse DNS record.** -There are two options for deleting blocked emails: +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. -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. +For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/). -[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, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). - -### DELETE /suppression/blocks +### GET /whitelabel/ips/{id} ```ruby -data = JSON.parse('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] -}') -response = sg.client.suppression.blocks.delete(request_body: data) +id = "test_url_param" +response = sg.client.whitelabel.ips._(id).get() puts response.status_code puts response.body puts response.headers ``` -## Retrieve a specific block +## Delete an reverse DNS record -**This endpoint allows you to retrieve a specific email address from your blocks list.** +**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/). -### GET /suppression/blocks/{email} +### DELETE /whitelabel/ips/{id} ```ruby -email = "test_url_param" -response = sg.client.suppression.blocks._(email).get() +id = "test_url_param" +response = sg.client.whitelabel.ips._(id).delete() puts response.status_code puts response.body puts response.headers ``` -## Delete a specific block +## Validate a reverse DNS -**This endpoint allows you to delete 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/). -### DELETE /suppression/blocks/{email} +### POST /whitelabel/ips/{id}/validate ```ruby -email = "test_url_param" -response = sg.client.suppression.blocks._(email).delete() +id = "test_url_param" +response = sg.client.whitelabel.ips._(id).validate.post() puts response.status_code puts response.body puts response.headers ``` -## Retrieve all bounces - -**This endpoint allows you to retrieve all of your bounces.** +## Create a Branded Link -Bounces are messages that are returned to the server that sent it. +**This endpoint allows you to create a new link branding.** -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 +### POST /whitelabel/links ```ruby -params = JSON.parse('{"start_time": 1, "end_time": 1}') -response = sg.client.suppression.bounces.get(query_params: params) +data = JSON.parse('{ + "default": true, + "domain": "example.com", + "subdomain": "mail" +}') +params = JSON.parse('{"limit": 1, "offset": 1}') +response = sg.client.whitelabel.links.post(request_body: data, query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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.** - -Bounces are messages that are returned to the server that sent it. +## Retrieve all link brandings -For more information see: +**This endpoint allows you to retrieve all link brandings.** -* [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 ```ruby -data = JSON.parse('{ - "delete_all": true, - "emails": [ - "example@example.com", - "example2@example.com" - ] -}') -response = sg.client.suppression.bounces.delete(request_body: data) +params = JSON.parse('{"limit": 1}') +response = sg.client.whitelabel.links.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Retrieve a Bounce +## Retrieve a Default Link Branding -**This endpoint allows you to retrieve a specific bounce for a given email address.** +**This endpoint allows you to retrieve the default link branding.** -Bounces are messages that are returned to the server that sent it. +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: + -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/default ```ruby -email = "test_url_param" -response = sg.client.suppression.bounces._(email).get() +params = JSON.parse('{"domain": "test_string"}') +response = sg.client.whitelabel.links.default.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Delete a bounce +## Retrieve Associated Link Branding -**This endpoint allows you to remove an email address from your bounce list.** +**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. 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} +### GET /whitelabel/links/subuser ```ruby -params = JSON.parse('{"email_address": "example@example.com"}') -email = "test_url_param" -response = sg.client.suppression.bounces._(email).delete(query_params: params) +params = JSON.parse('{"username": "test_string"}') +response = sg.client.whitelabel.links.subuser.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Retrieve all invalid emails +## Disassociate a Link Branding -**This endpoint allows you to retrieve a list of all invalid email addresses.** +**This endpoint allows you to disassociate a link branding from a subuser.** -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. +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. -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 +### DELETE /whitelabel/links/subuser ```ruby -params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') -response = sg.client.suppression.invalid_emails.get(query_params: params) +params = JSON.parse('{"username": "test_string"}') +response = sg.client.whitelabel.links.subuser.delete(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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: +## Update a Link Branding -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. - -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/). -### DELETE /suppression/invalid_emails +### PATCH /whitelabel/links/{id} ```ruby data = JSON.parse('{ - "delete_all": false, - "emails": [ - "example1@example.com", - "example2@example.com" - ] + "default": true }') -response = sg.client.suppression.invalid_emails.delete(request_body: data) +id = "test_url_param" +response = sg.client.whitelabel.links._(id).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve a specific invalid email - -**This endpoint allows you to retrieve a specific invalid email addresses.** +## 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/). -### GET /suppression/invalid_emails/{email} +### GET /whitelabel/links/{id} ```ruby -email = "test_url_param" -response = sg.client.suppression.invalid_emails._(email).get() +id = "test_url_param" +response = sg.client.whitelabel.links._(id).get() puts response.status_code puts response.body puts response.headers ``` -## Delete a specific invalid email - -**This endpoint allows you to remove a specific email address from the invalid email address list.** +## 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/). -### DELETE /suppression/invalid_emails/{email} +### DELETE /whitelabel/links/{id} ```ruby -email = "test_url_param" -response = sg.client.suppression.invalid_emails._(email).delete() +id = "test_url_param" +response = sg.client.whitelabel.links._(id).delete() puts response.status_code puts response.body puts response.headers ``` -## Retrieve a specific spam report +## Validate a Link Branding -**This endpoint allows you to retrieve a specific spam report.** +**This endpoint allows you to validate a link branding.** -[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. +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/spam_reports.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/spam_report/{email} +### POST /whitelabel/links/{id}/validate ```ruby -email = "test_url_param" -response = sg.client.suppression.spam_report._(email).get() +id = "test_url_param" +response = sg.client.whitelabel.links._(id).validate.post() puts response.status_code puts response.body puts response.headers ``` -## Delete a specific spam report +## Associate a Link Branding -**This endpoint allows you to delete a specific spam report.** +**This endpoint allows you to associate a link branding 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. -### DELETE /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 ```ruby -email = "test_url_param" -response = sg.client.suppression.spam_report._(email).delete() +data = JSON.parse('{ + "username": "jane@example.com" +}') +link_id = "test_url_param" +response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve all spam reports -**This endpoint allows you to retrieve all spam reports.** + +# STATS -[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. +## Retrieve global email statistics -For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html). +**This endpoint allows you to retrieve all of your global email statistics between a given date range.** -### GET /suppression/spam_reports +Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. + +### GET /stats ```ruby -params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') -response = sg.client.suppression.spam_reports.get(query_params: params) +params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}') +response = sg.client.stats.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby data = JSON.parse('{ - "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 = sg.client.suppression.spam_reports.delete(request_body: data) +response = sg.client.subusers.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') -response = sg.client.suppression.unsubscribes.get(query_params: params) +params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}') +response = sg.client.subusers.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` - -# TEMPLATES +## Retrieve Subuser Reputations -## Create a transactional template. +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 create a transactional template.** +This endpoint allows you to request the reputations for your 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. - -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 +### GET /subusers/reputations ```ruby -data = JSON.parse('{ - "name": "example_name" -}') -response = sg.client.templates.post(request_body: data) +params = JSON.parse('{"usernames": "test_string"}') +response = sg.client.subusers.reputations.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -response = sg.client.templates.get() +params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}') +response = sg.client.subusers.stats.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -data = JSON.parse('{ - "name": "new_example_name" -}') -template_id = "test_url_param" -response = sg.client.templates._(template_id).patch(request_body: data) +params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}') +response = sg.client.subusers.stats.monthly.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -template_id = "test_url_param" -response = sg.client.templates._(template_id).get() +params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}') +response = sg.client.subusers.stats.sums.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## 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} ```ruby -template_id = "test_url_param" -response = sg.client.templates._(template_id).delete() +data = JSON.parse('{ + "disabled": false +}') +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Create a new transactional template version. +## Delete a subuser -**This endpoint allows you to create a new version of a template.** +This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved. -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 Subusers: -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.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 /subusers/{subuser_name} -### POST /templates/{template_id}/versions + +```ruby +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).delete() +puts response.status_code +puts response.body +puts response.headers +``` +## Update IPs assigned to a subuser + +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. + +More information: + +* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html) +* [How to setup reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) + +### PUT /subusers/{subuser_name}/ips ```ruby -data = JSON.parse('{ - "active": 1, - "html_content": "<%body%>", - "name": "example_version_name", - "plain_content": "<%body%>", - "subject": "<%subject%>", - "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" -}') -template_id = "test_url_param" -response = sg.client.templates._(template_id).versions.post(request_body: data) +data = JSON.parse('[ + "127.0.0.1" +]') +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).ips.put(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Edit a transactional template version. +## Update Monitor Settings for a subuser -**This endpoint allows you to edit a version of one of your transactional templates.** +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -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. +### PUT /subusers/{subuser_name}/monitor -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 | +```ruby +data = JSON.parse('{ + "email": "example@example.com", + "frequency": 500 +}') +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.put(request_body: data) +puts response.status_code +puts response.body +puts response.headers +``` +## Create monitor settings -### PATCH /templates/{template_id}/versions/{version_id} +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. + +### POST /subusers/{subuser_name}/monitor ```ruby data = JSON.parse('{ - "active": 1, - "html_content": "<%body%>", - "name": "updated_example_name", - "plain_content": "<%body%>", - "subject": "<%subject%>" + "email": "example@example.com", + "frequency": 50000 }') -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data) +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve a specific transactional template version. +## Retrieve monitor settings for a subuser -**This endpoint allows you to retrieve a specific version of a template.** +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. -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. +### GET /subusers/{subuser_name}/monitor -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 | +```ruby +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.get() +puts response.status_code +puts response.body +puts response.headers +``` +## Delete monitor settings -### GET /templates/{template_id}/versions/{version_id} +Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails. + +### DELETE /subusers/{subuser_name}/monitor ```ruby -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).get() +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).monitor.delete() puts response.status_code puts response.body puts response.headers ``` -## Delete a transactional template version. +## Retrieve the monthly email statistics for a single subuser -**This endpoint allows you to delete one of your transactional template versions.** +**This endpoint allows you to retrieve the monthly email statistics for a specific 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. +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 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`. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html). -### DELETE /templates/{template_id}/versions/{version_id} +### GET /subusers/{subuser_name}/stats/monthly ```ruby -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).delete() +params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}') +subuser_name = "test_url_param" +response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Activate a transactional template version. - -**This endpoint allows you to activate a version of one of your templates.** + +# SUPPRESSION -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. +## Retrieve all blocks +**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.** -For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.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. -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| template_id | string | The ID of the original template | -| version_id | string | The ID of the template version | +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). -### POST /templates/{template_id}/versions/{version_id}/activate +### GET /suppression/blocks ```ruby -template_id = "test_url_param" -version_id = "test_url_param" -response = sg.client.templates._(template_id).versions._(version_id).activate.post() +params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') +response = sg.client.suppression.blocks.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` - -# TRACKING SETTINGS +## Delete blocks -## Retrieve Tracking Settings +**This endpoint allows you to delete all email addresses on your blocks list.** -**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.** +There are two options for deleting blocked emails: -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. +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. -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 +For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). + +### DELETE /suppression/blocks ```ruby -params = JSON.parse('{"limit": 1, "offset": 1}') -response = sg.client.tracking_settings.get(query_params: params) +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') +response = sg.client.suppression.blocks.delete(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Update Click Tracking Settings +## Retrieve a specific block -**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 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/click +### GET /suppression/blocks/{email} ```ruby -data = JSON.parse('{ - "enabled": true -}') -response = sg.client.tracking_settings.click.patch(request_body: data) +email = "test_url_param" +response = sg.client.suppression.blocks._(email).get() puts response.status_code puts response.body puts response.headers ``` -## Retrieve Click Track Settings +## Delete a specific block -**This endpoint allows you to retrieve your current click tracking setting.** +**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). -### GET /tracking_settings/click +### DELETE /suppression/blocks/{email} ```ruby -response = sg.client.tracking_settings.click.get() +email = "test_url_param" +response = sg.client.suppression.blocks._(email).delete() puts response.status_code puts response.body puts response.headers ``` -## Update Google Analytics Settings - -**This endpoint allows you to update your current setting for Google Analytics.** +## Retrieve all bounces -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). +**This endpoint allows you to retrieve all of your bounces.** -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). +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) -### PATCH /tracking_settings/google_analytics +### GET /suppression/bounces ```ruby -data = JSON.parse('{ - "enabled": true, - "utm_campaign": "website", - "utm_content": "", - "utm_medium": "email", - "utm_source": "sendgrid.com", - "utm_term": "" -}') -response = sg.client.tracking_settings.google_analytics.patch(request_body: data) +params = JSON.parse('{"start_time": 1, "end_time": 1}') +response = sg.client.suppression.bounces.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Retrieve Google Analytics Settings +## Delete bounces -**This endpoint allows you to retrieve your current setting for Google Analytics.** +**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.** -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). +Bounces are messages that are returned to the server that sent it. -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). +For more information see: -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. +* [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 about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). +Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes. -### GET /tracking_settings/google_analytics +### DELETE /suppression/bounces ```ruby -response = sg.client.tracking_settings.google_analytics.get() +data = JSON.parse('{ + "delete_all": true, + "emails": [ + "example@example.com", + "example2@example.com" + ] +}') +response = sg.client.suppression.bounces.delete(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Update Open Tracking Settings +## Retrieve a Bounce -**This endpoint allows you to update your current settings for open tracking.** +**This endpoint allows you to retrieve a specific bounce for a given email address.** -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) +* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html) -### PATCH /tracking_settings/open +### GET /suppression/bounces/{email} ```ruby -data = JSON.parse('{ - "enabled": true -}') -response = sg.client.tracking_settings.open.patch(request_body: data) +email = "test_url_param" +response = sg.client.suppression.bounces._(email).get() puts response.status_code puts response.body puts response.headers ``` -## Get Open Tracking Settings +## Delete a bounce -**This endpoint allows you to retrieve your current settings for open tracking.** +**This endpoint allows you to remove an email address from your bounce list.** -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. This endpoint allows you to delete a single email addresses from your bounce 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. +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/open +### DELETE /suppression/bounces/{email} ```ruby -response = sg.client.tracking_settings.open.get() +params = JSON.parse('{"email_address": "example@example.com"}') +email = "test_url_param" +response = sg.client.suppression.bounces._(email).delete(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Update Subscription Tracking Settings +## Retrieve all invalid emails -**This endpoint allows you to update your current settings for subscription tracking.** +**This endpoint allows you to retrieve a list of all invalid email addresses.** -Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +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. -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. +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 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/invalid_emails.html). -### PATCH /tracking_settings/subscription +### GET /suppression/invalid_emails ```ruby -data = JSON.parse('{ - "enabled": true, - "html_content": "html content", - "landing": "landing page html", - "plain_content": "text content", - "replace": "replacement tag", - "url": "url" -}') -response = sg.client.tracking_settings.subscription.patch(request_body: data) +params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') +response = sg.client.suppression.invalid_emails.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Retrieve Subscription Tracking Settings +## Delete invalid emails -**This endpoint allows you to retrieve your current settings for subscription tracking.** +**This endpoint allows you to remove email addresses from your invalid email address list.** -Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +There are two options for deleting invalid email addresses: -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. +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. -For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.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 /tracking_settings/subscription +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 ```ruby -response = sg.client.tracking_settings.subscription.get() +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] +}') +response = sg.client.suppression.invalid_emails.delete(request_body: data) puts response.status_code puts response.body puts response.headers ``` - -# USER - -## Get a user's account information. - -**This endpoint allows you to retrieve your user account details.** +## Retrieve a specific invalid email -Your user's account information includes the user's account type and reputation. +**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/account +### GET /suppression/invalid_emails/{email} ```ruby -response = sg.client.user.account.get() +email = "test_url_param" +response = sg.client.suppression.invalid_emails._(email).get() puts response.status_code puts response.body puts response.headers ``` -## Retrieve your credit balance +## Delete a specific invalid email -**This endpoint allows you to retrieve the current credit balance for your account.** +**This endpoint allows you to remove a specific email address from the invalid email address list.** -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). + +### DELETE /suppression/invalid_emails/{email} ```ruby -response = sg.client.user.credits.get() +email = "test_url_param" +response = sg.client.suppression.invalid_emails._(email).delete() puts response.status_code puts response.body puts response.headers ``` -## Update your account email address - -**This endpoint allows you to update the email address currently on file for your account.** +## Retrieve 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 retrieve 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). -### PUT /user/email +### GET /suppression/spam_report/{email} ```ruby -data = JSON.parse('{ - "email": "example@example.com" -}') -response = sg.client.user.email.put(request_body: data) +email = "test_url_param" +response = sg.client.suppression.spam_report._(email).get() puts response.status_code puts response.body puts response.headers ``` -## Retrieve your account email address - -**This endpoint allows you to retrieve the email address currently on file for your account.** +## 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/email +### DELETE /suppression/spam_report/{email} ```ruby -response = sg.client.user.email.get() +email = "test_url_param" +response = sg.client.suppression.spam_report._(email).delete() puts response.status_code puts response.body puts response.headers ``` -## Update your password - -**This endpoint allows you to update your password.** +## Retrieve all spam reports -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 retrieve all spam reports.** -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). -### PUT /user/password +### GET /suppression/spam_reports ```ruby -data = JSON.parse('{ - "new_password": "new_password", - "old_password": "old_password" -}') -response = sg.client.user.password.put(request_body: data) +params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') +response = sg.client.suppression.spam_reports.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Update a user's profile +## Delete spam reports -**This endpoint allows you to update your current profile details.** +**This endpoint allows you to delete your spam reports.** -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 spam reports: -For more information about your user profile: +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. -* [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 +### DELETE /suppression/spam_reports ```ruby -data = JSON.parse('{ - "city": "Orange", - "first_name": "Example", - "last_name": "User" +data = JSON.parse('{ + "delete_all": false, + "emails": [ + "example1@example.com", + "example2@example.com" + ] }') -response = sg.client.user.profile.patch(request_body: data) +response = sg.client.suppression.spam_reports.delete(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Get a user's profile - -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 all global suppressions -For more information about your user profile: +**This endpoint allows you to retrieve a list of all email address that are globally suppressed.** -* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) +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). -### GET /user/profile +### GET /suppression/unsubscribes ```ruby -response = sg.client.user.profile.get() +params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}') +response = sg.client.suppression.unsubscribes.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Cancel or pause a scheduled send + +# TEMPLATES -**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.** +## Create a transactional template. -If the maximum number of cancellations/pauses are added, HTTP 400 will -be returned. +**This endpoint allows you to 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. +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. -### POST /user/scheduled_sends +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 ```ruby data = JSON.parse('{ - "batch_id": "YOUR_BATCH_ID", - "status": "pause" + "name": "example_name" }') -response = sg.client.user.scheduled_sends.post(request_body: data) +response = sg.client.templates.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve all scheduled sends +## Retrieve all transactional templates. -**This endpoint allows you to retrieve all cancel/paused scheduled send information.** +**This endpoint allows you to retrieve all transactional templates.** -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. +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. -### GET /user/scheduled_sends +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 /templates ```ruby -response = sg.client.user.scheduled_sends.get() +response = sg.client.templates.get() puts response.status_code puts response.body puts response.headers ``` -## Update user scheduled send information +## Edit a transactional template. -**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** +**This endpoint allows you to edit 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. +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. -### PATCH /user/scheduled_sends/{batch_id} +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 /templates/{template_id} ```ruby data = JSON.parse('{ - "status": "pause" + "name": "new_example_name" }') -batch_id = "test_url_param" -response = sg.client.user.scheduled_sends._(batch_id).patch(request_body: data) +template_id = "test_url_param" +response = sg.client.templates._(template_id).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve scheduled send - -**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** - -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/{batch_id} +## Retrieve a single transactional template. +**This endpoint allows you to retrieve a single transactional template.** -```ruby -batch_id = "test_url_param" -response = sg.client.user.scheduled_sends._(batch_id).get() -puts response.status_code -puts response.body -puts response.headers -``` -## Delete a cancellation or 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. -**This endpoint allows you to delete the cancellation/pause of a scheduled send.** +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). -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 /user/scheduled_sends/{batch_id} +### GET /templates/{template_id} ```ruby -batch_id = "test_url_param" -response = sg.client.user.scheduled_sends._(batch_id).delete() +template_id = "test_url_param" +response = sg.client.templates._(template_id).get() puts response.status_code puts response.body puts response.headers ``` -## Update Enforced TLS settings +## Delete a template. -**This endpoint allows you to update your current Enforced TLS settings.** +**This endpoint allows you to delete 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 + +### DELETE /templates/{template_id} ```ruby -data = JSON.parse('{ - "require_tls": true, - "require_valid_cert": false -}') -response = sg.client.user.settings.enforced_tls.patch(request_body: data) +template_id = "test_url_param" +response = sg.client.templates._(template_id).delete() puts response.status_code puts response.body puts response.headers ``` -## Retrieve current Enforced TLS settings. +## Create a new transactional template version. -**This endpoint allows you to retrieve your current Enforced TLS settings.** +**This endpoint allows you to create a new version of a 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 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. -**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. +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 + +### POST /templates/{template_id}/versions ```ruby -response = sg.client.user.settings.enforced_tls.get() +data = JSON.parse('{ + "active": 1, + "html_content": "<%body%>", + "name": "example_version_name", + "plain_content": "<%body%>", + "subject": "<%subject%>", + "template_id": "ddb96bbc-9b92-425e-8979-99464621b543" +}') +template_id = "test_url_param" +response = sg.client.templates._(template_id).versions.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Update your username +## Edit a transactional template version. -**This endpoint allows you to update the username for your account.** +**This endpoint allows you to edit a version of one of your transactional templates.** -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) +## URI Parameters +| URI Parameter | Type | Description | +|---|---|---| +| template_id | string | The ID of the original template | +| version_id | string | The ID of the template version | -### PUT /user/username +### PATCH /templates/{template_id}/versions/{version_id} ```ruby data = JSON.parse('{ - "username": "test_username" + "active": 1, + "html_content": "<%body%>", + "name": "updated_example_name", + "plain_content": "<%body%>", + "subject": "<%subject%>" }') -response = sg.client.user.username.put(request_body: data) +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve your username +## Retrieve a specific transactional template version. -**This endpoint allows you to retrieve your current account username.** +**This endpoint allows you to retrieve a specific 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) +## 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/username +### GET /templates/{template_id}/versions/{version_id} ```ruby -response = sg.client.user.username.get() +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).get() puts response.status_code puts response.body puts response.headers ``` -## Update Event Notification Settings +## Delete a transactional template version. -**This endpoint allows you to update your current event webhook settings.** +**This endpoint allows you to delete one of your transactional template versions.** -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 +### DELETE /templates/{template_id}/versions/{version_id} ```ruby -data = JSON.parse('{ - "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 = sg.client.user.webhooks.event.settings.patch(request_body: data) +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).delete() puts response.status_code puts response.body puts response.headers ``` -## Retrieve Event Webhook settings +## Activate a transactional template version. -**This endpoint allows you to retrieve your current event webhook settings.** +**This endpoint allows you to activate a version of one of your 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. -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). -### GET /user/webhooks/event/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 | + +### POST /templates/{template_id}/versions/{version_id}/activate ```ruby -response = sg.client.user.webhooks.event.settings.get() +template_id = "test_url_param" +version_id = "test_url_param" +response = sg.client.templates._(template_id).versions._(version_id).activate.post() puts response.status_code puts response.body puts response.headers ``` -## Test Event Notification Settings - -**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.** + +# TRACKING SETTINGS -SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. +## Retrieve Tracking Settings -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. +**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.** -### POST /user/webhooks/event/test +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). -```ruby -data = JSON.parse('{ - "url": "url" -}') -response = sg.client.user.webhooks.event.test.post(request_body: data) +### GET /tracking_settings + + +```ruby +params = JSON.parse('{"limit": 1, "offset": 1}') +response = sg.client.tracking_settings.get(query_params: params) puts response.status_code puts response.body puts response.headers ``` -## Create a parse setting +## Update Click Tracking Settings -**This endpoint allows you to create a new 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. -### POST /user/webhooks/parse/settings +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### PATCH /tracking_settings/click ```ruby data = JSON.parse('{ - "hostname": "myhostname.com", - "send_raw": false, - "spam_check": true, - "url": "http://email.myhosthame.com" + "enabled": true }') -response = sg.client.user.webhooks.parse.settings.post(request_body: data) +response = sg.client.tracking_settings.click.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve all parse settings +## Retrieve Click Track Settings -**This endpoint allows you to retrieve all of your current inbound parse settings.** +**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 +For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). + +### GET /tracking_settings/click ```ruby -response = sg.client.user.webhooks.parse.settings.get() +response = sg.client.tracking_settings.click.get() puts response.status_code puts response.body puts response.headers ``` -## Update a parse setting +## Update Google Analytics Settings -**This endpoint allows you to update a specific inbound parse setting.** +**This endpoint allows you to update 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). -### PATCH /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). + +### PATCH /tracking_settings/google_analytics ```ruby data = JSON.parse('{ - "send_raw": true, - "spam_check": false, - "url": "http://newdomain.com/parse" + "enabled": true, + "utm_campaign": "website", + "utm_content": "", + "utm_medium": "email", + "utm_source": "sendgrid.com", + "utm_term": "" }') -hostname = "test_url_param" -response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data) +response = sg.client.tracking_settings.google_analytics.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Retrieve a specific parse setting - -**This endpoint allows you to retrieve a specific inbound parse 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). +## Retrieve Google Analytics Settings -### GET /user/webhooks/parse/settings/{hostname} +**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). -```ruby -hostname = "test_url_param" -response = sg.client.user.webhooks.parse.settings._(hostname).get() -puts response.status_code -puts response.body -puts response.headers -``` -## Delete a parse setting +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 delete a specific inbound parse setting.** +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. -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 tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html). -### DELETE /user/webhooks/parse/settings/{hostname} +### GET /tracking_settings/google_analytics ```ruby -hostname = "test_url_param" -response = sg.client.user.webhooks.parse.settings._(hostname).delete() +response = sg.client.tracking_settings.google_analytics.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}') -response = sg.client.user.webhooks.parse.stats.get(query_params: params) +data = JSON.parse('{ + "enabled": true +}') +response = sg.client.tracking_settings.open.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` - -# 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 ```ruby -data = JSON.parse('{ - "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" -}') -response = sg.client.whitelabel.domains.post(request_body: data) +response = sg.client.tracking_settings.open.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}') -response = sg.client.whitelabel.domains.get(query_params: params) +data = JSON.parse('{ + "enabled": true, + "html_content": "html content", + "landing": "landing page html", + "plain_content": "text content", + "replace": "replacement tag", + "url": "url" +}') +response = sg.client.tracking_settings.subscription.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -response = sg.client.whitelabel.domains.default.get() +response = sg.client.tracking_settings.subscription.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -response = sg.client.whitelabel.domains.subuser.get() +response = sg.client.user.account.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -response = sg.client.whitelabel.domains.subuser.delete() +response = sg.client.user.credits.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby data = JSON.parse('{ - "custom_spf": true, - "default": false + "email": "example@example.com" }') -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data) +response = sg.client.user.email.put(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).get() +response = sg.client.user.email.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).delete() +data = JSON.parse('{ + "new_password": "new_password", + "old_password": "old_password" +}') +response = sg.client.user.password.put(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby data = JSON.parse('{ - "username": "jane@example.com" + "city": "Orange", + "first_name": "Example", + "last_name": "User" }') -domain_id = "test_url_param" -response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data) +response = sg.client.user.profile.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## Add an IP to a domain whitelabel. - -**This endpoint allows you to add an IP address to a domain whitelabel.** - -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. +## Get a user's profile -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 | -|---|---|---| -| id | integer | ID of the domain to which you are adding an IP | +For more information about your user profile: -### POST /whitelabel/domains/{id}/ips +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### GET /user/profile ```ruby -data = JSON.parse('{ - "ip": "192.168.0.1" -}') -id = "test_url_param" -response = sg.client.whitelabel.domains._(id).ips.post(request_body: data) +response = sg.client.user.profile.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -id = "test_url_param" -ip = "test_url_param" -response = sg.client.whitelabel.domains._(id).ips._(ip).delete() +data = JSON.parse('{ + "batch_id": "YOUR_BATCH_ID", + "status": "pause" +}') +response = sg.client.user.scheduled_sends.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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. +## Retrieve all scheduled sends -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 all cancel/paused scheduled send information.** -## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer |ID of the domain whitelabel to 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. -### POST /whitelabel/domains/{id}/validate +### GET /user/scheduled_sends ```ruby -id = "test_url_param" -response = sg.client.whitelabel.domains._(id).validate.post() +response = sg.client.user.scheduled_sends.get() puts response.status_code puts response.body puts response.headers ``` -## 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} ```ruby data = JSON.parse('{ - "domain": "example.com", - "ip": "192.168.1.1", - "subdomain": "email" + "status": "pause" }') -response = sg.client.whitelabel.ips.post(request_body: data) +batch_id = "test_url_param" +response = sg.client.user.scheduled_sends._(batch_id).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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} ```ruby -params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}') -response = sg.client.whitelabel.ips.get(query_params: params) +batch_id = "test_url_param" +response = sg.client.user.scheduled_sends._(batch_id).get() puts response.status_code puts response.body puts response.headers ``` -## 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} ```ruby -id = "test_url_param" -response = sg.client.whitelabel.ips._(id).get() +batch_id = "test_url_param" +response = sg.client.user.scheduled_sends._(batch_id).delete() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -id = "test_url_param" -response = sg.client.whitelabel.ips._(id).delete() +data = JSON.parse('{ + "require_tls": true, + "require_valid_cert": false +}') +response = sg.client.user.settings.enforced_tls.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -id = "test_url_param" -response = sg.client.whitelabel.ips._(id).validate.post() +response = sg.client.user.settings.enforced_tls.get() puts response.status_code puts response.body puts response.headers ``` -## Create a Link Whitelabel +## Update your username -**This endpoint allows you to create a new link whitelabel.** +**This endpoint allows you to update the username for your account.** -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. +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, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). +For more information about your user profile: -### POST /whitelabel/links +* [SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html) + +### PUT /user/username ```ruby data = JSON.parse('{ - "default": true, - "domain": "example.com", - "subdomain": "mail" + "username": "test_username" }') -params = JSON.parse('{"limit": 1, "offset": 1}') -response = sg.client.whitelabel.links.post(request_body: data, query_params: params) +response = sg.client.user.username.put(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"limit": 1}') -response = sg.client.whitelabel.links.get(query_params: params) +response = sg.client.user.username.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"domain": "test_string"}') -response = sg.client.whitelabel.links.default.get(query_params: params) +data = JSON.parse('{ + "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 = sg.client.user.webhooks.event.settings.patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"username": "test_string"}') -response = sg.client.whitelabel.links.subuser.get(query_params: params) +response = sg.client.user.webhooks.event.settings.get() puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -params = JSON.parse('{"username": "test_string"}') -response = sg.client.whitelabel.links.subuser.delete(query_params: params) +data = JSON.parse('{ + "url": "url" +}') +response = sg.client.user.webhooks.event.test.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby data = JSON.parse('{ - "default": true + "hostname": "myhostname.com", + "send_raw": false, + "spam_check": true, + "url": "http://email.myhosthame.com" }') -id = "test_url_param" -response = sg.client.whitelabel.links._(id).patch(request_body: data) +response = sg.client.user.webhooks.parse.settings.post(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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 ```ruby -id = "test_url_param" -response = sg.client.whitelabel.links._(id).get() +response = sg.client.user.webhooks.parse.settings.get() puts response.status_code puts response.body puts response.headers ``` -## 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} ```ruby -id = "test_url_param" -response = sg.client.whitelabel.links._(id).delete() +data = JSON.parse('{ + "send_raw": true, + "spam_check": false, + "url": "http://newdomain.com/parse" +}') +hostname = "test_url_param" +response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data) puts response.status_code puts response.body puts response.headers ``` -## 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} ```ruby -id = "test_url_param" -response = sg.client.whitelabel.links._(id).validate.post() +hostname = "test_url_param" +response = sg.client.user.webhooks.parse.settings._(hostname).get() puts response.status_code puts response.body puts response.headers ``` -## Associate a Link Whitelabel +## Delete a parse setting -**This endpoint allows you to associate a link whitelabel with a subuser account.** +**This endpoint allows you to delete a specific inbound parse setting.** -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. +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). -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. +### DELETE /user/webhooks/parse/settings/{hostname} -For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html). -### POST /whitelabel/links/{link_id}/subuser +```ruby +hostname = "test_url_param" +response = sg.client.user.webhooks.parse.settings._(hostname).delete() +puts response.status_code +puts response.body +puts response.headers +``` +## Retrieves Inbound Parse Webhook statistics. + +**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** + +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. + +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 ```ruby -data = JSON.parse('{ - "username": "jane@example.com" -}') -link_id = "test_url_param" -response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data) +params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}') +response = sg.client.user.webhooks.parse.stats.get(query_params: params) puts response.status_code puts response.body puts response.headers diff --git a/USE_CASES.md b/USE_CASES.md index a0ce96d0..a028567d 100644 --- a/USE_CASES.md +++ b/USE_CASES.md @@ -4,7 +4,7 @@ This documentation provides examples for specific use cases. Please [open an iss * [Transactional Templates](#transactional-templates) * [Legacy Templates](#legacy-templates) -* [How to Setup a Domain Whitelabel](#domain-whitelabel) +* [How to Setup a Domain Authentication](#domain-authentication) * [How to View Email Statistics](#email-statistics) @@ -224,12 +224,12 @@ mail.add_attachment(attachment) ``` Attachments must be base64 encoded, using Base64's strict_encode64 where no line feeds are added. - -# 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) and via API [here](https://github.com/sendgrid/sendgrid-ruby/blob/master/USAGE.md#whitelabel). +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/) and via API [here](https://github.com/sendgrid/sendgrid-nodejs/blob/master/packages/client/USAGE.md#sender-authentication). -Find more information about all of SendGrid's whitelabeling related documentation [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/index.html). +Find more information about all of SendGrid's authentication related documentation [here](https://sendgrid.com/docs/ui/account-and-settings/). # How to View Email Statistics diff --git a/examples/whitelabel/whitelabel.rb b/examples/senderauthentication/senderauthentication.rb similarity index 88% rename from examples/whitelabel/whitelabel.rb rename to examples/senderauthentication/senderauthentication.rb index b7f8a6dd..a87db4a5 100644 --- a/examples/whitelabel/whitelabel.rb +++ b/examples/senderauthentication/senderauthentication.rb @@ -5,7 +5,7 @@ ################################################## -# Create a domain whitelabel. # +# Create a domain authentication. # # POST /whitelabel/domains # data = JSON.parse('{ @@ -26,7 +26,7 @@ puts response.headers ################################################## -# List all domain whitelabels. # +# List all domain authentications. # # GET /whitelabel/domains # params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}') @@ -36,7 +36,7 @@ puts response.headers ################################################## -# Get the default domain whitelabel. # +# Get the default domain authentication. # # GET /whitelabel/domains/default # response = sg.client.whitelabel.domains.default.get() @@ -45,7 +45,7 @@ puts response.headers ################################################## -# List the domain whitelabel associated with the given user. # +# List the domain authentication associated with the given user. # # GET /whitelabel/domains/subuser # response = sg.client.whitelabel.domains.subuser.get() @@ -54,7 +54,7 @@ puts response.headers ################################################## -# Disassociate a domain whitelabel from a given user. # +# Disassociate a domain authentication from a given user. # # DELETE /whitelabel/domains/subuser # response = sg.client.whitelabel.domains.subuser.delete() @@ -63,7 +63,7 @@ puts response.headers ################################################## -# Update a domain whitelabel. # +# Update a domain authentication. # # PATCH /whitelabel/domains/{domain_id} # data = JSON.parse('{ @@ -77,7 +77,7 @@ puts response.headers ################################################## -# Retrieve a domain whitelabel. # +# Retrieve a domain authentication. # # GET /whitelabel/domains/{domain_id} # domain_id = "test_url_param" @@ -87,7 +87,7 @@ puts response.headers ################################################## -# Delete a domain whitelabel. # +# Delete a domain authentication. # # DELETE /whitelabel/domains/{domain_id} # domain_id = "test_url_param" @@ -97,7 +97,7 @@ puts response.headers ################################################## -# Associate a domain whitelabel with a given user. # +# Associate a domain authentication with a given user. # # POST /whitelabel/domains/{domain_id}/subuser # data = JSON.parse('{ @@ -110,7 +110,7 @@ puts response.headers ################################################## -# Add an IP to a domain whitelabel. # +# Add an IP to a domain authentication. # # POST /whitelabel/domains/{id}/ips # data = JSON.parse('{ @@ -123,7 +123,7 @@ puts response.headers ################################################## -# Remove an IP from a domain whitelabel. # +# Remove an IP from a domain authentication. # # DELETE /whitelabel/domains/{id}/ips/{ip} # id = "test_url_param" @@ -134,7 +134,7 @@ puts response.headers ################################################## -# Validate a domain whitelabel. # +# Validate a domain authentication. # # POST /whitelabel/domains/{id}/validate # id = "test_url_param" @@ -144,7 +144,7 @@ puts response.headers ################################################## -# Create an IP whitelabel # +# Create a reverse DNS record # # POST /whitelabel/ips # data = JSON.parse('{ @@ -158,7 +158,7 @@ puts response.headers ################################################## -# Retrieve all IP whitelabels # +# Retrieve a reverse DNS record # # GET /whitelabel/ips # params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}') @@ -168,7 +168,7 @@ puts response.headers ################################################## -# Retrieve an IP whitelabel # +# Retrieve a reverse DNS record # # GET /whitelabel/ips/{id} # id = "test_url_param" @@ -178,7 +178,7 @@ puts response.headers ################################################## -# Delete an IP whitelabel # +# Delete a reverse DNS record # # DELETE /whitelabel/ips/{id} # id = "test_url_param" @@ -188,7 +188,7 @@ puts response.headers ################################################## -# Validate an IP whitelabel # +# Validate a reverse DNS record # # POST /whitelabel/ips/{id}/validate # id = "test_url_param" @@ -198,7 +198,7 @@ puts response.headers ################################################## -# Create a Link Whitelabel # +# Create a Branded Link # # POST /whitelabel/links # data = JSON.parse('{ @@ -213,7 +213,7 @@ puts response.headers ################################################## -# Retrieve all link whitelabels # +# Retrieve all link brandings # # GET /whitelabel/links # params = JSON.parse('{"limit": 1}') @@ -223,7 +223,7 @@ puts response.headers ################################################## -# Retrieve a Default Link Whitelabel # +# Retrieve a Default Link Branding # # GET /whitelabel/links/default # params = JSON.parse('{"domain": "test_string"}') @@ -233,7 +233,7 @@ puts response.headers ################################################## -# Retrieve Associated Link Whitelabel # +# Retrieve Associated Link Branding # # GET /whitelabel/links/subuser # params = JSON.parse('{"username": "test_string"}') @@ -243,7 +243,7 @@ puts response.headers ################################################## -# Disassociate a Link Whitelabel # +# Disassociate a Link Branding # # DELETE /whitelabel/links/subuser # params = JSON.parse('{"username": "test_string"}') @@ -253,7 +253,7 @@ puts response.headers ################################################## -# Update a Link Whitelabel # +# Update a Link Branding # # PATCH /whitelabel/links/{id} # data = JSON.parse('{ @@ -266,7 +266,7 @@ puts response.headers ################################################## -# Retrieve a Link Whitelabel # +# Retrieve a Link Branding # # GET /whitelabel/links/{id} # id = "test_url_param" @@ -276,7 +276,7 @@ puts response.headers ################################################## -# Delete a Link Whitelabel # +# Delete a Link Branding # # DELETE /whitelabel/links/{id} # id = "test_url_param" @@ -286,7 +286,7 @@ puts response.headers ################################################## -# Validate a Link Whitelabel # +# Validate a Link Branding # # POST /whitelabel/links/{id}/validate # id = "test_url_param" @@ -296,7 +296,7 @@ puts response.headers ################################################## -# Associate a Link Whitelabel # +# Associate a Link Branding # # POST /whitelabel/links/{link_id}/subuser # data = JSON.parse('{ From 2b25cc1a6ad577c89ff5dc1c929912677303e6c3 Mon Sep 17 00:00:00 2001 From: chandler Date: Thu, 1 Nov 2018 12:09:48 -0400 Subject: [PATCH 2/4] Fix typo Signed-off-by: chandler --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index b396e678..9ce08eff 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2937,7 +2937,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 | From 98982ea7963a485aa8e3232cdf1107f7c80cf9d9 Mon Sep 17 00:00:00 2001 From: chandler Date: Sat, 3 Nov 2018 21:52:33 -0400 Subject: [PATCH 3/4] Remove more references to 'whitelabel' Signed-off-by: chandler --- USAGE.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/USAGE.md b/USAGE.md index 9ce08eff..e69f3095 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1819,7 +1819,7 @@ puts response.headers 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. @@ -1841,7 +1841,7 @@ puts response.headers 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. @@ -1860,7 +1860,7 @@ puts response.headers 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. @@ -1883,7 +1883,7 @@ puts response.headers 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. @@ -1903,7 +1903,7 @@ puts response.headers 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. From a53a7414c83b2a71fa6ef43c15879a05fb83c3b8 Mon Sep 17 00:00:00 2001 From: Chandler Weiner Date: Mon, 5 Nov 2018 15:30:25 -0500 Subject: [PATCH 4/4] Update USAGE.md --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index e69f3095..dab558ff 100644 --- a/USAGE.md +++ b/USAGE.md @@ -3218,7 +3218,7 @@ puts response.status_code puts response.body puts response.headers ``` -## Validate a reverse DNS +## Validate a reverse DNS record **This endpoint allows you to validate a reverse DNS record.**