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

Account Limits


(warning)

This documentation is for the SendGrid Web API v2

To access all the latest features and upcoming developments, please see our v3 API.

When you need your subuser to send only a specific amount of emails at a specified interval, you can set account limits, or throttle their sending capabilities.


Retrieve

retrieve page anchor

Retrieve account limits for a specific subuser. If the API call response is empty that means the subuser has the limits removed.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to retrieveTask to retrieve account limits
userYesSubuser must be under your accountThe subuser who will have their account limits retrieved
JSONXML

Call

POSThttps://api.sendgrid.com/apiv2/customer.limit.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=retrieve

Response


_10
{
_10
"credit": "200",
_10
"credit_remain": "200",
_10
"last_reset": "2014-11-21"
_10
}



Remove the limit for a subuser.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to noneTask to remove account limits
userYesSubuser must be under your accountThe subuser who will have their credit limits removed
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.limit.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=none

_10
{
_10
"message": "success"
_10
}



A recurring reset will allow you to periodically reset a subusers credits to a number you specify. This can be daily, weekly, or monthly.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to recurringTask to setup recurring credits
userYesSubuser must be under your accountThe subuser you will be applying a recurring credit limit to
creditsYesUnsigned integerThe number of credits the subuser will be reset to
periodYesMust be either daily, weekly, or monthlyHow often you want SendGrid to reset the subuser credits
startdateNoDate must be in YYYY-mm-dd formatThe date you want to start resetting the subuser credits
enddateNoDate must be in YYYY-mm-dd formatThe date you want to stop resetting the subusers credits. After this date, credits will not be added to the account, but can still be consumed
initial_creditsNoUnsigned integerThe number of credits you initially want the account reset to. If this is not set, the credits will be reset using the credits parameter. Useful when setting up a subuser with partially-consumed credits
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.limit.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=recurring&credits=200&period=daily

_10
{
_10
"message": "success"
_10
}



Set a subusers credits to a specified amount.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to totalTask to set the credits to the specified amount
userYesSubuser must be under your accountThe subuser who will have their credits updated
creditsYesUnsigned integerThe total number of credits the subuser will be set to
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.limit.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=total&credits=200

_10
{
_10
"message": "success"
_10
}



Set the number of credits that a subuser can use.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to incrementTask to increment the credits by the specified amount
userYesSubuser must be under your accountThe subuser who will have their credits incremented
creditsYesUnsigned integerThe total number of credits the subuser will be incremented by
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.limit.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=increment&credits=20

_10
{
_10
"message": "success"
_10
}



Remove credits from a subuser.

URI ParameterRequiredRequirementsDescription
taskYesMust be set to decrementTask to decrement the credits by the specified amount
userYesSubuser must be under your accountThe subuser who will have their credits decremented
creditsYesUnsigned integerThe total number of credits the subuser will be decremented by
JSONXML
POSThttps://api.sendgrid.com/apiv2/customer.limit.json
POST Dataapi_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=decrement&credits=200

_10
{
_10
"message": "success"
_10
}


Rate this page: