Menu

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.

Rate this page:

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.

Thank you for your feedback!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more