Email Activity (beta)

Email delivery and marketing service

sendgrid.com/docs ↗
Version
1.0.0
OpenAPI
3.0.0
Endpoints
334
Schemas
545
86
Quality
Updated
3 days ago
Email email marketing communications
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

http://api.sendgrid.com/v3

Endpoints

Clear filters

Apikeys 1 endpoints

POST /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.

operationId: ApiKeys_createKey

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema ApiKeysCreateKeyRequest
Property Type Required
name string required
scopes array optional

Responses

201
400
401
403
404
500
POST /api_keys

Alerts 1 endpoints

POST /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.

operationId: POST_alerts

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema PostAlertsRequest
Property Type Required
type string required
email_to string required
frequency string optional
percentage integer optional

Responses

201
400
POST /alerts

Csv(uionly) 1 endpoints

POST /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.

operationId: CsvUiOnly_requestCsvDownload

Parameters

Name In Required Type Description
query query optional string

Uses a SQL like syntax to indicate which messages to include in the CSV

Responses

202
400
429
500
POST /messages/download

Campaignsapi 4 endpoints

POST /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.

operationId: POST_campaigns

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema 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

Responses

201
400

“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.”

401
POST /campaigns
POST /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.

operationId: CampaignsApi_scheduleCampaign

Parameters

Name In Required Type Description
campaign_id path required integer
on-behalf-of header optional string

Request Body

application/json
schema CampaignsApiScheduleCampaignRequest
Property Type Required
send_at integer required

Responses

201
400

“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”

401
403

””: “You cannot POST to a campaign that has already sent or scheduled. However you can update a scheduled campaign with a PATCH.”

404

””: “not found”

POST /campaigns/{campaign_id}/schedules
POST /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.

operationId: CampaignsApi_sendCampaignNow

Parameters

Name In Required Type Description
campaign_id path required integer
on-behalf-of header optional string

Responses

201
400

“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”

401
403

””: “You may only send a campaign when it is in draft mode.”

404

””: “not found”

POST /campaigns/{campaign_id}/schedules/now
POST /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”]

operationId: CampaignsApi_sendTestCampaign

Parameters

Name In Required Type Description
campaign_id path required integer
on-behalf-of header optional string

Request Body

application/json
schema CampaignsApiSendTestCampaignRequest
Property Type Required
to string required

Responses

204
400

””: “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.”

404

””: “not found”

POST /campaigns/{campaign_id}/schedules/test

Cancelscheduledsends 2 endpoints

POST /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.

operationId: CancelScheduledSends_request

Parameters

Name In Required Type Description
on-behalf-of header optional string

Responses

201
400
401
403
404
500
POST /mail/batch
POST /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.

operationId: CancelScheduledSends_byBatchIdStatus

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema CancelScheduledSendsByBatchIdStatusRequest
Property Type Required
status string required
batch_id string required

Responses

201
400
401
403
404
500
POST /user/scheduled_sends

Certificates 1 endpoints

POST /sso/certificates

This endpoint allows you to create an SSO certificate.

operationId: Certificates_createSSOCertificate

Request Body

application/json
schema CertificatesCreateSsoCertificateRequest
Property Type Required
enabled boolean optional
integration_id string required
public_certificate string required

Responses

200
400
401
403
429
500
POST /sso/certificates

Contacts 4 endpoints

POST /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.

operationId: Contacts_getBatchedByIds

Request Body

application/json
schema ContactsGetBatchedByIdsRequest
Property Type Required
ids array required

Responses

200
401
403
404
500
POST /marketing/contacts/batch
POST /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.

operationId: Contacts_exportListsSegments

Request Body

application/json
schema ContactsExportListsSegmentsRequest
Property Type Required
list_ids array optional
file_type string optional
segment_ids array optional
max_file_size integer optional
notifications object optional
email boolean optional

Responses

202
400
401
403
404
500
POST /marketing/contacts/exports
POST /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.

operationId: Contacts_searchContactsByQuery

Request Body

application/json
schema ContactsSearchContactsByQueryRequest
Property Type Required
query string required

Responses

200
400
401
403
404
408
500
POST /marketing/contacts/search
POST /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.

operationId: Contacts_searchByEmails

Request Body

application/json
schema ContactsSearchByEmailsRequest
Property Type Required
emails array required

Responses

200
400
401
403
404
500
POST /marketing/contacts/search/emails

Contactsapicustomfields 1 endpoints

POST /contactdb/custom_fields

This endpoint allows you to create a custom field.

You can create up to 120 custom fields.

operationId: ContactsApiCustomFields_createNewField

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema ContactsApiCustomFieldsCreateNewFieldRequest
Property Type Required
name string optional
type string optional

Responses

201
400

”” : “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

Contactsapilists 3 endpoints

POST /contactdb/lists

This endpoint allows you to create a list for your recipients.

operationId: ContactsApiLists_createNewList

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema ContactsApiListsCreateNewListRequest
Property Type Required
name string required

Responses

201
400

“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”

401
POST /contactdb/lists
POST /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.

operationId: ContactsApiLists_addMultipleRecipientsToList

Parameters

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

Request Body

application/json
schema ContactsApiListsAddMultipleRecipientsToListRequest
array of integer

Responses

201
400

“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”

401
404

“list_id”: “Returned if list_id does not exist”

POST /contactdb/lists/{list_id}/recipients
POST /contactdb/lists/{list_id}/recipients/{recipient_id}

This endpoint allows you to add a single recipient to a list.

operationId: ContactsApiLists_addSingleRecipient

Parameters

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

Responses

201
400

“list_id” : “Returned if list_id is invalid”
“recipient_id” : “Returned if recipient_id is invalid”

401
404

“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}

Contactsapirecipients 2 endpoints

POST /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.

operationId: ContactsApiRecipients_addRecipient

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema ContactsApiRecipientsAddRecipientRequest
array of object
Property Type Required
age integer optional
email string required
last_name string optional
first_name string optional

Responses

201
400

”” : “Returned if request body is not valid json”

401
POST /contactdb/recipients
POST /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.

  • Dates:
    • "eq", "ne", "lt" (before), "gt" (after)
      • You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
    • "empty", "not_empty"
    • "is within"
  • Text: "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value), "empty", "not_empty"
  • Numbers: "eq", "lt", "gt", "empty", "not_empty"
  • Email Clicks and Opens: "eq" (opened), "ne" (not opened)

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".

operationId: ContactsApiRecipients_searchBySegmentConditions

Request Body

application/json
schema ContactsApiRecipientsSearchBySegmentConditionsRequest
Property Type Required
list_id integer required
conditions array required

Responses

200
400
POST /contactdb/recipients/search

Contactsapisegments 1 endpoints

POST /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

  • “eq”, “ne”, “lt” (before), “gt” (after)
    • You may use MM/DD/YYYY for day granularity or an epoch for second granularity.
  • “empty”, “not_empty”
  • “is within”

Text

  • “contains”
  • “eq” (is/equals - matches the full field)
  • “ne” (is not/not equals - matches any field where the entire field is not the condition value)
  • “empty”
  • “not_empty”

Numbers

  • “eq” (is/equals)
  • “lt” (is less than)
  • “gt” (is greater than)
  • “empty”
  • “not_empty”

Email Clicks and Opens

  • “eq” (opened)
  • “ne” (not opened)

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”.

operationId: ContactsApiSegments_createSegment

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema 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

Responses

200
400

“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”

401
POST /contactdb/segments

Customfields 1 endpoints

POST /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.

operationId: CustomFields_createDefinition

Request Body

application/json
schema CustomFieldsCreateDefinitionRequest
Property Type Required
name string required
field_type string required

Responses

200
400
POST /marketing/field_definitions

Designsapi 3 endpoints

POST /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.

operationId: DesignsApi_createDesign

Request Body

application/json
schema 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

Responses

201
400
POST /designs
POST /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.

operationId: DesignsApi_duplicatePreBuiltDesign

Parameters

Name In Required Type Description
id path required string

The ID of the pre-built Design you want to duplicate.

Request Body

application/json
schema design-duplicate-input
Property Type Required
name string optional
editor string optional

Responses

200
400
404
POST /designs/pre-builts/{id}
POST /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.

operationId: DesignsApi_duplicateDesign

Parameters

Name In Required Type Description
id path required string

The ID of the Design you want to duplicate.

Request Body

application/json
schema design-duplicate-input
Property Type Required
name string optional
editor string optional

Responses

201
400
404
POST /designs/{id}

Domainauthentication 4 endpoints

POST /whitelabel/domains

This endpoint allows you to authenticate a domain.

If you are authenticating a domain for a subuser, you have two options:

  1. Use the “username” parameter. This allows you to authenticate a domain on behalf of your subuser. This means the subuser is able to see and modify the authenticated domain.
  2. Use the Association workflow (see Associate Domain section). This allows you to authenticate a domain created by the parent to a subuser. This means the subuser will default to the assigned domain, but will not be able to see or modify that authenticated domain. However, if the subuser authenticates their own domain it will overwrite the assigned domain.
operationId: DomainAuthentication_postAuthenticateDomain

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema 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

Responses

201
POST /whitelabel/domains
POST /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.

operationId: DomainAuthentication_associateSubuserWithDomain

Parameters

Name In Required Type Description
domain_id path required integer

ID of the authenticated domain to associate with the subuser

Request Body

application/json
schema DomainAuthenticationAssociateSubuserWithDomainRequest
Property Type Required
username string required

Responses

201
POST /whitelabel/domains/{domain_id}/subuser
POST /whitelabel/domains/{id}/ips

This endpoint allows you to add an IP address to an authenticated domain.

operationId: DomainAuthentication_addIpToDomain

Parameters

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

Request Body

application/json
schema DomainAuthenticationAddIpToDomainRequest
Property Type Required
ip string required

Responses

200
POST /whitelabel/domains/{id}/ips
POST /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.

operationId: DomainAuthentication_validateDomain

Parameters

Name In Required Type Description
id path required integer

ID of the domain to validate.

on-behalf-of header optional string

Responses

200
500
POST /whitelabel/domains/{id}/validate

Emailaddressvalidation 1 endpoints

POST /validations/email

This endpoint allows you to validate an email address.

operationId: EmailAddressValidation_checkValidity

Request Body

application/json
schema EmailAddressValidationCheckValidityRequest
Property Type Required
email string required
source string optional

Responses

200
POST /validations/email

Emailcnamerecords 1 endpoints

POST /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.

operationId: EmailCnameRecords_sendDnsEmail

Request Body

application/json
schema EmailCnameRecordsSendDnsEmailRequest
Property Type Required
email string required
link_id integer required
message string optional
domain_id integer required

Responses

204
400
POST /whitelabel/dns/email

Ipaccessmanagement 1 endpoints

POST /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.

operationId: IpAccessManagement_addAllowedIps

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema IpAccessManagementAddAllowedIpsRequest
Property Type Required
ips array required
ip string required

Responses

201
401
403
404
500
POST /access_settings/whitelist

Ipaddresses 1 endpoints

POST /ips

This endpoint is for adding a(n) IP Address(es) to your account.

operationId: POST_ips

Request Body

application/json
schema PostIpsRequest
Property Type Required
count integer required
warmup boolean optional
subusers array optional

Responses

201
400
POST /ips

Ippools 2 endpoints

POST /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:

  1. Log into your SendGrid account.
  2. Navigate to Settings and then select IP Addresses.
  3. Find the IP address you want to activate and then click Edit.
  4. Check Allow my account to send mail using this IP address.
  5. Click Save.
operationId: IpPools_createPool

Request Body

application/json
schema IpPoolsCreatePoolRequest
Property Type Required
name string required

Responses

200
POST /ips/pools
POST /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:

  1. Log into your SendGrid account.
  2. Navigate to Settings and then select IP Addresses.
  3. Find the IP address you want to activate and then click Edit.
  4. Check Allow my account to send mail using this IP address.
  5. Click Save.

You can retrieve all of your available IP addresses from the “Retrieve all IP addresses” endpoint.

operationId: IpPools_addIpAddressToPool

Parameters

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”).

Request Body

application/json
schema IpPoolsAddIpAddressToPoolRequest
Property Type Required
ip string optional

Responses

201
404
POST /ips/pools/{pool_name}/ips

Ipwarmup 1 endpoints

POST /ips/warmup

This endpoint allows you to put an IP address into warmup mode.

operationId: IpWarmup_startIpAddressWarmup

Request Body

application/json
schema IpWarmupStartIpAddressWarmupRequest
Property Type Required
ip string optional

Responses

200
404
POST /ips/warmup

Linkbranding 3 endpoints

POST /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.

operationId: LinkBranding_createBrandedLink

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema LinkBrandingCreateBrandedLinkRequest
Property Type Required
domain string required
default boolean optional
subdomain string optional

Responses

201
POST /whitelabel/links
POST /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.

operationId: LinkBranding_validateBrandedLink

Parameters

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

Responses

200
500
POST /whitelabel/links/{id}/validate
POST /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.

operationId: LinkBranding_associateBrandedLinkWithSubuser

Parameters

Name In Required Type Description
link_id path required integer

The ID of the branded link you want to associate.

Request Body

application/json
schema LinkBrandingAssociateBrandedLinkWithSubuserRequest
Property Type Required
username string optional

Responses

200
POST /whitelabel/links/{link_id}/subuser

Lists 1 endpoints

POST /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.

operationId: Lists_createNewList

Request Body

application/json
schema ListsCreateNewListRequest
Property Type Required
name string required

Responses

200
400
POST /marketing/lists

Mailsend 1 endpoints

POST /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.

Helper Libraries

Twilio SendGrid provides libraries to help you quickly and easily integrate with the v3 Web API in 7 different languages:

Dynamic Transactional Templates and Handlebars

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

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:

  1. Add a Content-Encoding header, with a value of gzip.
    a. Content-Encoding: gzip
  2. Send the gzip as a data-binary.
    a. --data-binary '@data.json.gz'

Multiple Reply-To Emails

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.

Usage Considerations

  • reply_to is mutually exclusive with reply_to_list. If both are used, then the API call will be rejected.
  • The reply_to_list object, when used, must at least have an email parameter and may also contain a name parameter.
  • Each email address in the reply_to_list should be unique.
  • There is a limit of 1000 reply_to_list emails per mail/send request.
  • In SMTP calls, we will omit any invalid emails.

Possible 400 Error Messages

  • reply_to is mutually exclusive with reply_to_list.
  • The reply_to_list object, when used, must at least have an email parameter and may also contain a name parameter.
  • Each email address in the reply_to_list should be unique.
  • There is a limit of X reply_to emails per mail/send request.
  • The reply_to_list email does not contain a valid address.
  • The reply_to_list email exceeds the maximum total length of X characters.
  • The reply_to_list email parameter is required.
operationId: MailSend_v3EmailSend

Request Body

application/json
schema MailSendV3EmailSendRequest
Property Type Required
asm object optional
group_id integer required
groups_to_display array optional
from object required
name string optional
email 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
email 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
email string required
personalizations array required
cc array optional
name string optional
email string required
to array required
name string optional
email string required
bcc array optional
name string optional
email string required
from object optional
name string optional
email 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

Responses

202
400
401
403
404
413
500
POST /mail/send

Reversedns 2 endpoints

POST /whitelabel/ips

This endpoint allows you to set up reverse DNS.

operationId: ReverseDns_setUpReverseDns

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema ReverseDnsSetUpReverseDnsRequest
Property Type Required
ip string required
domain string required
subdomain string optional

Responses

201
POST /whitelabel/ips
POST /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.

operationId: ReverseDns_validateRecord

Parameters

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

Responses

200
404

Unexpected error in API call. See HTTP response body for details.

500
POST /whitelabel/ips/{id}/validate

Segmentingcontacts 2 endpoints

POST /marketing/segments

This endpoint allows you to create a segment.

operationId: SegmentingContacts_createNewSegment

Request Body

application/json
schema SegmentingContactsCreateNewSegmentRequest
Property Type Required
name string required
query_dsl string required
parent_list_ids array optional
parent_list_id string optional

Responses

201
401
403
404
500
POST /marketing/segments
POST /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.

operationId: SegmentingContacts_bulkDeleteSegments

Request Body

application/json
schema SegmentingContactsBulkDeleteSegmentsRequest
Property Type Required
ids array optional

Responses

200
202
400
401
403
404
500
POST /marketing/segments/delete

Segmentingcontactsv2beta 1 endpoints

POST /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.

operationId: POST_segments

Request Body

application/json
schema segment_write_v2
Property Type Required
name string required
query_dsl string required
parent_list_ids array optional

Responses

201
400
404
429
500
POST /marketing/segments/2.0

Sendtestemail 1 endpoints

POST /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.

operationId: SendTestEmail_toContacts

Request Body

application/json
schema 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

Responses

202
400
POST /marketing/test/send_email

Senderidentitiesapi 2 endpoints

POST /senders

This endpoint allows you to create a new sender identity.

You may create up to 100 unique sender identities.

operationId: POST_senders

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema 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

Responses

201
400
POST /senders
POST /senders/{sender_id}/resend_verification

This enpdoint allows you to resend a sender identity verification email.

operationId: SenderIdentitiesApi_resendVerificationEmail

Parameters

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

Responses

204
400
404
POST /senders/{sender_id}/resend_verification

Senderverification 2 endpoints

POST /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.

operationId: SenderVerification_createVerifiedSenderRequest

Request Body

application/json
schema 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

Responses

201
400
401
403
404
500
POST /verified_senders
POST /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.

operationId: SenderVerification_resendVerificationEmail

Parameters

Name In Required Type Description
id path required string

Responses

204
400
401
403
404
500
POST /verified_senders/resend/{id}

Senders 1 endpoints

POST /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.

operationId: Senders_createIdentity

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema SendersCreateIdentityRequest
Property Type Required
zip string optional
city string required
from object required
name string required
email string required
state string optional
address string required
country string required
nickname string required
reply_to object optional
name string optional
email string required
address_2 string optional

Responses

201
401
403
404
500
POST /marketing/senders

Settingsinboundparse 1 endpoints

POST /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.

operationId: SettingsInboundParse_createSetting

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema parse-setting
Property Type Required
url string optional
hostname string optional
send_raw boolean optional
spam_check boolean optional

Responses

201
401
403
404
500
POST /user/webhooks/parse/settings

Singlesends 3 endpoints

POST /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.

operationId: SingleSends_createNewSingleSend

Request Body

application/json
schema 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

Responses

201
400
500
POST /marketing/singlesends
POST /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"
  ],
}
operationId: SingleSends_searchByCriteria

Parameters

Name In Required Type Description
page_size query optional integer
page_token query optional string

Request Body

application/json
schema singlesend_search
Property Type Required
name string optional
status array optional
categories array optional

Responses

200
404
POST /marketing/singlesends/search
POST /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.

operationId: SingleSends_duplicateSingleSend

Parameters

Name In Required Type Description
id path required string

Request Body

application/json
schema SingleSendsDuplicateSingleSendRequest
Property Type Required
name string optional

Responses

201
404
500
POST /marketing/singlesends/{id}

Singlesignonsettings 1 endpoints

POST /sso/integrations

This endpoint allows you to create an SSO integration.

operationId: SingleSignOnSettings_createIntegration

Request Body

application/json
schema 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

Responses

200
400
401
403
429
500
POST /sso/integrations

Singlesignonteammates 1 endpoints

POST /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.

operationId: SingleSignOnTeammates_createTeammate

Request Body

application/json
schema sso-teammate-request
Property Type Required
email string required
is_admin boolean optional
last_name string required
first_name string required
is_read_only boolean optional
scopes array required

Responses

201
400
401
403
429
500
POST /sso/teammates

Subusermonitorsettings 1 endpoints

POST /subusers/{subuser_name}/monitor
operationId: SubuserMonitorSettings_createSettings

Parameters

Name In Required Type Description
subuser_name path required string

The name of the subuser for which to retrieve monitor settings.

Request Body

application/json
schema monitor
Property Type Required
email string required
frequency number required

Responses

200
400
401
POST /subusers/{subuser_name}/monitor

Subusersapi 1 endpoints

POST /subusers

This endpoint allows you to create a new subuser.

operationId: POST_subusers

Request Body

application/json
schema PostSubusersRequest
Property Type Required
ips array required
email string required
password string required
username string required

Responses

200
400
401
403
500
POST /subusers

Suppressionsglobalsuppressions 1 endpoints

POST /asm/suppressions/global

This endpoint allows you to add one or more email addresses to the global suppressions group.

operationId: SuppressionsGlobalSuppressions_addRecipientAddresses

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema suppressions-request
Property Type Required
recipient_emails array required

Responses

201
POST /asm/suppressions/global

Suppressionssuppressions 2 endpoints

POST /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.

operationId: SuppressionsSuppressions_addToGroup

Parameters

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

Request Body

application/json
schema suppressions-request
Property Type Required
recipient_emails array required

Responses

201
POST /asm/groups/{group_id}/suppressions
POST /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.

operationId: SuppressionsSuppressions_searchWithinGroup

Parameters

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

Request Body

application/json
schema suppressions-request
Property Type Required
recipient_emails array required

Responses

200
POST /asm/groups/{group_id}/suppressions/search

Suppressionsunsubscribegroups 1 endpoints

POST /asm/groups

This endpoint allows you to create a new suppression group.

To add an email address to the suppression group, create a Suppression.

operationId: SuppressionsUnsubscribeGroups_createNewGroup

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema suppression-group-request-base
Property Type Required
name string optional
is_default boolean optional
description string optional

Responses

201
POST /asm/groups

Teammates 2 endpoints

POST /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.

operationId: Teammates_inviteTeammate

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema TeammatesInviteTeammateRequest
Property Type Required
email string required
scopes array required
is_admin boolean required

Responses

201
400
POST /teammates
POST /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.

operationId: Teammates_resendTeammateInvite

Parameters

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

Responses

200
404
POST /teammates/pending/{token}/resend

Transactionaltemplates 2 endpoints

POST /templates

This endpoint allows you to create a transactional template.

operationId: POST_templates

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema PostTemplatesRequest
Property Type Required
name string required
generation string optional

Responses

201
POST /templates
POST /templates/{template_id}

This endpoint allows you to duplicate a transactional template.

operationId: TransactionalTemplates_duplicateTemplate

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Request Body

application/json
schema TransactionalTemplatesDuplicateTemplateRequest
Property Type Required
name string optional

Responses

201
POST /templates/{template_id}

Transactionaltemplatesversions 2 endpoints

POST /templates/{template_id}/versions

This endpoint allows you to create a new version of a template.

operationId: TransactionalTemplatesVersions_createNewVersion

Parameters

Name In Required Type Description
template_id path required string
on-behalf-of header optional string

Request Body

application/json
schema 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

Responses

201
POST /templates/{template_id}/versions
POST /templates/{template_id}/versions/{version_id}/activate

This endpoint allows you to activate a version of one of your templates.

operationId: TransactionalTemplatesVersions_activateVersion

Parameters

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

Responses

200
POST /templates/{template_id}/versions/{version_id}/activate

Webhooks 1 endpoints

POST /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.

operationId: Webhooks_testEventNotificationSettings

Parameters

Name In Required Type Description
on-behalf-of header optional string

Request Body

application/json
schema WebhooksTestEventNotificationSettingsRequest
Property Type Required
url string optional
oauth_client_id string optional
oauth_token_url string optional
oauth_client_secret string optional

Responses

204
POST /user/webhooks/event/test

Schemas

object AlertsDeleteAlertByIdResponse
{
  "type": "object",
  "properties": {}
}
object 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."
    }
  }
}
object 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"
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object ApiKeysCreateKeyResponse
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "api_key": {
      "type": "string"
    },
    "api_key_id": {
      "type": "string"
    }
  }
}
object ApiKeysGetAllResponse
{
  "type": "object",
  "properties": {
    "result": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/api_key_name_id"
      }
    }
  }
}
object ApiKeysGetByKeyIdResponse
{
  "type": "object",
  "properties": {
    "result": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/api_key_name_id_scopes"
      }
    }
  }
}
object ApiKeysUpdateKeyNameRequest
{
  "type": "object",
  "example": {
    "name": "A New Hope"
  },
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The new name of the API Key."
    }
  }
}
object 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"
      }
    }
  }
}
object 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."
    }
  }
}
object BlocksApiDeleteAllBlockedEmailsResponse
{
  "type": "object",
  "properties": {}
}
object BlocksApiDeleteSpecificBlockResponse
{
  "type": "object",
  "properties": {}
}
object 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."
    }
  }
}
object BouncesApiDeleteBouncesResponse
{
  "type": "object",
  "example": {},
  "properties": {}
}
array BouncesApiGetAllBouncesResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/bounce_response"
  }
}
array BouncesApiGetByEmailAddressResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/bounce_response"
  }
}
object BouncesApiRemoveBounceResponse
{
  "type": "object",
  "example": {},
  "properties": {}
}
object 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"
          }
        }
      }
    }
  }
}
object CampaignsApiDeleteCampaignById404Response
{
  "type": "object",
  "example": {},
  "properties": {}
}
object CampaignsApiDeleteCampaignByIdResponse
{
  "type": "object",
  "example": {},
  "properties": {}
}
object CampaignsApiGetScheduledTimeResponse
{
  "type": "object",
  "title": "View Scheduled Time of a Campaign response",
  "required": [
    "send_at"
  ],
  "properties": {
    "send_at": {
      "type": "integer",
      "format": "int64"
    }
  }
}
object 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"
          }
        }
      }
    }
  }
}
object 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"
          }
        }
      }
    }
  }
}
object 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"
    }
  }
}
object 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."
    }
  }
}
object 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."
    }
  }
}
object CampaignsApiSendCampaignNowResponse
{
  "type": "object",
  "title": "Send a Campaign response",
  "required": [
    "id",
    "status"
  ],
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "status": {
      "type": "string"
    }
  }
}
object 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."
    }
  }
}
object CampaignsApiSendTestCampaignResponse
{
  "type": "object",
  "title": "Send a Test Campaign request",
  "required": [
    "to"
  ],
  "properties": {
    "to": {
      "type": "string"
    }
  }
}
object CampaignsApiUnscheduleCampaignResponse
{
  "type": "object",
  "example": {},
  "properties": {}
}
object CampaignsApiUpdateScheduledTimeRequest
{
  "type": "object",
  "title": "Update a Scheduled Campaign request",
  "example": {
    "send_at": 1489451436
  },
  "required": [
    "send_at"
  ],
  "properties": {
    "send_at": {
      "type": "integer",
      "format": "int64"
    }
  }
}
object 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."
    }
  }
}
object 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."
          }
        }
      }
    }
  }
}
object 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."
    }
  }
}
object 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"
          }
        }
      }
    }
  }
}
array CancelScheduledSendsAllScheduledSendsResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/user_scheduled_send_status"
  }
}
array CancelScheduledSendsByBatchIdResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/user_scheduled_send_status"
  },
  "title": "Retrieve scheduled send response"
}
object 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."
    }
  }
}
object CancelScheduledSendsRequestResponse
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "help": {
            "type": "object"
          },
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
object 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."
    }
  }
}
object CancelScheduledSendsUpdateStatusResponse
{
  "type": "object",
  "example": {},
  "properties": {}
}
array CategoriesGetEmailStatisticsForResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/category_stats"
  }
}
object 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": ""
}
array CertificatesGetByIdpConfigurationsResponse
{
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/sso-certificate-body"
  }
}
object 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."
    }
  }
}
object ContactsApiCustomFieldsCreateNewFieldRequest
{
  "type": "object",
  "example": {
    "name": "pet",
    "type": "text"
  },
  "properties": {
    "name": {
      "type": "string"
    },
    "type": {
      "type": "string"
    }
  }
}
object 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"
      }
    }
  }
}
object ContactsApiCustomFieldsGetReservedFieldsResponse
{
  "type": "object",
  "properties": {
    "reserved_fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      }
    }
  }
}
array ContactsApiListsAddMultipleRecipientsToListRequest
{
  "type": "array",
  "items": {
    "type": "integer"
  },
  "example": [
    "recipient_id1",
    "recipient_id2"
  ]
}

Versions

Version Endpoints Schemas Ingested Status
1.0.0 334 545 2026-05-11 current
1.0.0 334 545 2026-04-16