Query structured spec data via REST or MCP. Get exactly what your agent needs.
http://api.sendgrid.com/v3
/api_keys
This endpoint allows you to create a new API Key for the user.
To create your initial SendGrid API Key, you should use the SendGrid App. Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management.
There is a limit of 100 API Keys on your account.
A JSON request body containing a name property is required when making requests to this endpoint. If the number of maximum keys, 100, is reached, a 403 status will be returned.
Though the name field is required, it does not need to be unique. A unique API key ID will be generated for each key you create and returned in the response body.
It is not necessary to pass a scopes field to the API when creating a key, but you should be aware that omitting the scopes field from your request will create a key with “Full Access” permissions by default.
See the API Key Permissions List for all available scopes. An API key’s scopes can be updated after creation using the “Update API keys” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
ApiKeysCreateKeyRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| scopes | array | optional |
POST /api_keys
/alerts
This endpoint allows you to create a new alert.
Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. There are two types of alerts that can be created with this endpoint:
usage_limit allows you to set the threshold at which an alert will be sent.stats_notification allows you to set how frequently you would like to receive email statistics reports. For example, “daily”, “weekly”, or “monthly”.For more information about alerts, please see our Alerts documentation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
PostAlertsRequest
| Property | Type | Required |
|---|---|---|
| type | string | required |
| email_to | string | required |
| frequency | string | optional |
| percentage | integer | optional |
POST /alerts
/messages/download
This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice.
This request will kick off a backend process to generate a CSV file. Once generated, the worker will then send an email for the user download the file. The link will expire in 3 days.
The CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours (rate limit may change).
This endpoint is similar to the GET Single Message endpoint - the only difference is that /download is added to indicate that this is a CSV download requests but the same query is used to determine what the CSV should contain.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| query | query | optional | string | Uses a SQL like syntax to indicate which messages to include in the CSV |
POST /messages/download
/campaigns
This endpoint allows you to create a campaign.
In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
campaign_request
| Property | Type | Required |
|---|---|---|
| title | string | required |
| editor | string | optional |
| ip_pool | string | optional |
| subject | string | optional |
| list_ids | array | optional |
| sender_id | integer | optional |
| categories | array | optional |
| segment_ids | array | optional |
| html_content | string | optional |
| plain_content | string | optional |
| suppression_group_id | integer | optional |
| custom_unsubscribe_url | string | optional |
“title”: “title can’t be blank”
“title”: “title is too long (maximum is 100 characters)”
“categories”: “categories exceeds 10 category limit”
“html_content”: “html_content exceeds the 1MB limit”
“plain_content”: “plain_content exceeds the 1MB limit”
“sender_id”: “sender_id does not exist”
“sender_id”: “sender_id is not a verified sender identity”
“list_ids”: “list_ids do not all exist”
“segment_ids”: “segment_ids do not all exist”
“ip_pool”: “The ip pool you provided is invalid”
“suppression_group_id”: “suppression_group_id does not exist”
“unsubscribes”: “Either suppression_group_id or custom_unsubscribe_url may be set/used, but not both. Please remove one before setting the other.”
“”: “The JSON you have submitted cannot be parsed.”
“”: “You’ve reached your limit of 250 campaigns. Please delete one or more and try again.”
POST /campaigns
/campaigns/{campaign_id}/schedules
This endpoint allows you to schedule a specific date and time for your campaign to be sent.
If you have the flexibility, it’s better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won’t be going through our servers at the same times as everyone else’s mail.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | — |
| on-behalf-of | header | optional | string | — |
application/json
CampaignsApiScheduleCampaignRequest
| Property | Type | Required |
|---|---|---|
| send_at | integer | required |
“subject”: “subject can’t be blank”
“sender_id”: “sender_id can’t be blank”
“plain_content”: “plain_content can’t be blank, please provide plain text or html content”
“list_ids”: “You must select at least 1 segment or 1 list to send to.”
“send_at”: “Please choose a future time for sending your campaign.”
“unsubscribe_tag”: “An [unsubscribe] tag in both your html and plain content is required to send a campaign.”
“suppression_group_id”: “Either a suppression_group_id or custom_unsubscribe_url is required to send a campaign.”
“”: “The JSON you have submitted cannot be parsed.”
“”:”You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing”
””: “You cannot POST to a campaign that has already sent or scheduled. However you can update a scheduled campaign with a PATCH.”
””: “not found”
POST /campaigns/{campaign_id}/schedules
/campaigns/{campaign_id}/schedules/now
This endpoint allows you to immediately send an existing campaign.
Normally a POST request would have a body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | — |
| on-behalf-of | header | optional | string | — |
“subject”: “subject can’t be blank”
“sender_id”: “sender_id can’t be blank”
“plain_content”: “plain_content can’t be blank, please provide plain text or html content”
“list_ids”: “You must select at least 1 segment or 1 list to send to.”
“unsubscribe_tag”: “An [unsubscribe] tag in both your html and plain content is required to send a campaign.”
“suppression_group_id”: “Either a suppression_group_id or custom_unsubscribe_url is required to send a campaign.”
“”: “You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing”
””: “You may only send a campaign when it is in draft mode.”
””: “not found”
POST /campaigns/{campaign_id}/schedules/now
/campaigns/{campaign_id}/schedules/test
This endpoint allows you to send a test campaign.
To send to multiple addresses, use an array for the JSON “to” value [“one@address”,”two@address”]
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | — |
| on-behalf-of | header | optional | string | — |
application/json
CampaignsApiSendTestCampaignRequest
| Property | Type | Required |
|---|---|---|
| to | string | required |
””: “The JSON you have submitted cannot be parsed.”
“to”: “Please provide an email address to which the test should be sent.”
“to”: “You can only send tests to 10 addresses at a time.”
“subject”: “Please add a subject to your campaign before sending a test.”
“plain_content”: “Plain content and html content can’t both be blank. Please set one of these values before sending a test.”
“sender_id”: “Please assign a sender identity to your campaign before sending a test.”
””: “not found”
POST /campaigns/{campaign_id}/schedules/test
/mail/batch
This endpoint allows you to generate a new batch ID.
Once a batch_id is created, you can associate it with a scheduled send using the /mail/send endpoint. Passing the batch_id as a field in the /mail/send request body will assign the ID to the send you are creating.
Once an ID is associated with a scheduled send, the send can be accessed and its send status can be modified using the batch_id.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
POST /mail/batch
/user/scheduled_sends
This endpoint allows you to cancel or pause a scheduled send associated with a batch_id.
Passing this endpoint a batch_id and status will cancel or pause the scheduled send.
Once a scheduled send is set to pause or cancel you must use the “Update a scheduled send” endpoint to change its status or the “Delete a cancellation or pause from a scheduled send” endpoint to remove the status. Passing a status change to a scheduled send that has already been paused or cancelled will result in a 400 level status code.
If the maximum number of cancellations/pauses are added to a send, a 400 level status code will be returned.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
CancelScheduledSendsByBatchIdStatusRequest
| Property | Type | Required |
|---|---|---|
| status | string | required |
| batch_id | string | required |
POST /user/scheduled_sends
/sso/certificates
This endpoint allows you to create an SSO certificate.
application/json
CertificatesCreateSsoCertificateRequest
| Property | Type | Required |
|---|---|---|
| enabled | boolean | optional |
| integration_id | string | required |
| public_certificate | string | required |
POST /sso/certificates
/marketing/contacts/batch
This endpoint is used to retrieve a set of contacts identified by their IDs.
This can be more efficient endpoint to get contacts than making a series of individual GET requests to the “Get a Contact by ID” endpoint.
You can supply up to 100 IDs. Pass them into the ids field in your request body as an array or one or more strings.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
application/json
ContactsGetBatchedByIdsRequest
| Property | Type | Required |
|---|---|---|
| ids | array | required |
POST /marketing/contacts/batch
/marketing/contacts/exports
Use this endpoint to export lists or segments of contacts.
If you would just like to have a link to the exported list sent to your email set the notifications.email option to true in the POST payload.
If you would like to download the list, take the id that is returned and use the “Export Contacts Status” endpoint to get the urls. Once you have the list of URLs, make a GET request to each URL provided to download your CSV file(s).
You specify the segements and or/contact lists you wish to export by providing the relevant IDs in, respectively, the segment_ids and list_ids fields in the request body.
The lists will be provided in either JSON or CSV files. To specify which of these you would required, set the request body file_type field to json or csv.
You can also specify a maximum file size (in MB). If the export file is larger than this, it will be split into multiple files.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
application/json
ContactsExportListsSegmentsRequest
| Property | Type | Required |
|---|---|---|
| list_ids | array | optional |
| file_type | string | optional |
| segment_ids | array | optional |
| max_file_size | integer | optional |
| notifications | object | optional |
| boolean | optional |
POST /marketing/contacts/exports
/marketing/contacts/search
Use this endpoint to locate contacts.
The request body’s query field accepts valid SGQL for searching for a contact.
Because contact emails are stored in lower case, using SGQL to search by email address requires the provided email address to be in lower case. The SGQL lower() function can be used for this.
Only the first 50 contacts that meet the search criteria will be returned.
If the query takes longer than 20 seconds, a 408 Request Timeout status will be returned.
Formatting the created_at and updated_at values as Unix timestamps is deprecated. Instead they are returned as ISO format as string.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
application/json
ContactsSearchContactsByQueryRequest
| Property | Type | Required |
|---|---|---|
| query | string | required |
POST /marketing/contacts/search
/marketing/contacts/search/emails
This endpoint allows you to retrieve up to 100 contacts matching the searched email address(es), including any alternate_emails.
Email addresses are unique to a contact, meaning this endpoint can treat an email address as a primary key to search by. The contact object associated with the address, whether it is their email or one of their alternate_emails will be returned if matched.
Email addresses in the search request do not need to match the case in which they’re stored, but the email addresses in the result will be all lower case. Empty strings are excluded from the search and will not be returned.
This endpoint should be used in place of the “Search Contacts” endpoint when you can provide exact email addresses and do not need to include other Segmentation Query Language (SGQL) filters when searching.
If you need to access a large percentage of your contacts, we recommend exporting your contacts with the “Export Contacts” endpoint and filtering the results client side.
This endpoint returns a 200 status code when any contacts match the address(es) you supplied. When searching multiple addresses in a single request, it is possible that some addresses will match a contact while others will not. When a partially successful search like this is made, the matching contacts are returned in an object and an error message is returned for the email address(es) that are not found.
This endpoint returns a 404 status code when no contacts are found for the provided email address(es).
A 400 status code is returned if any searched addresses are invalid.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
application/json
ContactsSearchByEmailsRequest
| Property | Type | Required |
|---|---|---|
| emails | array | required |
POST /marketing/contacts/search/emails
/contactdb/custom_fields
This endpoint allows you to create a custom field.
You can create up to 120 custom fields.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
ContactsApiCustomFieldsCreateNewFieldRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| type | string | optional |
”” : “Returned if request body is invalid JSON”
“type” : “Returned if custom field type is invalid or not provided”
“name” : “Returned if custom field name is not provided”
POST /contactdb/custom_fields
/contactdb/lists
This endpoint allows you to create a list for your recipients.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
ContactsApiListsCreateNewListRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
“name” : “Returned if list name is a duplicate of an existing list or segment”
“name” : “Returned if list name is not a string”
“” : “Returned if request body is invalid JSON”
POST /contactdb/lists
/contactdb/lists/{list_id}/recipients
This endpoint allows you to add multiple recipients to a list.
Adds existing recipients to a list, passing in the recipient IDs to add. Recipient IDs should be passed exactly as they are returned from recipient endpoints.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| list_id | path | required | integer | The id of the list of recipients you want to retrieve. |
| on-behalf-of | header | optional | string | — |
application/json
ContactsApiListsAddMultipleRecipientsToListRequest
of integer
“list_id” : “Returned if list_id is not a valid integer”
“” : “Returned if no valid recipient ids were passed”
“” : “Returned if no recipients were added”
“” : “Returned if request body is invalid JSON”
“list_id”: “Returned if list_id does not exist”
POST /contactdb/lists/{list_id}/recipients
/contactdb/lists/{list_id}/recipients/{recipient_id}
This endpoint allows you to add a single recipient to a list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| list_id | path | required | integer | The ID of the list that you want to add the recipient to. |
| recipient_id | path | required | string | The ID of the recipient you are adding to the list. |
| on-behalf-of | header | optional | string | — |
“list_id” : “Returned if list_id is invalid”
“recipient_id” : “Returned if recipient_id is invalid”
“list_id” : “Returned if list_id does not exist”
“recipient_id” : “Returned if recipient_id does not exist”
POST /contactdb/lists/{list_id}/recipients/{recipient_id}
/contactdb/recipients
This endpoint allows you to add a Marketing Campaigns recipient.
You can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides.
The rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
ContactsApiRecipientsAddRecipientRequest
of object
| Property | Type | Required |
|---|---|---|
| age | integer | optional |
| string | required | |
| last_name | string | optional |
| first_name | string | optional |
”” : “Returned if request body is not valid json”
POST /contactdb/recipients
/contactdb/recipients/search
Search using segment conditions without actually creating a segment.
Body contains a JSON object with conditions, a list of conditions as described below, and an optional list_id, which is a valid list ID for a list to limit the search on.
Valid operators for create and update depend on the type of the field for which you are searching.
Field values must all be a string.
Search conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either clicks.campaign_identifier or opens.campaign_identifier.
The condition value should be a string containing the id of a completed campaign.
Search conditions list may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or".
application/json
ContactsApiRecipientsSearchBySegmentConditionsRequest
| Property | Type | Required |
|---|---|---|
| list_id | integer | required |
| conditions | array | required |
POST /contactdb/recipients/search
/contactdb/segments
This endpoint allows you to create a new segment.
Valid operators for create and update depend on the type of the field for which you are searching.
Dates
Text
Numbers
Email Clicks and Opens
All field values must be a string.
Conditions using “eq” or “ne” for email clicks and opens should provide a “field” of either clicks.campaign_identifier or opens.campaign_identifier.
The condition value should be a string containing the id of a completed campaign.
The conditions list may contain multiple conditions, joined by an “and” or “or” in the “and_or” field.
The first condition in the conditions list must have an empty “and_or”, and subsequent conditions must all specify an “and_or”.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
contactdb_segments
| Property | Type | Required |
|---|---|---|
| name | string | required |
| list_id | integer | optional |
| conditions | array | required |
| └ field | string | required |
| └ value | string | required |
| └ and_or | string | optional |
| └ operator | string | required |
| recipient_count | number | optional |
“name” : “Returned if the name is not valid”
“list_id” : “Returned if the list_id is not valid”
“and_or” : “Returned if and_or and set value is not passed into the request body”
“and_or” : “Returned if and_or is set on the only condition passed”
“and_or” : “Returned if and_or is set on all conditions”
“and_or” : “Returned if and_or is not set on more than one condition and less than all conditions”
“operator” : “Returned if operator and set value is not passed into the request body”
“value” : “Returned if value and set value is not passed into the request body”
“field” : “Returned if field and set value is not passed into the request body”
“” : “Returned if request body is not valid json”
“” : “Returned if invalid value is passed into one of the request body parameters”
POST /contactdb/segments
/marketing/field_definitions
This endpoint creates a new custom field definition.
Custom field definitions are created with the given name and field_type. Although field names are stored in a case-sensitive manner, all field names must be case-insensitively unique. This means you may create a field named CamelCase or camelcase, but not both. Additionally, a Custom Field name cannot collide with any Reserved Field names. You should save the returned id value in order to update or delete the field at a later date. You can have up to 120 custom fields.
The custom field name should be created using only alphanumeric characters (A-Z and 0-9) and underscores (_). Custom fields can only begin with letters A-Z or underscores (_). The field type can be date, text, or number fields. The field type is important for creating segments from your contact database.
Note: Creating a custom field that begins with a number will cause issues with sending in Marketing Campaigns.
application/json
CustomFieldsCreateDefinitionRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| field_type | string | required |
POST /marketing/field_definitions
/designs
This endpoint allows you to create a new design.
You can add a new design by passing data, including a string of HTML email content, to /designs. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to Cross-Platform Email Design.
The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the Design and Code Editor documentation.
Because the /designs endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI.
application/json
design-input
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| editor | string | optional |
| subject | string | optional |
| categories | array | optional |
| generate_plain_content | boolean | optional |
| html_content | string | required |
| plain_content | string | optional |
POST /designs
/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 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 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/{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}/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/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
/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/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}/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/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
/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/{id}/validate
This endpoint allows you to validate a branded link.
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 |
|---|---|---|---|---|
| id | path | required | integer | The ID of the branded link that you want to validate. |
| on-behalf-of | header | optional | string | — |
POST /whitelabel/links/{id}/validate
/whitelabel/links/{link_id}/subuser
This endpoint allows you to associate a branded link with a subuser account.
Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent’s link branding. To associate 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 of the Twilio SendGrid App.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| link_id | path | required | integer | The ID of the branded link you want to associate. |
application/json
LinkBrandingAssociateBrandedLinkWithSubuserRequest
| Property | Type | Required |
|---|---|---|
| username | string | optional |
POST /whitelabel/links/{link_id}/subuser
/marketing/lists
This endpoint creates a new contacts list.
Once you create a list, you can use the UI to trigger an automation every time you add a new contact to the list.
A link to the newly created object is in _metadata.
application/json
ListsCreateNewListRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
POST /marketing/lists
/mail/send
The Mail Send endpoint allows you to send email over SendGrid’s v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, see our v2 API Reference.
Twilio SendGrid provides libraries to help you quickly and easily integrate with the v3 Web API in 7 different languages:
In order to send a dynamic template, specify the template ID with the template_id parameter.
To specify handlebar substitutions, define your substitutions in the request JSON with this syntax:
"dynamic_template_data": {
"guest": "Jane Doe",
"partysize": "4",
"english": true,
"date": "April 1st, 2021"
}
For more information about Dynamic Transactional Templates and Handlebars, see our documentation and reference pages.
Mail body compression is available to some high volume accounts. Talk to your CSM if you are interested in this functionality. Mail body compression works by setting up a JSON payload as defined on this page, then compressing it with gzip (the gzip file can be no more than 30mb).
To use mail body compression:
Content-Encoding header, with a value of gzip. Content-Encoding: gzip--data-binary '@data.json.gz'
Using reply_to_list allows senders to include more than one recipient email address to receive reply and/or bounce messages from the recipient of the email.
reply_to is mutually exclusive with reply_to_list. If both are used, then the API call will be rejected.reply_to_list object, when used, must at least have an email parameter and may also contain a name parameter.reply_to_list should be unique.reply_to_list emails per mail/send request.reply_to is mutually exclusive with reply_to_list.reply_to_list object, when used, must at least have an email parameter and may also contain a name parameter.reply_to_list should be unique.reply_to emails per mail/send request.reply_to_list email does not contain a valid address.reply_to_list email exceeds the maximum total length of X characters.reply_to_list email parameter is required.application/json
MailSendV3EmailSendRequest
| Property | Type | Required |
|---|---|---|
| asm | object | optional |
| └ group_id | integer | required |
| └ groups_to_display | array | optional |
| from | object | required |
| └ name | string | optional |
| string | required | |
| content | array | required |
| └ type | string | required |
| └ value | string | required |
| headers | object | optional |
| send_at | integer | optional |
| subject | string | required |
| batch_id | string | optional |
| reply_to | object | optional |
| └ name | string | optional |
| string | required | |
| categories | array | optional |
| attachments | array | optional |
| └ type | string | optional |
| └ content | string | required |
| └ filename | string | required |
| └ content_id | string | optional |
| └ disposition | string | optional |
| custom_args | string | optional |
| template_id | string | optional |
| ip_pool_name | string | optional |
| mail_settings | object | optional |
| └ footer | object | optional |
| └ html | string | optional |
| └ text | string | optional |
| └ enable | boolean | optional |
| └ sandbox_mode | object | optional |
| └ enable | boolean | optional |
| └ bypass_list_management | object | optional |
| └ enable | boolean | optional |
| └ bypass_spam_management | object | optional |
| └ enable | boolean | optional |
| └ bypass_bounce_management | object | optional |
| └ enable | boolean | optional |
| └ bypass_unsubscribe_management | object | optional |
| └ enable | boolean | optional |
| reply_to_list | array | optional |
| └ name | string | optional |
| string | required | |
| personalizations | array | required |
| └ cc | array | optional |
| └ name | string | optional |
| string | required | |
| └ to | array | required |
| └ name | string | optional |
| string | required | |
| └ bcc | array | optional |
| └ name | string | optional |
| string | required | |
| └ from | object | optional |
| └ name | string | optional |
| string | required | |
| └ headers | object | optional |
| └ send_at | integer | optional |
| └ subject | string | optional |
| └ custom_args | object | optional |
| └ substitutions | object | optional |
| └ dynamic_template_data | object | optional |
| tracking_settings | object | optional |
| └ ganalytics | object | optional |
| └ enable | boolean | optional |
| └ utm_term | string | optional |
| └ utm_medium | string | optional |
| └ utm_source | string | optional |
| └ utm_content | string | optional |
| └ utm_campaign | string | optional |
| └ open_tracking | object | optional |
| └ enable | boolean | optional |
| └ substitution_tag | string | optional |
| └ click_tracking | object | optional |
| └ enable | boolean | optional |
| └ enable_text | boolean | optional |
| └ subscription_tracking | object | optional |
| └ html | string | optional |
| └ text | string | optional |
| └ enable | boolean | optional |
| └ substitution_tag | string | optional |
POST /mail/send
/whitelabel/ips
This endpoint allows you to set up reverse DNS.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
ReverseDnsSetUpReverseDnsRequest
| Property | Type | Required |
|---|---|---|
| ip | string | required |
| domain | string | required |
| subdomain | string | optional |
POST /whitelabel/ips
/whitelabel/ips/{id}/validate
This endpoint allows you to validate a reverse DNS record.
Always check the valid property of the response’s validation_results.a_record object. This field will indicate whether it was possible to validate the reverse DNS record. If the validation_results.a_record.valid is false, this indicates only that Twilio SendGrid could not determine the validity your reverse DNS record — it may still be valid.
If validity couldn’t be determined, you can check the value of validation_results.a_record.reason to find out why.
You can retrieve the IDs associated with all your reverse DNS records using the “Retrieve all reverse DNS records” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | The ID of the reverse DNS record that you would like to validate. |
| on-behalf-of | header | optional | string | — |
Unexpected error in API call. See HTTP response body for details.
POST /whitelabel/ips/{id}/validate
/marketing/segments
This endpoint allows you to create a segment.
application/json
SegmentingContactsCreateNewSegmentRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| query_dsl | string | required |
| parent_list_ids | array | optional |
| parent_list_id | string | optional |
POST /marketing/segments
/marketing/segments/delete
This endpoint allows you to delete segments in bulk.
If the segments are used by automations or the segments do not exist in the database, the segment IDs that could not be deleted along with automation IDs that are associated to those segments will be returned.
application/json
SegmentingContactsBulkDeleteSegmentsRequest
| Property | Type | Required |
|---|---|---|
| ids | array | optional |
POST /marketing/segments/delete
/marketing/segments/2.0
The Segmentation V2 API is currently in private beta. If you’d like to be added to the beta, please fill out this form
Segment name has to be unique. A user can not create a new segment with an existing segment name.
application/json
segment_write_v2
| Property | Type | Required |
|---|---|---|
| name | string | required |
| query_dsl | string | required |
| parent_list_ids | array | optional |
POST /marketing/segments/2.0
/marketing/test/send_email
This endpoint allows you to send a test marketing email to a list of email addresses.
Before sending a marketing message, you can test it using this endpoint. You may specify up to 10 contacts in the emails request body field. You must also specify a template_id and include either a from_address or sender_id. You can manage your templates with the Twilio SendGrid App or the Transactional Templates API.
Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered.
For more information about managing Dynamic Transactional Templates, see How to Send Email with Dynamic Transactional Templates.
You can also test your Single Sends in the Twilio SendGrid Marketing Campaigns UI.
application/json
SendTestEmailToContactsRequest
| Property | Type | Required |
|---|---|---|
| emails | array | required |
| sender_id | integer | optional |
| template_id | string | required |
| from_address | string | optional |
| version_id_override | string | optional |
| suppression_group_id | integer | optional |
| custom_unsubscribe_url | string | optional |
POST /marketing/test/send_email
/senders
This endpoint allows you to create a new sender identity.
You may create up to 100 unique sender identities.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
PostSendersRequest
| Property | Type | Required |
|---|---|---|
| zip | string | optional |
| city | string | required |
| from | object | optional |
| state | string | optional |
| address | string | required |
| country | string | required |
| nickname | string | required |
| reply_to | object | optional |
| address_2 | string | optional |
POST /senders
/senders/{sender_id}/resend_verification
This enpdoint allows you to resend a sender identity verification email.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| sender_id | path | required | integer | The ID of the sender identity for which you would like to resend a verification email. |
| on-behalf-of | header | optional | string | — |
POST /senders/{sender_id}/resend_verification
/verified_senders
This endpoint allows you to create a new Sender Identify.
Upon successful submission of a POST request to this endpoint, an identity will be created, and a verification email will be sent to the address assigned to the from_email field. You must complete the verification process using the sent email to fully verify the sender.
If you need to resend the verification email, you can do so with the Resend Verified Sender Request, /resend/{id}, endpoint.
If you need to authenticate a domain rather than a Single Sender, see the Domain Authentication API.
application/json
verified-sender-request-schema
| Property | Type | Required |
|---|---|---|
| zip | string | optional |
| city | string | optional |
| state | string | optional |
| address | string | optional |
| country | string | optional |
| address2 | string | optional |
| nickname | string | required |
| reply_to | string | required |
| from_name | string | optional |
| from_email | string | required |
| reply_to_name | string | optional |
POST /verified_senders
/verified_senders/resend/{id}
This endpoint allows you to resend a verification email to a specified Sender Identity.
Passing the id assigned to a Sender Identity to this endpoint will resend a verification email to the from_address associated with the Sender Identity. This can be useful if someone loses their verification email or needs to have it resent for any other reason.
You can retrieve the IDs associated with Sender Identities by passing a “Get All Verified Senders” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | — |
POST /verified_senders/resend/{id}
/marketing/senders
This endpoint allows you to create a new sender identity.
You may create up to 100 unique sender identities.
Sender identities are required to be verified before use. If your domain has been authenticated, a new sender identity will auto verify on creation. Otherwise an email will be sent to the from.email.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
SendersCreateIdentityRequest
| Property | Type | Required |
|---|---|---|
| zip | string | optional |
| city | string | required |
| from | object | required |
| └ name | string | required |
| string | required | |
| state | string | optional |
| address | string | required |
| country | string | required |
| nickname | string | required |
| reply_to | object | optional |
| └ name | string | optional |
| string | required | |
| address_2 | string | optional |
POST /marketing/senders
/user/webhooks/parse/settings
This endpoint allows you to create a new inbound parse setting.
Creating an Inbound Parse setting requires two pieces of information: a url and a hostname.
The hostname must correspond to a domain authenticated by Twilio SendGrid on your account. If you need to complete domain authentication, you can use the Twilio SendGrid App or the “Authenticate a domain” endpoint. See “How to Set Up Domain Authentication” for instructions.
Any email received by the hostname will be parsed when you complete this setup. You must also add a Twilio SendGrid MX record to this domain’s DNS records. See “Setting up the Inbound Parse Webhook” for full instructions.
The url represents a location where the parsed message data will be delivered. Twilio SendGrid will make an HTTP POST request to this url with the message data. The url must be publicly reachable, and your application must return a 200 status code to signal that the message data has been received.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
parse-setting
| Property | Type | Required |
|---|---|---|
| url | string | optional |
| hostname | string | optional |
| send_raw | boolean | optional |
| spam_check | boolean | optional |
POST /user/webhooks/parse/settings
/marketing/singlesends
This endpoint allows you to create a new Single Send.
Please note that if you are migrating from the previous version of Single Sends, you no longer need to pass a template ID with your request to this endpoint. Instead, you will pass all template data in the email_config object.
application/json
singlesend_request
| Property | Type | Required |
|---|---|---|
| name | string | required |
| send_at | string | optional |
| send_to | object | optional |
| └ all | boolean | optional |
| └ list_ids | array | optional |
| └ segment_ids | array | optional |
| categories | array | optional |
| email_config | object | optional |
| └ editor | string | optional |
| └ ip_pool | string | optional |
| └ subject | string | optional |
| └ design_id | string | optional |
| └ sender_id | integer | optional |
| └ html_content | string | optional |
| └ plain_content | string | optional |
| └ suppression_group_id | integer | optional |
| └ custom_unsubscribe_url | string | optional |
| └ generate_plain_content | boolean | optional |
POST /marketing/singlesends
/marketing/singlesends/search
This endpoint allows you to search for Single Sends based on specified criteria.
You can search for Single Sends by passing a combination of values using the name, status, and categories request body fields.
For example, if you want to search for all Single Sends that are “drafts” or “scheduled” and also associated with the category “shoes,” your request body may look like the example below.
{
"status": [
"draft",
"scheduled"
],
"categories": [
"shoes"
],
}
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| page_size | query | optional | integer | — |
| page_token | query | optional | string | — |
application/json
singlesend_search
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| status | array | optional |
| categories | array | optional |
POST /marketing/singlesends/search
/marketing/singlesends/{id}
This endpoint allows you to duplicate an existing Single Send using its Single Send ID.
Duplicating a Single Send is useful when you want to create a Single Send but don’t want to start from scratch. Once duplicated, you can update or edit the Single Send by making a PATCH request to the /marketing/singlesends/{id} endpoint.
If you leave the name field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text “Copy of ” prepended to it. The name field length is limited to 100 characters, so the end of the new Single Send name, including “Copy of ”, will be trimmed if the name exceeds this limit.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | string | — |
application/json
SingleSendsDuplicateSingleSendRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
POST /marketing/singlesends/{id}
/sso/integrations
This endpoint allows you to create an SSO integration.
application/json
create-integration-request
| Property | Type | Required |
|---|---|---|
| name | string | required |
| enabled | boolean | required |
| entity_id | string | required |
| signin_url | string | required |
| signout_url | string | required |
| completed_integration | boolean | optional |
POST /sso/integrations
/sso/teammates
This endpoint allows you to create an SSO Teammate.
The email provided for this user will also function as the Teammate’s username.
application/json
sso-teammate-request
| Property | Type | Required |
|---|---|---|
| string | required | |
| is_admin | boolean | optional |
| last_name | string | required |
| first_name | string | required |
| is_read_only | boolean | optional |
| scopes | array | required |
POST /sso/teammates
/subusers/{subuser_name}/monitor
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| subuser_name | path | required | string | The name of the subuser for which to retrieve monitor settings. |
application/json
monitor
| Property | Type | Required |
|---|---|---|
| string | required | |
| frequency | number | required |
POST /subusers/{subuser_name}/monitor
/subusers
This endpoint allows you to create a new subuser.
application/json
PostSubusersRequest
| Property | Type | Required |
|---|---|---|
| ips | array | required |
| string | required | |
| password | string | required |
| username | string | required |
POST /subusers
/asm/suppressions/global
This endpoint allows you to add one or more email addresses to the global suppressions group.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
suppressions-request
| Property | Type | Required |
|---|---|---|
| recipient_emails | array | required |
POST /asm/suppressions/global
/asm/groups/{group_id}/suppressions
This endpoint allows you to add email addresses to an unsubscribe group.
If you attempt to add suppressions to a group that has been deleted or does not exist, the suppressions will be added to the global suppressions list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| group_id | path | required | string | The id of the unsubscribe group that you are adding suppressions to. |
| on-behalf-of | header | optional | string | — |
application/json
suppressions-request
| Property | Type | Required |
|---|---|---|
| recipient_emails | array | required |
POST /asm/groups/{group_id}/suppressions
/asm/groups/{group_id}/suppressions/search
This endpoint allows you to search a suppression group for multiple suppressions.
When given a list of email addresses and a group ID, this endpoint will only return the email addresses that have been unsubscribed from the given group.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| group_id | path | required | string | The ID of the suppression group that you would like to search. |
| on-behalf-of | header | optional | string | — |
application/json
suppressions-request
| Property | Type | Required |
|---|---|---|
| recipient_emails | array | required |
POST /asm/groups/{group_id}/suppressions/search
/asm/groups
This endpoint allows you to create a new suppression group.
To add an email address to the suppression group, create a Suppression.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
suppression-group-request-base
| Property | Type | Required |
|---|---|---|
| name | string | optional |
| is_default | boolean | optional |
| description | string | optional |
POST /asm/groups
/teammates
This endpoint allows you to invite a Teammate to your account via email.
You can set a Teammate’s initial permissions using the scopes array in the request body. Teammate’s will receive a minimum set of scopes from Twilio SendGrid that are necessary for the Teammate to function.
Note: A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
TeammatesInviteTeammateRequest
| Property | Type | Required |
|---|---|---|
| string | required | |
| scopes | array | required |
| is_admin | boolean | required |
POST /teammates
/teammates/pending/{token}/resend
This endpoint allows you to resend a Teammate invitation.
Teammate invitations will expire after 7 days. Resending an invitation will reset the expiration date.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| token | path | required | string | The token for the invite that you want to resend. |
| on-behalf-of | header | optional | string | — |
POST /teammates/pending/{token}/resend
/templates
This endpoint allows you to create a transactional template.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
PostTemplatesRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| generation | string | optional |
POST /templates
/templates/{template_id}
This endpoint allows you to duplicate a transactional template.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| template_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
application/json
TransactionalTemplatesDuplicateTemplateRequest
| Property | Type | Required |
|---|---|---|
| name | string | optional |
POST /templates/{template_id}
/templates/{template_id}/versions
This endpoint allows you to create a new version of a template.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| template_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
application/json
transactional_template_version_create
| Property | Type | Required |
|---|---|---|
| name | string | required |
| active | integer | optional |
| editor | string | optional |
| subject | string | required |
| test_data | string | optional |
| html_content | string | optional |
| plain_content | string | optional |
| generate_plain_content | boolean | optional |
POST /templates/{template_id}/versions
/templates/{template_id}/versions/{version_id}/activate
This endpoint allows you to activate a version of one of your templates.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| template_id | path | required | string | The ID of the original template |
| version_id | path | required | string | The ID of the template version |
| on-behalf-of | header | optional | string | — |
POST /templates/{template_id}/versions/{version_id}/activate
/user/webhooks/event/test
This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.
SendGrid’s 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.
Tip: Retry logic for this endpoint differs from other endpoints, which use a rolling 24-hour retry.
If your web server does not return a 2xx response type, we will retry a POST request until we receive a 2xx response or the maximum time of 10 minutes has expired.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
WebhooksTestEventNotificationSettingsRequest
| Property | Type | Required |
|---|---|---|
| url | string | optional |
| oauth_client_id | string | optional |
| oauth_token_url | string | optional |
| oauth_client_secret | string | optional |
POST /user/webhooks/event/test
AlertsDeleteAlertByIdResponse
{
"type": "object",
"properties": {}
}
AlertsGetSpecificAlertResponse
{
"type": "object",
"required": [
"created_at",
"email_to",
"id",
"type",
"updated_at"
],
"properties": {
"id": {
"type": "integer",
"description": "The ID of the alert."
},
"type": {
"enum": [
"usage_alert",
"stats_notification"
],
"type": "string",
"description": "The type of alert."
},
"email_to": {
"type": "string",
"description": "The email address that the alert will be sent to."
},
"frequency": {
"type": "string",
"description": "If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\"."
},
"created_at": {
"type": "integer",
"description": "A Unix timestamp indicating when the alert was created."
},
"percentage": {
"type": "integer",
"description": "If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent."
},
"updated_at": {
"type": "integer",
"description": "A Unix timestamp indicating when the alert was last modified."
}
}
}
AlertsUpdateAlertRequest
{
"type": "object",
"example": {
"email_to": "example@example.com"
},
"properties": {
"email_to": {
"type": "string",
"description": "The new email address you want your alert to be sent to.\nExample: test@example.com"
},
"frequency": {
"type": "string",
"description": "The new frequency at which to send the stats_notification alert.\nExample: monthly"
},
"percentage": {
"type": "integer",
"description": "The new percentage threshold at which the usage_limit alert will be sent.\nExample: 90"
}
}
}
AlertsUpdateAlertResponse
{
"type": "object",
"required": [
"created_at",
"email_to",
"id",
"type",
"updated_at"
],
"properties": {
"id": {
"type": "integer",
"description": "The ID of the alert."
},
"type": {
"enum": [
"usage_alert",
"stats_notification"
],
"type": "string",
"description": "The type of alert."
},
"email_to": {
"type": "string",
"description": "The email address that the alert will be sent to."
},
"frequency": {
"type": "string",
"description": "If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\"."
},
"created_at": {
"type": "integer",
"description": "A Unix timestamp indicating when the alert was created."
},
"percentage": {
"type": "integer",
"description": "If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent."
},
"updated_at": {
"type": "integer",
"description": "A Unix timestamp indicating when the alert was last modified."
}
}
}
ApiKeysCreateKeyRequest
{
"type": "object",
"example": {
"name": "My API Key",
"scopes": [
"mail.send",
"alerts.create",
"alerts.read"
]
},
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name you will use to describe this API Key."
},
"scopes": {
"type": "array",
"items": {
"type": "string"
},
"description": "The individual permissions that you are giving to this API Key."
}
}
}
ApiKeysCreateKeyResponse
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
},
"api_key": {
"type": "string"
},
"api_key_id": {
"type": "string"
}
}
}
ApiKeysGetAllResponse
{
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/api_key_name_id"
}
}
}
}
ApiKeysGetByKeyIdResponse
{
"type": "object",
"properties": {
"result": {
"type": "array",
"items": {
"$ref": "#/components/schemas/api_key_name_id_scopes"
}
}
}
}
ApiKeysUpdateKeyNameRequest
{
"type": "object",
"example": {
"name": "A New Hope"
},
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The new name of the API Key."
}
}
}
ApiKeysUpdateNameAndScopesRequest
{
"type": "object",
"example": {
"name": "Profiles key",
"scopes": [
"user.profile.read",
"user.profile.update"
]
},
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
BlocksApiDeleteAllBlockedEmailsRequest
{
"type": "object",
"example": {
"emails": [
"example1@example.com",
"example2@example.com"
],
"delete_all": false
},
"properties": {
"emails": {
"type": "array",
"items": {
"type": "string"
},
"description": "The specific blocked email addresses that you want to delete."
},
"delete_all": {
"type": "boolean",
"description": "Indicates if you want to delete all blocked email addresses."
}
}
}
BlocksApiDeleteAllBlockedEmailsResponse
{
"type": "object",
"properties": {}
}
BlocksApiDeleteSpecificBlockResponse
{
"type": "object",
"properties": {}
}
BouncesApiDeleteBouncesRequest
{
"type": "object",
"example": {
"emails": [
"example@example.com",
"example2@example.com"
],
"delete_all": false
},
"properties": {
"emails": {
"type": "array",
"items": {
"type": "string"
},
"description": "Delete multiple emails from your bounce list at the same time. This should not be used with the delete_all parameter."
},
"delete_all": {
"type": "boolean",
"description": "This parameter allows you to delete **every** email in your bounce list. This should not be used with the emails parameter."
}
}
}
BouncesApiDeleteBouncesResponse
{
"type": "object",
"example": {},
"properties": {}
}
BouncesApiGetAllBouncesResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/bounce_response"
}
}
BouncesApiGetByEmailAddressResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/bounce_response"
}
}
BouncesApiRemoveBounceResponse
{
"type": "object",
"example": {},
"properties": {}
}
CampaignsApiDeleteCampaignById401Response
{
"type": "object",
"example": {
"errors": [
{
"field": null,
"message": "authorization required"
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"nullable": true,
"x-konfig-null-placeholder": true
},
"message": {
"type": "string",
"example": "authorization required"
}
}
}
}
}
}
CampaignsApiDeleteCampaignById404Response
{
"type": "object",
"example": {},
"properties": {}
}
CampaignsApiDeleteCampaignByIdResponse
{
"type": "object",
"example": {},
"properties": {}
}
CampaignsApiGetScheduledTimeResponse
{
"type": "object",
"title": "View Scheduled Time of a Campaign response",
"required": [
"send_at"
],
"properties": {
"send_at": {
"type": "integer",
"format": "int64"
}
}
}
CampaignsApiGetSingleCampaign401Response
{
"type": "object",
"example": {
"errors": [
{
"field": null,
"message": "authorization required"
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"nullable": true,
"x-konfig-null-placeholder": true
},
"message": {
"type": "string",
"example": "authorization required"
}
}
}
}
}
}
CampaignsApiGetSingleCampaign404Response
{
"type": "object",
"example": {
"errors": [
{
"field": null,
"message": "not found"
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"nullable": true,
"x-konfig-null-placeholder": true
},
"message": {
"type": "string",
"example": "not found"
}
}
}
}
}
}
CampaignsApiGetSingleCampaignResponse
{
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"title": {
"type": "string"
},
"status": {
"type": "string"
},
"ip_pool": {
"type": "string"
},
"subject": {
"type": "string"
},
"list_ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"sender_id": {
"type": "integer"
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
"segment_ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"html_content": {
"type": "string"
},
"plain_content": {
"type": "string"
},
"suppression_group_id": {
"type": "integer"
},
"custom_unsubscribe_url": {
"type": "string"
}
}
}
CampaignsApiScheduleCampaignRequest
{
"type": "object",
"title": "Schedule a Campaign request",
"example": {
"send_at": 1489771528
},
"required": [
"send_at"
],
"properties": {
"send_at": {
"type": "integer",
"description": "The unix timestamp for the date and time you would like your campaign to be sent out."
}
}
}
CampaignsApiScheduleCampaignResponse
{
"type": "object",
"title": "Schedule a Campaign response",
"required": [
"id",
"send_at",
"status"
],
"properties": {
"id": {
"type": "integer",
"description": "The campaign ID."
},
"status": {
"enum": [
"Scheduled"
],
"type": "string",
"description": "The status of your campaign."
},
"send_at": {
"type": "integer",
"description": "The date time you scheduled your campaign to be sent."
}
}
}
CampaignsApiSendCampaignNowResponse
{
"type": "object",
"title": "Send a Campaign response",
"required": [
"id",
"status"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"status": {
"type": "string"
}
}
}
CampaignsApiSendTestCampaignRequest
{
"type": "object",
"example": {
"to": "your.email@example.com"
},
"required": [
"to"
],
"properties": {
"to": {
"type": "string",
"format": "email",
"description": "The email address that should receive the test campaign."
}
}
}
CampaignsApiSendTestCampaignResponse
{
"type": "object",
"title": "Send a Test Campaign request",
"required": [
"to"
],
"properties": {
"to": {
"type": "string"
}
}
}
CampaignsApiUnscheduleCampaignResponse
{
"type": "object",
"example": {},
"properties": {}
}
CampaignsApiUpdateScheduledTimeRequest
{
"type": "object",
"title": "Update a Scheduled Campaign request",
"example": {
"send_at": 1489451436
},
"required": [
"send_at"
],
"properties": {
"send_at": {
"type": "integer",
"format": "int64"
}
}
}
CampaignsApiUpdateScheduledTimeResponse
{
"type": "object",
"title": "Update a Scheduled Campaign response",
"required": [
"id",
"send_at",
"status"
],
"properties": {
"id": {
"type": "integer",
"description": "The campaign ID"
},
"status": {
"type": "string",
"description": "The status of the schedule."
},
"send_at": {
"type": "integer",
"description": "The unix timestamp to send the campaign."
}
}
}
CampaignsApiUpdateSpecificCampaign403Response
{
"type": "object",
"example": {
"errors": [
{
"field": null,
"message": "You may only update a campaign when it is in draft mode."
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"nullable": true,
"x-konfig-null-placeholder": true
},
"message": {
"type": "string",
"example": "You may only update a campaign when it is in draft mode."
}
}
}
}
}
}
CampaignsApiUpdateSpecificCampaignRequest
{
"type": "object",
"title": "Update a Campaign request",
"example": {
"title": "May Newsletter",
"subject": "New Products for Summer!",
"categories": [
"summer line"
],
"html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
"plain_content": "Check out our summer line!"
},
"required": [
"title",
"subject",
"categories",
"html_content",
"plain_content"
],
"properties": {
"title": {
"type": "string",
"description": "The title of the campaign."
},
"subject": {
"type": "string",
"description": "The subject line for your campaign."
},
"categories": {
"type": "array",
"items": {
"type": "string"
},
"description": "The categories you want to tag on this campaign."
},
"html_content": {
"type": "string",
"description": "The HTML content of this campaign."
},
"plain_content": {
"type": "string",
"description": "The plain content of this campaign."
}
}
}
CampaignsApiUpdateSpecificCampaignResponse
{
"type": "object",
"example": {
"errors": [
{
"field": "title",
"message": "title can't be blank"
},
{
"field": "title",
"message": "title is too long (maximum is 100 characters)"
},
{
"field": "categories",
"message": "categories exceeds 10 category limit"
},
{
"field": "html_content",
"message": "html_content exceeds the 1MB limit"
},
{
"field": "plain_content",
"message": "plain_content exceeds the 1MB limit"
},
{
"field": "sender_id",
"message": "sender_id does not exist"
},
{
"field": "sender_id",
"message": "sender_id is not a verified sender identity"
},
{
"field": "list_ids",
"message": "list_ids do not all exist"
},
{
"field": "segment_ids",
"message": "segment_ids do not all exist"
},
{
"field": "ip_pool",
"message": "The ip pool you provided is invalid"
},
{
"field": "suppression_group_id",
"message": "suppression_group_id does not exist"
},
{
"field": "unsubscribes",
"message": "Either suppression_group_id or custom_unsubscribe_url may be set/used, but not both. Please remove one before setting the other."
},
{
"field": null,
"message": "The JSON you have submitted cannot be parsed."
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"example": "title",
"nullable": true
},
"message": {
"type": "string",
"example": "title can't be blank"
}
}
}
}
}
}
CancelScheduledSendsAllScheduledSendsResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/user_scheduled_send_status"
}
}
CancelScheduledSendsByBatchIdResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/user_scheduled_send_status"
},
"title": "Retrieve scheduled send response"
}
CancelScheduledSendsByBatchIdStatusRequest
{
"type": "object",
"title": "Cancel or pause a scheduled send request",
"example": {
"status": "pause",
"batch_id": "YOUR_BATCH_ID"
},
"required": [
"batch_id",
"status"
],
"properties": {
"status": {
"enum": [
"pause",
"cancel"
],
"type": "string",
"default": "pause",
"description": "The status of the send you would like to implement. This can be pause or cancel. To delete a pause or cancel status see DELETE /v3/user/scheduled_sends/{batch_id}"
},
"batch_id": {
"type": "string",
"pattern": "^[a-zA-Z0-9]",
"description": "The batch ID is the identifier that your scheduled mail sends share."
}
}
}
CancelScheduledSendsRequestResponse
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"help": {
"type": "object"
},
"field": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
}
CancelScheduledSendsUpdateStatusRequest
{
"type": "object",
"example": {
"status": "pause"
},
"required": [
"status"
],
"properties": {
"status": {
"enum": [
"cancel",
"pause"
],
"type": "string",
"description": "The status you would like the scheduled send to have."
}
}
}
CancelScheduledSendsUpdateStatusResponse
{
"type": "object",
"example": {},
"properties": {}
}
CategoriesGetEmailStatisticsForResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/category_stats"
}
}
CertificatesCreateSsoCertificateRequest
{
"type": "object",
"example": {
"enabled": false,
"integration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312",
"public_certificate": "<your x509 certificate>"
},
"required": [
"public_certificate",
"integration_id"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Indicates if the certificate is enabled."
},
"integration_id": {
"type": "string",
"description": "An ID that matches a certificate to a specific IdP integration. This is the `id` returned by the \"Get All SSO Integrations\" endpoint."
},
"public_certificate": {
"type": "string",
"description": "This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes."
}
},
"description": ""
}
CertificatesGetByIdpConfigurationsResponse
{
"type": "array",
"items": {
"$ref": "#/components/schemas/sso-certificate-body"
}
}
CertificatesUpdateByIdRequest
{
"type": "object",
"example": {
"enabled": false,
"intergration_id": "b0b98502-9408-4b24-9e3d-31ed7cb15312",
"public_certificate": "<your x509 certificate>"
},
"properties": {
"enabled": {
"type": "boolean",
"description": "Indicates whether or not the certificate is enabled."
},
"integration_id": {
"type": "string",
"description": "An ID that matches a certificate to a specific IdP integration."
},
"public_certificate": {
"type": "string",
"description": "This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes."
}
}
}
ContactsApiCustomFieldsCreateNewFieldRequest
{
"type": "object",
"example": {
"name": "pet",
"type": "text"
},
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
ContactsApiCustomFieldsGetAllResponse
{
"type": "object",
"title": "List All Custom Fields response",
"required": [
"custom_fields"
],
"properties": {
"custom_fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/contactdb_custom_field_with_id"
}
}
}
}
ContactsApiCustomFieldsGetReservedFieldsResponse
{
"type": "object",
"properties": {
"reserved_fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
}
}
}
ContactsApiListsAddMultipleRecipientsToListRequest
{
"type": "array",
"items": {
"type": "integer"
},
"example": [
"recipient_id1",
"recipient_id2"
]
}
| Version | Endpoints | Schemas | Ingested | Status |
|---|---|---|---|---|
| 1.0.0 | 334 | 545 | 2026-05-11 | current |
| 1.0.0 | 334 | 545 | 2026-04-16 |