Skip to content

Sendgrid API

by sendgrid.com

API keyHTTPSEmail
Open documentation ↗

Overview

A cloud-based SMTP provider that allows you to send emails without having to maintain email servers

Sendgrid is an email API from sendgrid.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 334 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Category
Email
Base URL
http://api.sendgrid.com/v3
Version
1.0.0
Endpoints
334
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "http://api.sendgrid.com/v3/access_settings/activity" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("http://api.sendgrid.com/v3/access_settings/activity", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "http://api.sendgrid.com/v3/access_settings/activity",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/access_settings/activityRetrieve all recent access attempts
GET/access_settings/whitelistRetrieve a list of currently allowed IPs
POST/access_settings/whitelistAdd one or more IPs to the allow list
DELETE/access_settings/whitelistRemove one or more IPs from the allow list
GET/access_settings/whitelist/{rule_id}Retrieve a specific allowed IP
DELETE/access_settings/whitelist/{rule_id}Remove a specific IP from the allowed list
GET/alertsRetrieve all alerts
POST/alertsCreate a new Alert
GET/alerts/{alert_id}Retrieve a specific alert
PATCH/alerts/{alert_id}Update an alert
DELETE/alerts/{alert_id}Delete an alert
GET/api_keysRetrieve all API Keys belonging to the authenticated user
POST/api_keysCreate API keys
GET/api_keys/{api_key_id}Retrieve an existing API Key
PUT/api_keys/{api_key_id}Update API key name and scopes
PATCH/api_keys/{api_key_id}Update API key name
DELETE/api_keys/{api_key_id}Delete API keys
GET/asm/groupsRetrieve all suppression groups associated with the user.
POST/asm/groupsCreate a new suppression group
GET/asm/groups/{group_id}Get information on a single suppression group.
PATCH/asm/groups/{group_id}Update a suppression group.
DELETE/asm/groups/{group_id}Delete a Suppression Group
GET/asm/groups/{group_id}/suppressionsRetrieve all suppressions for a suppression group
POST/asm/groups/{group_id}/suppressionsAdd suppressions to a suppression group
POST/asm/groups/{group_id}/suppressions/searchSearch for suppressions within a group
DELETE/asm/groups/{group_id}/suppressions/{email}Delete a suppression from a suppression group
GET/asm/suppressionsRetrieve all suppressions
POST/asm/suppressions/globalAdd recipient addresses to the global suppression group.
GET/asm/suppressions/global/{email}Retrieve a Global Suppression
DELETE/asm/suppressions/global/{email}Delete a Global Suppression
GET/asm/suppressions/{email}Retrieve all suppression groups for an email address
GET/browsers/statsRetrieve email statistics by browser.
GET/campaignsRetrieve all Campaigns
POST/campaignsCreate a Campaign
GET/campaigns/{campaign_id}Retrieve a single campaign
PATCH/campaigns/{campaign_id}Update a Campaign
DELETE/campaigns/{campaign_id}Delete a Campaign
GET/campaigns/{campaign_id}/schedulesView Scheduled Time of a Campaign
POST/campaigns/{campaign_id}/schedulesSchedule a Campaign
PATCH/campaigns/{campaign_id}/schedulesUpdate a Scheduled Campaign
DELETE/campaigns/{campaign_id}/schedulesUnschedule a Scheduled Campaign
POST/campaigns/{campaign_id}/schedules/nowSend a Campaign
POST/campaigns/{campaign_id}/schedules/testSend a Test Campaign
GET/categoriesRetrieve all categories
GET/categories/statsRetrieve Email Statistics for Categories
GET/categories/stats/sumsRetrieve sums of email stats for each category [Needs: Stats object defined, has category ID?]
GET/clients/statsRetrieve email statistics by client type.
GET/clients/{client_type}/statsRetrieve stats by a specific client type.
GET/contactdb/custom_fieldsRetrieve all custom fields
POST/contactdb/custom_fieldsCreate a Custom Field
GET/contactdb/custom_fields/{custom_field_id}Retrieve a Custom Field
DELETE/contactdb/custom_fields/{custom_field_id}Delete a Custom Field
GET/contactdb/listsRetrieve all lists
POST/contactdb/listsCreate a List
DELETE/contactdb/listsDelete Multiple lists
GET/contactdb/lists/{list_id}Retrieve a single list
PATCH/contactdb/lists/{list_id}Update a List
DELETE/contactdb/lists/{list_id}Delete a List
GET/contactdb/lists/{list_id}/recipientsRetrieve all recipients on a List
POST/contactdb/lists/{list_id}/recipientsAdd Multiple Recipients to a List
POST/contactdb/lists/{list_id}/recipients/{recipient_id}Add a Single Recipient to a List
DELETE/contactdb/lists/{list_id}/recipients/{recipient_id}Delete a Single Recipient from a Single List
GET/contactdb/recipientsRetrieve recipients
POST/contactdb/recipientsAdd recipients
PATCH/contactdb/recipientsUpdate Recipient
DELETE/contactdb/recipientsDelete Recipients
GET/contactdb/recipients/billable_countRetrieve the count of billable recipients
GET/contactdb/recipients/countRetrieve a Count of Recipients
GET/contactdb/recipients/searchSearch recipients
POST/contactdb/recipients/searchSearch recipients
GET/contactdb/recipients/{recipient_id}Retrieve a single recipient
DELETE/contactdb/recipients/{recipient_id}Delete a Recipient
GET/contactdb/recipients/{recipient_id}/listsRetrieve the lists that a recipient is on
GET/contactdb/reserved_fieldsRetrieve reserved fields
GET/contactdb/segmentsRetrieve all segments
POST/contactdb/segmentsCreate a Segment
GET/contactdb/segments/{segment_id}Retrieve a segment
PATCH/contactdb/segments/{segment_id}Update a segment
DELETE/contactdb/segments/{segment_id}Delete a segment
GET/contactdb/segments/{segment_id}/recipientsRetrieve recipients on a segment
GET/contactdb/statusGet Recipient Upload Status
GET/designsList Designs
POST/designsCreate Design
GET/designs/pre-builtsList SendGrid Pre-built Designs
GET/designs/pre-builts/{id}Get SendGrid Pre-built Design
POST/designs/pre-builts/{id}Duplicate SendGrid Pre-built Design
GET/designs/{id}Get Design
POST/designs/{id}Duplicate Design
PATCH/designs/{id}Update Design
DELETE/designs/{id}Delete Design
GET/devices/statsRetrieve email statistics by device type.
GET/geo/statsRetrieve email statistics by country and state/province.
GET/ipsRetrieve all IP addresses
POST/ipsAdd IPs
GET/ips/assignedRetrieve all assigned IPs
GET/ips/poolsRetrieve all IP pools
POST/ips/poolsCreate an IP pool
GET/ips/pools/{pool_name}Retrieve all the IPs in a specified pool
PUT/ips/pools/{pool_name}Rename an IP pool
DELETE/ips/pools/{pool_name}Delete an IP pool

Showing the first 100 of 334 endpoints; the full list is in the documentation.

Questions

Does the Sendgrid API need an API key?

Yes. The Sendgrid API uses API key authentication; the documentation explains how to get credentials.

Does the Sendgrid API support HTTPS?

Yes, the Sendgrid API is served over HTTPS.

How many endpoints does the Sendgrid API have?

Its OpenAPI description lists 334 endpoints in version 1.0.0. The first 100 are shown on this page.

What are alternatives to the Sendgrid API?

Other Email APIs include Sendinblue, mail.tm, Mandrill, Guerrilla Mail, Postmark Account-level API.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).