Responses
The Twilio SendGrid Web REST API v3 provides SDK support in seven different languages.
Any API response with a content body expresses it in JSON format. The Content-Type header indicates this.
GET https://api.sendgrid.com/v3/resource HTTP/1.1
1HTTP/1.1 200 OK2Content-Type: application/json34{5"foo": "bar"6}
The following table describes the various status codes returned for the API.
| Status code | Description | Response body |
|---|---|---|
200 | OK | No |
201 | Creation succeeded | No |
202 | Request accepted | Varies |
204 | Deletion succeeded | No |
400 | Bad request | Yes |
401 | Requires authentication | Yes |
403 | From address doesn't match Verified Sender Identity | Yes |
403 | You are temporarily blocked from sending emails due to repeated bad requests. | Yes |
406 | Missing the Accept header. For example: Accept: application/json | Yes |
429 | Too many requests or rate limit exceeded | Yes |
500 | Internal server error | Yes |
When a request includes a pagination query parameter, the response returns the following properties in the header. These allow the user to go to the previous, next, first, and last page of the data set.
GET https://api.sendgrid.com/v3/resource?limit=5&offset=0 HTTP/1.1
1HTTP/1.1 200 OK2Content-Type: application/json34Link: <http://api.sendgrid.com/v3/resource?limit=5&offset=5>; rel="next"; title="2",5<http://api.sendgrid.com/v3/resource?limit=5&offset=0>; rel="prev"; title="1",6<http://api.sendgrid.com/v3/resource?limit=5&offset=10>; rel="last"; title="3",7<http://api.sendgrid.com/v3/resource?limit=5&offset=0>; rel="first"; title="1"