How to use the SendGrid V3 API
Welcome to SendGrid’s Web API v3! This API is RESTful, fully featured, easy to integrate with, and offers support in 7 different languages.
Libraries
On Behalf of Subuser
Use the on-behalf-of header to make calls for a particular subuser through the parent account. Use this header to automate bulk updates, or to administer a subuser without changing the authentication in your code.
To use the feature, add the on-behalf-of header:
on-behalf-of: << subuser username >>
This header generates the API call as if the subuser account was making the call.
When authenticating using the on-behalf-of header, you need to use the API key credentials of the parent account. For example:
curl --request GET \
--url 'https://api.sendgrid.com/v3/stats?start_date=2018-02-01&aggregated_by=day' \
--header 'authorization: Bearer << API KEY >>' \
--header 'on-behalf-of: << subuser username >>'
Note: The on-behalf-of header does not work with the mail.send API.
Need some help?
We all do sometimes. Get help now from the Twilio SendGrid Support Team.
Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.