Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Requests



API Overview

api-overview page anchor

Welcome to SendGrid's Web API v3! This API is RESTful, fully featured, easy to integrate with, and offers support in 7 different languages.



Host

host page anchor

The host for Web API v3 requests is always https://api.sendgrid.com/v3/

All requests must be made over HTTPS. The API does not support HTTP.

You must provide an authorization header as described in Authentication.

VerbDescription
GETRetrieve a resource or group of resources
POSTCreate a new resource
PUTUpdate an existing resource
DELETEDelete an existing resource
OPTIONSView allowed verbs against a specific resource

The API provides JSON responses. It doesn't currently require the accept header(link takes you to an external page), but might in the future. If not set, the API will use application/json.


_10
GET https://api.sendgrid.com/v3/endpoint HTTP/1.1
_10
Accept: application/json

When you send an array of data in a GET request, you will include the parameter multiple times on the URL. The parameter name does not require brackets.

Example Array in a GET request

example-array-in-a-get-request page anchor

_10
GET https://api.sendgrid.com/v3/endpoint?parameter=data1&parameter=data2 HTTP/1.1


When submitting data to a resource via POST or PUT, you must submit your payload in JSON.


_10
POST https://api.sendgrid.com/v3/templates/ HTTP/1.1
_10
Content-Type: application/json


_10
{
_10
"name": "new template name"
_10
}

Some GET resources allow for retrieval of information in batches. We will provide the query args in the resource documentation when available to consume.

When requesting multiple items, we will default the request limit to 500 items. You can specify a different limit but cannot exceed the default limit.

Resources documented will display a bolded list of available paginated parameters if available.

Below is a basic pagination example. In the resource documentation, we will only provide the bolded list of available parameters.

A Link Header(link takes you to an external page) is provided in the response for batched information.


_10
GET https://api.sendgrid.com/v3/resource?limit=300&offset=10 HTTP/1.1

ParameterDescription
limitThe number of records to return
offsetThe number of records to skip

Some resources allow for you to search by a specific field. Other resources require you to append a parameter to the URI.

In this example, we will display a paginated URI example, searching for resources where the email contains foo.


_10
GET https://api.sendgrid.com/v3/resource?email=foo&bar=baz HTTP/1.1


Below is a general overview of what resource objects return with successful Web API requests.

VerbResource object returned
GETReturns a single resource object or array of resource objects
PATCHReturns the updated resource object
PUTReturns the updated resource object
DELETENo content is returned
POSTReturns the newly created resource object

Rate this page: