Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Get the Credits for a Subuser



API Overview

api-overview page anchor

For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console(link takes you to an external page).


GET/v3/subusers/{subuser_name}/credits

Base url: https://api.sendgrid.com

This endpoint allows you to retrieve a Credits overview for a Subuser.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
subuser_namestringrequired

The username of the Subuser.

200400
SchemaExample
Property nameTypeRequiredDescriptionChild properties
typeenum<string>

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.

Possible values:
unlimitedrecurringnonrecurring

reset_frequencyenum<string> or null

The frequency with which a Subuser's credits are reset if type is set to recurring, otherwise null.

Possible values:
monthlyweeklydaily

remaininteger or null

Total number of remaining credits. remain is null if the reset type for the Subuser's credits is set to unlimited.

Minimum: 0

totalinteger or null

Total number of allowable credits. total is null if the reset type for the Subuser's credits is set to unlimited or nonrecurring.

Minimum: 0

usedinteger or null

Total number of used credits. used is null if the reset type for the Subuser's credits is set to unlimited or nonrecurring.

Minimum: 0

Get the Credits for a Subuser

get-the-credits-for-a-subuser page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
curl

_19
const client = require('@sendgrid/client');
_19
client.setApiKey(process.env.SENDGRID_API_KEY);
_19
_19
const subuser_name = "some_one";
_19
_19
const request = {
_19
url: `/v3/subusers/${subuser_name}/credits`,
_19
method: 'GET',
_19
_19
}
_19
_19
client.request(request)
_19
.then(([response, body]) => {
_19
console.log(response.statusCode);
_19
console.log(response.body);
_19
})
_19
.catch(error => {
_19
console.error(error);
_19
});


Rate this page: