Query structured spec data via REST or MCP. Get exactly what your agent needs.
http://api.sendgrid.com/v3
/scopes
This endpoint returns a list of all scopes that this user has access to.
API Keys are used to authenticate with SendGrid’s v3 API.
API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access.
This endpoint returns all the scopes assigned to the key you use to authenticate with it. To retrieve the scopes assigned to another key, you can pass an API key ID to the “Retrieve an existing API key” endpoint.
For a more detailed explanation of how you can use API Key permissions, please visit our API Keys documentation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
GET /scopes
/api_keys
This endpoint allows you to retrieve all API Keys that belong to the authenticated user.
A successful response from this API will include all available API keys’ names and IDs.
For security reasons, there is not a way to retrieve the key itself after it’s created. If you lose your API key, you must create a new one. Only the “Create API keys” endpoint will return a key to you and only at the time of creation.
An api_key_id can be used to update or delete the key, as well as retrieve the key’s details, such as its scopes.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| limit | query | optional | integer | — |
| on-behalf-of | header | optional | string | — |
GET /api_keys
/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
/api_keys/{api_key_id}
This endpoint allows you to revoke an existing API Key using an api_key_id
Authentications using a revoked API Key will fail after after some small propogation delay. If the API Key ID does not exist, a 404 status will be returned.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| api_key_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
DELETE /api_keys/{api_key_id}
/api_keys/{api_key_id}
This endpoint allows you to retrieve a single API key using an api_key_id.
The endpoint will return a key’s name, ID, and scopes. If the API Key ID does not, exist a 404 status will be returned.
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 |
|---|---|---|---|---|
| api_key_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
GET /api_keys/{api_key_id}
/api_keys/{api_key_id}
This endpoint allows you to update the name of an existing API Key.
You must pass this endpoint a JSON request body with a name property, which will be used to rename the key associated with the api_key_id passed in the URL.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| api_key_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
application/json
ApiKeysUpdateKeyNameRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
PATCH /api_keys/{api_key_id}
/api_keys/{api_key_id}
This endpoint allows you to update the name and scopes of a given API key.
You must pass this endpoint a JSON request body with a name field and a scopes array containing at least one scope. The name and scopes fields will be used to update the key associated with the api_key_id in the request URL.
If you need to update a key’s scopes only, pass the name field with the key’s existing name; the name will not be modified. If you need to update a key’s name only, use the “Update API key name” endpoint.
See the API Key Permissions List for all available scopes.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| api_key_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
application/json
ApiKeysUpdateNameAndScopesRequest
| Property | Type | Required |
|---|---|---|
| name | string | required |
| scopes | array | optional |
PUT /api_keys/{api_key_id}
/alerts
This endpoint allows you to retrieve all of your alerts.
Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
For more information about alerts, please see our Alerts documentation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
GET /alerts
/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
/alerts/{alert_id}
This endpoint allows you to delete an alert.
Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
For more information about alerts, please see our Alerts documentation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| alert_id | path | required | integer | The ID of the alert you would like to retrieve. |
| on-behalf-of | header | optional | string | — |
DELETE /alerts/{alert_id}
/alerts/{alert_id}
This endpoint allows you to retrieve a specific alert.
Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
For more information about alerts, please see our Alerts documentation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| alert_id | path | required | integer | The ID of the alert you would like to retrieve. |
| on-behalf-of | header | optional | string | — |
GET /alerts/{alert_id}
/alerts/{alert_id}
This endpoint allows you to update an alert.
Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics.
For more information about alerts, please see our Alerts documentation.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| alert_id | path | required | integer | The ID of the alert you would like to retrieve. |
| on-behalf-of | header | optional | string | — |
application/json
AlertsUpdateAlertRequest
| Property | Type | Required |
|---|---|---|
| email_to | string | optional |
| frequency | string | optional |
| percentage | integer | optional |
PATCH /alerts/{alert_id}
/suppression/blocks
This endpoint allows you to delete all email addresses on your blocks list.
There are two options for deleting blocked emails:
delete_all to true in the request body.emails array of the request body.| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
BlocksApiDeleteAllBlockedEmailsRequest
| Property | Type | Required |
|---|---|---|
| emails | array | optional |
| delete_all | boolean | optional |
DELETE /suppression/blocks
/suppression/blocks
This endpoint allows you to retrieve all email addresses that are currently on your blocks list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| start_time | query | optional | integer | The start of the time range when a blocked email was created (inclusive). This is a unix timestamp. |
| end_time | query | optional | integer | The end of the time range when a blocked email was created (inclusive). This is a unix timestamp. |
| limit | query | optional | integer | Limit the number of results to be displayed per page. |
| offset | query | optional | integer | The point in the list to begin displaying results. |
| on-behalf-of | header | optional | string | — |
GET /suppression/blocks
/suppression/blocks/{email}
This endpoint allows you to delete a specific email address from your blocks list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | The email address of the specific block. |
|
| on-behalf-of | header | optional | string | — |
DELETE /suppression/blocks/{email}
/suppression/blocks/{email}
This endpoint allows you to retrieve a specific email address from your blocks list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | The email address of the specific block. |
|
| on-behalf-of | header | optional | string | — |
GET /suppression/blocks/{email}
/suppression/bounces
This endpoint allows you to delete all emails on your bounces list.
There are two options for deleting bounced emails:
delete_all to true in the request body.emails array of the request body.| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
application/json
BouncesApiDeleteBouncesRequest
| Property | Type | Required |
|---|---|---|
| emails | array | optional |
| delete_all | boolean | optional |
DELETE /suppression/bounces
/suppression/bounces
This endpoint allows you to retrieve all of your bounces.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| start_time | query | optional | integer | Refers start of the time range in unix timestamp when a bounce was created (inclusive). |
| end_time | query | optional | integer | Refers end of the time range in unix timestamp when a bounce was created (inclusive). |
| on-behalf-of | header | optional | string | — |
GET /suppression/bounces
/suppression/bounces/{email}
This endpoint allows you to remove an email address from your bounce list.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | — | |
| email_address | query | required | string | The email address you would like to remove from the bounce list. |
| on-behalf-of | header | optional | string | — |
application/json
ContactsApiListsDeleteListByIdRequest
DELETE /suppression/bounces/{email}
/suppression/bounces/{email}
This endpoint allows you to retrieve a specific bounce by email address.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| path | required | string | — | |
| on-behalf-of | header | optional | string | — |
GET /suppression/bounces/{email}
/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
/messages/download/{download_uuid}
This endpoint will return a presigned URL that can be used to download the CSV that was requested from the “Request a CSV” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| download_uuid | path | required | string | UUID used to locate the download csv request entry in the DB. This is the UUID provided in the email sent to the user when their csv file is ready to download |
GET /messages/download/{download_uuid}
/campaigns
This endpoint allows you to retrieve a list of all of your campaigns.
Returns campaigns in reverse order they were created (newest first).
Returns an empty array if no campaigns exist.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| limit | query | optional | integer | The number of results you would like to receive at a time. |
| offset | query | optional | integer | The index of the first campaign to return, where 0 is the first campaign. |
| on-behalf-of | header | optional | string | — |
GET /campaigns
/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}
This endpoint allows you to delete a specific campaign.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | The id of the campaign you would like to retrieve. |
| on-behalf-of | header | optional | string | — |
””: “not found”
DELETE /campaigns/{campaign_id}
/campaigns/{campaign_id}
This endpoint allows you to retrieve a specific campaign.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | The id of the campaign you would like to retrieve. |
| on-behalf-of | header | optional | string | — |
””: “not found”
GET /campaigns/{campaign_id}
/campaigns/{campaign_id}
This endpoint allows you to update a specific campaign.
This is especially useful if you only set up the campaign using POST /campaigns, but didn’t set many of the parameters.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | The id of the campaign you would like to retrieve. |
| on-behalf-of | header | optional | string | — |
application/json
CampaignsApiUpdateSpecificCampaignRequest
| Property | Type | Required |
|---|---|---|
| title | string | required |
| subject | string | required |
| categories | array | required |
| html_content | string | required |
| plain_content | string | required |
“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 may only update a campaign when it is in draft mode.”
””: “not found”
PATCH /campaigns/{campaign_id}
/campaigns/{campaign_id}/schedules
This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.
A successful unschedule will return a 204.
If the specified campaign is in the process of being sent, the only option is to cancel (a different method).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | — |
| on-behalf-of | header | optional | string | — |
””: “This campaign is already In Progress.”
“”: “This campaign is already Sent.”
“”: “This campaign is already Paused.”
“”: “This campaign is already Canceled.”
””: “not found”
DELETE /campaigns/{campaign_id}/schedules
/campaigns/{campaign_id}/schedules
This endpoint allows you to retrieve the date and time that a campaign has been scheduled to be sent.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | — |
| on-behalf-of | header | optional | string | — |
””: “not found”
GET /campaigns/{campaign_id}/schedules
/campaigns/{campaign_id}/schedules
This endpoint allows to you change the scheduled time and date for a campaign to be sent.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| campaign_id | path | required | integer | — |
| on-behalf-of | header | optional | string | — |
application/json
CampaignsApiUpdateScheduledTimeRequest
| Property | Type | Required |
|---|---|---|
| send_at | integer | required |
””: “The JSON you have submitted cannot be parsed.”
“send_at”: “Please choose a future time for sending your campaign.”
“”:”You do not have enough credits to send this campaign. Upgrade your plan to send more: https://app.sendgrid.com/settings/billing”
“send_at”: “You cannot update the send_at value of non-scheduled campaign.”
””: “not found”
PATCH /campaigns/{campaign_id}/schedules
/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
/mail/batch/{batch_id}
This endpoint allows you to validate a batch ID.
When you pass a valid batch_id to this endpoint, it will return a 200 status code and the batch ID itself.
If you pass an invalid batch_id to the endpoint, you will receive a 400 level status code and an error message.
A batch_id does not need to be assigned to a scheduled send to be considered valid. A successful response means only that the batch_id has been created, but it does not indicate that it has been associated with a send.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| batch_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
GET /mail/batch/{batch_id}
/user/scheduled_sends
This endpoint allows you to retrieve all cancelled and paused scheduled send information.
This endpoint will return only the scheduled sends that are associated with a batch_id. If you have scheduled a send using the /mail/send endpoint and the send_at field but no batch_id, the send will be scheduled for delivery; however, it will not be returned by this endpoint. For this reason, you should assign a batch_id to any scheduled send you may need to pause or cancel in the future.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| on-behalf-of | header | optional | string | — |
GET /user/scheduled_sends
/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
/user/scheduled_sends/{batch_id}
This endpoint allows you to delete the cancellation/pause of a scheduled send.
Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| batch_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
DELETE /user/scheduled_sends/{batch_id}
/user/scheduled_sends/{batch_id}
This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific batch_id.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| batch_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
GET /user/scheduled_sends/{batch_id}
/user/scheduled_sends/{batch_id}
This endpoint allows you to update the status of a scheduled send for the given batch_id.
If you have already set a cancel or pause status on a scheduled send using the “Cancel or pause a scheduled send” endpoint, you can update it’s status using this endpoint. Attempting to update a status once it has been set with the “Cancel or pause a scheduled send” endpoint will result in a 400 error.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| batch_id | path | required | string | — |
| on-behalf-of | header | optional | string | — |
application/json
CancelScheduledSendsUpdateStatusRequest
| Property | Type | Required |
|---|---|---|
| status | string | required |
PATCH /user/scheduled_sends/{batch_id}
/categories
This endpoint allows you to retrieve a list of all of your categories.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| limit | query | optional | integer | The number of categories to display per page. |
| category | query | optional | string | Allows you to perform a prefix search on this particular category. |
| offset | query | optional | integer | The point in the list that you would like to begin displaying results. |
| on-behalf-of | header | optional | string | — |
GET /categories
/categories/stats
This endpoint allows you to retrieve all of your email statistics for each of your categories.
If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| start_date | query | required | string | The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD |
| end_date | query | optional | string | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. |
| categories | query | required | string | The individual categories that you want to retrieve statistics for. You may include up to 10 different categories. |
| limit | query | optional | integer | The number of results to include. |
| offset | query | optional | integer | The number of results to skip. |
| aggregated_by | query | optional | string | How to group the statistics. Must be either “day”, “week”, or “month”. |
| on-behalf-of | header | optional | string | — |
GET /categories/stats
/categories/stats/sums
This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.
If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| sort_by_metric | query | optional | string | The metric that you want to sort by. Must be a single metric. |
| sort_by_direction | query | optional | string | The direction you want to sort. |
| start_date | query | required | string | The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. |
| end_date | query | optional | string | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. |
| limit | query | optional | integer | Limits the number of results returned. |
| offset | query | optional | integer | The point in the list to begin retrieving results. |
| aggregated_by | query | optional | string | How to group the statistics. Must be either “day”, “week”, or “month”. |
| on-behalf-of | header | optional | string | — |
GET /categories/stats/sums
/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
/sso/certificates/{cert_id}
This endpoint allows you to delete an SSO certificate.
You can retrieve a certificate’s ID from the response provided by the “Get All SSO Integrations” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cert_id | path | required | string | — |
DELETE /sso/certificates/{cert_id}
/sso/certificates/{cert_id}
This endpoint allows you to retrieve an individual SSO certificate.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cert_id | path | required | string | — |
GET /sso/certificates/{cert_id}
/sso/certificates/{cert_id}
This endpoint allows you to update an existing certificate by ID.
You can retrieve a certificate’s ID from the response provided by the “Get All SSO Integrations” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cert_id | path | required | string | — |
application/json
CertificatesUpdateByIdRequest
| Property | Type | Required |
|---|---|---|
| enabled | boolean | optional |
| integration_id | string | optional |
| public_certificate | string | optional |
OK
PATCH /sso/certificates/{cert_id}
/sso/integrations/{integration_id}/certificates
This endpoint allows you to retrieve all your IdP configurations by configuration ID.
The integration_id expected by this endpoint is the id returned in the response by the “Get All SSO Integrations” endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| integration_id | path | required | string | An ID that matches a certificate to a specific IdP integration. |
GET /sso/integrations/{integration_id}/certificates
/marketing/contacts
This endpoint can be used to delete one or more contacts.
The query parameter ids must set to a comma-separated list of contact IDs for bulk contact deletion.
The query parameter delete_all_contacts must be set to "true" to delete all contacts.
You must set either ids or delete_all_contacts.
Deletion jobs are processed asynchronously.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| delete_all_contacts | query | optional | string | Must be set to |
| ids | query | optional | string | A comma-separated list of contact IDs. |
DELETE /marketing/contacts
/marketing/contacts
This endpoint will return up to 50 of the most recent contacts uploaded or attached to a list.
This list will then be sorted by email address.
The full contact count is also returned.
Please note that pagination of the contacts has been deprecated.
Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.
GET /marketing/contacts
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 |