Get the Credits for a Subuser
For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console.
GET/v3/subusers/{subuser_name}/credits
Base url: https://api.sendgrid.com (for global users and subusers)
Base url: https://api.eu.sendgrid.com (for EU regional subusers)
This endpoint allows you to retrieve a Credits overview for a Subuser.
Bearer <<YOUR_API_KEY_HERE>>The username of the Subuser.
Optional
Type determines how credits are reset for a Subuser. unlimited indicates that there is no limit to the Subuser's credits. recurring indicates that the credits for the Subuser are reset according to the frequency determined by reset_frequency. nonrecurring indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis.
unlimitedrecurringnonrecurringOptional
The frequency with which a Subuser's credits are reset if type is set to recurring, otherwise null.
monthlyweeklydailyOptional
Total number of remaining credits. remain is null if the reset type for the Subuser's credits is set to unlimited.
0Optional
Total number of allowable credits. total is null if the reset type for the Subuser's credits is set to unlimited or nonrecurring.
0Optional
Total number of used credits. used is null if the reset type for the Subuser's credits is set to unlimited or nonrecurring.
01const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const subuser_name = "some_one";56const request = {7url: `/v3/subusers/${subuser_name}/credits`,8method: "GET",9};1011client12.request(request)13.then(([response, body]) => {14console.log(response.statusCode);15console.log(response.body);16})17.catch((error) => {18console.error(error);19});