Welcome to SendGrid’s Web API v3! This API is RESTful, fully featured, easy to integrate with, and offers support in 7 different languages.
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.