/designs/pre-builts
This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid.
Unlike the /designs endpoint where your designs are stored, a GET request made to designs/pre-builts will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library.
By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the page_size query parameter.
This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| page_size | query | optional | integer | number of results to return |
| page_token | query | optional | string | token corresponding to a specific page of results, as provided by metadata |
| summary | query | optional | boolean | set to false to return all fields |
GET /designs/pre-builts
/designs/pre-builts/{id}
This endpoint allows you to retrieve a single pre-built design.
A GET request to /designs/pre-builts/{id} will retrieve details about a specific pre-built design.
This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the pre-built Design you want to duplicate. |
GET /designs/pre-builts/{id}
/designs/pre-builts/{id}
This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs.
Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the name field blank, your duplicate will be assigned the name of the design it was copied from with the text “Duplicate: “ prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the “List SendGrid Pre-built Designs” endpoint.
You can modify your duplicate’s name at the time of creation by passing an updated value to the name field when making the initial request.
More on retrieving design IDs can be found above.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the pre-built Design you want to duplicate. |
application/json
design-duplicate-input
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| editor | string | optional |
POST /designs/pre-builts/{id}
/designs/{id}
This endpoint allows you to delete a single design.
Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the Design you want to duplicate. |
DELETE /designs/{id}
/designs/{id}
This endpoint allows you to retrieve a single design.
A GET request to /designs/{id} will retrieve details about a specific design in your Design Library.
This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the Design you want to duplicate. |
GET /designs/{id}
/designs/{id}
This endpoint allows you to edit a design.
The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered.
For example, updating a design’s name requires that you make a PATCH request to this endpoint with data specified for the name field only.
{
"name": "<Updated Name>"
}
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the Design you want to duplicate. |
application/json
DesignsApiUpdateDesignByIdRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| subject | string | optional |
| categories | array | optional |
| html_content | string | optional |
| plain_content | string | optional |
| generate_plain_content | boolean | optional |
PATCH /designs/{id}
/designs/{id}
This endpoint allows you to duplicate one of your existing designs.
Modifying an existing design is often the easiest way to create something new.
You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the name field blank, your duplicate will be assigned the name of the design it was copied from with the text “Duplicate: “ prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs.
You can modify your duplicate’s name at the time of creation by passing an updated value to the name field when making the initial request.
More on retrieving design IDs can be found below.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the Design you want to duplicate. |
application/json
design-duplicate-input
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| editor | string | optional |
POST /designs/{id}
/whitelabel/domains
This endpoint allows you to retrieve a list of all domains you have authenticated.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| limit | query | optional | integer | Number of domains to return. |
| offset | query | optional | integer | Paging offset. |
| exclude_subusers | query | optional | boolean | Exclude subuser domains from the result. |
| username | query | optional | string | The username associated with an authenticated domain. |
| domain | query | optional | string | Search for authenticated domains. |
| on-behalf-of | header | optional | string | — |
GET /whitelabel/domains
/whitelabel/domains
This endpoint allows you to authenticate a domain.
If you are authenticating a domain for a subuser, you have two options:
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
DomainAuthenticationPostAuthenticateDomainRequest
| Property | Type | Required |
|---|---|---|
| ips | array | optional |
| domain | string | required |
| default | boolean | optional |
| username | string | optional |
| subdomain | string | optional |
| custom_spf | boolean | optional |
| automatic_security | boolean | optional |
| custom_dkim_selector | string | optional |
POST /whitelabel/domains
/whitelabel/domains/default
This endpoint allows you to retrieve the default authentication for a domain.
When creating or updating a domain authentication, you can set the domain as a default. The default domain will be used to send all mail. If you have multiple authenticated domains, the authenticated domain matching the domain of the From address will be used, and the default will be overridden.
This endpoint will return a default domain and its details only if a default is set. You are not required to set a default. If you do not set a default domain, this endpoint will return general information about your domain authentication status.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| domain | query | optional | string | The domain to find a default authentication. |
| on-behalf-of | header | optional | string | — |
GET /whitelabel/domains/default
/whitelabel/domains/subuser
This endpoint allows you to disassociate a specific authenticated domain from a subuser.
Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent’s domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| username | query | optional | string | Username for the subuser to find associated authenticated domain. |
DELETE /whitelabel/domains/subuser
/whitelabel/domains/subuser
This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.
Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent’s domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| username | query | required | string | Username for the subuser to find associated authenticated domain. |
GET /whitelabel/domains/subuser
/whitelabel/domains/{domain_id}
This endpoint allows you to delete an authenticated domain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| domain_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
DELETE /whitelabel/domains/{domain_id}
/whitelabel/domains/{domain_id}
This endpoint allows you to retrieve a specific authenticated domain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| domain_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
GET /whitelabel/domains/{domain_id}
/whitelabel/domains/{domain_id}
This endpoint allows you to update the settings for an authenticated domain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| domain_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
application/json
DomainAuthenticationUpdateDomainSettingsRequest
| Property | Type | Required |
|---|---|---|
| default | boolean | optional |
| custom_spf | boolean | optional |
PATCH /whitelabel/domains/{domain_id}
/whitelabel/domains/{domain_id}/subuser
This endpoint allows you to associate a specific authenticated domain with a subuser.
Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent’s domain authentication. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| domain_id | path | required | integer | ID of the authenticated domain to associate with the subuser |
application/json
DomainAuthenticationAssociateSubuserWithDomainRequest
| Property | Type | Required |
|---|---|---|
| username | string | required |
POST /whitelabel/domains/{domain_id}/subuser
/whitelabel/domains/{id}/ips
This endpoint allows you to add an IP address to an authenticated domain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | ID of the domain to which you are adding an IP |
| on-behalf-of | header | optional | string | — |
application/json
DomainAuthenticationAddIpToDomainRequest
| Property | Type | Required |
|---|---|---|
| ip | string | required |
POST /whitelabel/domains/{id}/ips
/whitelabel/domains/{id}/ips/{ip}
This endpoint allows you to remove an IP address from that domain’s authentication.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | ID of the domain to delete the IP from. |
| ip | path | required | string | IP to remove from the domain. |
| on-behalf-of | header | optional | string | — |
DELETE /whitelabel/domains/{id}/ips/{ip}
/whitelabel/domains/{id}/validate
This endpoint allows you to validate an authenticated domain. If it fails, it will return an error message describing why the domain could not be validated.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | ID of the domain to validate. |
| on-behalf-of | header | optional | string | — |
POST /whitelabel/domains/{id}/validate
/validations/email
This endpoint allows you to validate an email address.
application/json
EmailAddressValidationCheckValidityRequest
| Property | Type | Required |
|---|---|---|
| string | required | |
| source | string | optional |
POST /validations/email
/whitelabel/dns/email
This endpoint is used to share DNS records with a colleagues
Use this endpoint to send SendGrid-generated DNS record information to a co-worker so they can enter it into your DNS provider to validate your domain and link branding.
What type of records are sent will depend on whether you have chosen Automated Security or not. When using Automated Security, SendGrid provides you with three CNAME records. If you turn Automated Security off, you are instead given TXT and MX records.
If you pass a link_id to this endpoint, the generated email will supply the DNS records necessary to complete Link Branding setup. If you pass a domain_id to this endpoint, the generated email will supply the DNS records needed to complete Domain Authentication. Passing both IDs will generate an email with the records needed to complete both setup steps.
You can retrieve all your domain IDs from the returned id fields for each domain using the “List all authenticated domains” endpoint. You can retrieve all of your link IDs using the “Retrieve all branded links” endpoint.
application/json
EmailCnameRecordsSendDnsEmailRequest
| Property | Type | Required |
|---|---|---|
| string | required | |
| link_id | integer | required |
| message | string | optional |
| domain_id | integer | required |
POST /whitelabel/dns/email
/access_settings/activity
This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| limit | query | optional | integer | Limits the number of IPs to return. |
| on-behalf-of | header | optional | string | — |
GET /access_settings/activity
/access_settings/whitelist
This endpoint allows you to remove one or more IP addresses from your list of allowed addresses.
To remove one or more IP addresses, pass this endpoint an array containing the ID(s) associated with the IP(s) you intend to remove. You can retrieve the IDs associated with your allowed IP addresses using the “Retrieve a list of currently allowed IPs” endpoint.
It is possible to remove your own IP address, which will block access to your account. You will need to submit a support ticket if this happens. For this reason, it is important to double check that you are removing only the IPs you intend to remove when using this endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
IpAccessManagementRemoveIpAddressesRequest
| Property | Type | Required |
|---|---|---|
| ids | array | optional |
DELETE /access_settings/whitelist
/access_settings/whitelist
This endpoint allows you to retrieve a list of IP addresses that are currently allowed to access your account.
Each IP address returned to you will have created_at and updated_at dates. Each IP will also be associated with an id that can be used to remove the address from your allow list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
GET /access_settings/whitelist
/access_settings/whitelist
This endpoint allows you to add one or more allowed IP addresses.
To allow one or more IP addresses, pass them to this endpoint in an array. Once an IP address is added to your allow list, it will be assigned an id that can be used to remove the address. You can retrieve the ID associated with an IP using the “Retrieve a list of currently allowed IPs” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
IpAccessManagementAddAllowedIpsRequest
| Property | Type | Required |
|---|---|---|
| ips | array | required |
| └ ip | string | required |
POST /access_settings/whitelist
/access_settings/whitelist/{rule_id}
This endpoint allows you to remove a specific IP address from your list of allowed addresses.
When removing a specific IP address from your list, you must include the ID in your call. You can retrieve the IDs associated with your allowed IP addresses using the “Retrieve a list of currently allowed IPs” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| rule_id | path | required | string | The ID of the allowed IP address that you want to retrieve. |
| on-behalf-of | header | optional | string | — |
DELETE /access_settings/whitelist/{rule_id}
/access_settings/whitelist/{rule_id}
This endpoint allows you to retreive a specific IP address that has been allowed to access your account.
You must include the ID for the specific IP address you want to retrieve in your call. You can retrieve the IDs associated with your allowed IP addresses using the “Retrieve a list of currently allowed IPs” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| rule_id | path | required | string | The ID of the allowed IP address that you want to retrieve. |
| on-behalf-of | header | optional | string | — |
GET /access_settings/whitelist/{rule_id}
/ips
This endpoint allows you to retrieve a list of all assigned and unassigned IPs.
Response includes warm up status, pools, assigned subusers, and reverse DNS 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| ip | query | optional | string | The IP address to get |
| exclude_whitelabels | query | optional | boolean | Should we exclude reverse DNS records (whitelabels)? |
| limit | query | optional | integer | The number of IPs you want returned at the same time. |
| offset | query | optional | integer | The offset for the number of IPs that you are requesting. |
| subuser | query | optional | string | The subuser you are requesting for. |
| sort_by_direction | query | optional | string | The direction to sort the results. |
GET /ips
/ips
This endpoint is for adding a(n) IP Address(es) to your account.
application/json
PostIpsRequest
| Property | Type | Required |
|---|---|---|
| count | integer | required |
| warmup | boolean | optional |
| subusers | array | optional |
POST /ips
/ips/assigned
This endpoint allows you to retrieve only assigned IP addresses.
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.
GET /ips/assigned
/ips/remaining
This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs.
GET /ips/remaining
/ips/{ip_address}
This endpoint allows you to see which IP pools a particular IP address has been added to.
The same IP address can be added to multiple IP pools.
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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| ip_address | path | required | string | The IP address you are retrieving the IP pools for. |
GET /ips/{ip_address}
/ips/pools
This endpoint allows you to get all of your IP pools.
GET /ips/pools
/ips/pools
This endpoint allows you to create an IP pool.
Before you can create an IP pool, you need to activate the IP in your SendGrid account:
application/json
IpPoolsCreatePoolRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
POST /ips/pools
/ips/pools/{pool_name}
This endpoint allows you to delete an IP pool.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pool_name | path | required | string | The name of the IP pool that you want to retrieve the IP addresses for. |
DELETE /ips/pools/{pool_name}
/ips/pools/{pool_name}
This endpoint allows you to get all of the IP addresses that are in a specific IP pool.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pool_name | path | required | string | The name of the IP pool that you want to retrieve the IP addresses for. |
GET /ips/pools/{pool_name}
/ips/pools/{pool_name}
This endpoint allows you to update the name of an IP pool.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pool_name | path | required | string | The name of the IP pool that you want to retrieve the IP addresses for. |
application/json
IpPoolsUpdateNameRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
PUT /ips/pools/{pool_name}
/ips/pools/{pool_name}/ips
This endpoint allows you to add an IP address to an IP pool.
You can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made.
Before you can add an IP to a pool, you need to activate it in your SendGrid account:
You can retrieve all of your available IP addresses from the “Retrieve all IP addresses” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pool_name | path | required | string | The name of the IP pool you want to add the address to. If the name contains spaces, they must be URL encoded (e.g., “Test Pool” becomes “Test%20Pool”). |
application/json
IpPoolsAddIpAddressToPoolRequest
| Property | Type | Required |
|---|---|---|
| ip | string | optional |
POST /ips/pools/{pool_name}/ips
/ips/pools/{pool_name}/ips/{ip}
This endpoint allows you to remove an IP address from an IP pool.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| pool_name | path | required | string | The name of the IP pool that you are removing the IP address from. |
| ip | path | required | string | The IP address that you wish to remove. |
DELETE /ips/pools/{pool_name}/ips/{ip}
/ips/warmup
This endpoint allows you to retrieve all of your IP addresses that are currently warming up.
GET /ips/warmup
/ips/warmup
This endpoint allows you to put an IP address into warmup mode.
application/json
IpWarmupStartIpAddressWarmupRequest
| Property | Type | Required |
|---|---|---|
| ip | string | optional |
POST /ips/warmup
/ips/warmup/{ip_address}
This endpoint allows you to remove an IP address from warmup mode.
Your request will return a 204 status code if the specified IP was successfully removed from warmup mode. To retrieve details of the IP’s warmup status before removing it from warmup mode, call the “Retrieve the warmpup status for a specific IP address” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| ip_address | path | required | string | The IP address that you want to retrieve the warmup status for. |
DELETE /ips/warmup/{ip_address}
/ips/warmup/{ip_address}
This endpoint allows you to retrieve the warmup status for a specific IP address.
You can retrieve all of your warming IPs using the “Retrieve all IPs currently in warmup” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| ip_address | path | required | string | The IP address that you want to retrieve the warmup status for. |
GET /ips/warmup/{ip_address}
/suppression/invalid_emails
This endpoint allows you to remove email addresses from your invalid email address list.
There are two options for deleting invalid email addresses:
1) You can delete all invalid email addresses by setting delete_all to true in the request body.
2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
InvalidEmailsApiDeleteInvalidEmailsRequest
| Property | Type | Required |
|---|---|---|
| emails | array | optional |
| delete_all | boolean | optional |
DELETE /suppression/invalid_emails
/suppression/invalid_emails
This endpoint allows you to retrieve a list of all invalid email addresses.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| start_time | query | optional | integer | Refers start of the time range in unix timestamp when an invalid email was created (inclusive). |
| end_time | query | optional | integer | Refers end of the time range in unix timestamp when an invalid email was created (inclusive). |
| limit | query | optional | integer | Limit the number of results to be displayed per page. |
| offset | query | optional | integer | Paging offset. The point in the list to begin displaying results. |
| on-behalf-of | header | optional | string | — |
GET /suppression/invalid_emails
/suppression/invalid_emails/{email}
This endpoint allows you to remove a specific email address from the invalid email address list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | The specific email address of the invalid email entry that you want to retrieve. |
|
| on-behalf-of | header | optional | string | — |
DELETE /suppression/invalid_emails/{email}
/suppression/invalid_emails/{email}
This endpoint allows you to retrieve a specific invalid email addresses.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | The specific email address of the invalid email entry that you want to retrieve. |
|
| on-behalf-of | header | optional | string | — |
GET /suppression/invalid_emails/{email}
/whitelabel/links
This endpoint allows you to retrieve all branded links.
You can submit this request as one of your subusers if you include their ID in the on-behalf-of header in the request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| limit | query | optional | integer | Limits the number of results returned per page. |
| on-behalf-of | header | optional | string | — |
GET /whitelabel/links
/whitelabel/links
This endpoint allows you to create a new branded link.
To create the link branding, supply the root domain and, optionally, the subdomain — these go into separate fields in your request body. The root domain should match your FROM email address. If you provide a subdomain, it must be different from the subdomain you used for authenticating your domain.
You can submit this request as one of your subusers if you include their ID in the on-behalf-of header in the request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
LinkBrandingCreateBrandedLinkRequest
| Property | Type | Required |
|---|---|---|
| domain | string | required |
| default | boolean | optional |
| subdomain | string | optional |
POST /whitelabel/links
/whitelabel/links/default
This endpoint allows you to retrieve the default branded link.
The default branded link is the actual URL to be used when sending messages. If you have more than one branded link, the default is determined by the following order:
default (set when you call the “Create a branded link” endpoint or by calling the “Update a branded link” endpoint on an existing link)100.ct.sendgrid.net)You can submit this request as one of your subusers if you include their ID in the on-behalf-of header in the request.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| domain | query | optional | string | The domain to match against when finding the default branded link. |
| on-behalf-of | header | optional | string | — |
GET /whitelabel/links/default