Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

190 lines (145 sloc) 6.236 kB
layout weight title navigation
page
600
Account Limits
show
true

Throttle your subuser when you need them to send only a specific amount of emails at a specified interval.

{% anchor h2 %} Retrieve {% endanchor %}

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

{% parameters retrieve %} {% parameter 'task' 'Yes' 'Must be set to retrieve' 'Task to retrieve account limits' %} {% parameter 'user' 'Yes' 'Subuser must be under your account' 'The subuser who will have their account limits retrieved' %} {% endparameters %}

{% apiexample retrieve POST https://api.sendgrid.com/apiv2/customer.limit api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=retrieve %} {% response json %} { "credit": "200", "credit_remain": "200", "last_reset": "2014-11-21" } {% endresponse %} {% response xml %} 200 200 2014-11-21

{% endresponse %} {% endapiexample %}


{% anchor h2 %} No Limit {% endanchor %}

Remove the limit for a subuser.

{% parameters none %} {% parameter 'task' 'Yes' 'Must be set to none' 'Task to remove account limits' %} {% parameter 'user' 'Yes' 'Subuser must be under your account' 'The subuser who will have their credit limits removed' %} {% endparameters %}

{% apiexample none POST https://api.sendgrid.com/apiv2/customer.limit api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=none %} {% response json %} { "message": "success" } {% endresponse %} {% response xml %} success

{% endresponse %} {% endapiexample %}


{% anchor h2 %} Recurring Reset {% endanchor %} A recurring reset will allow you to periodically reset a subusers credits to a number you specify. This can be either daily, weekly or monthly.

{% parameters recurring %} {% parameter 'task' 'Yes' 'Must be set to recurring' 'Task to setup recurring credits' %} {% parameter 'user' 'Yes' 'Subuser must be under your account' 'The subuser you will be applying a recurring credit limit to' %} {% parameter 'credits' 'Yes' 'Unsigned integer' 'The number of credits the subuser will be reset to' %} {% parameter 'period' 'Yes' 'Must be either daily, weekly, or monthly' 'How often you want SendGrid to reset the subuser credits' %} {% parameter 'startdate' 'No' 'Date must be in YYY-mm-dd format' 'The date you want to start resetting the subuser credits' %} {% parameter 'enddate' 'No' 'Date must be in YYY-mm-dd format' 'The 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' %} {% parameter 'initial_credits' 'No' 'Unsigned integer' 'The 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' %} {% endparameters %}

{% apiexample recurring POST https://api.sendgrid.com/apiv2/customer.limit api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=recurring&credits=200&period=daily %} {% response json %} { "message": "success" } {% endresponse %} {% response xml %} success

{% endresponse %} {% endapiexample %}


{% anchor h2 %} Total Credits {% endanchor %} Set a subusers credits to a specified amount.

{% parameters total %} {% parameter 'task' 'Yes' 'Must be set to total' 'Task to set the credits to the specified amount' %} {% parameter 'user' 'Yes' 'Subuser must be under your account' 'The subuser who will have their credits updated' %} {% parameter 'credits' 'Yes' 'Unsigned integer' 'The total number of credits the subuser will be set to' %} {% endparameters %}

{% apiexample total POST https://api.sendgrid.com/apiv2/customer.limit api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=total&credits=200 %} {% response json %} { "message": "success" } {% endresponse %} {% response xml %} success

{% endresponse %} {% endapiexample %}


{% anchor h2 %} Increment Credits {% endanchor %} Increment a subusers credits by a specified amount.

{% parameters increment %} {% parameter 'task' 'Yes' 'Must be set to increment' 'Task to increment the credits by the specified amount' %} {% parameter 'user' 'Yes' 'Subuser must be under your account' 'The subuser who will have their credits incremented' %} {% parameter 'credits' 'Yes' 'Unsigned integer' 'The total number of credits the subuser will be incremented by' %} {% endparameters %}

{% apiexample increment POST https://api.sendgrid.com/apiv2/customer.limit api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=increment&credits=20 %} {% response json %} { "message": "success" } {% endresponse %} {% response xml %} success

{% endresponse %} {% endapiexample %}


{% anchor h2 %} Decrement Credits {% endanchor %} Decrement a subusers credits by a specified amount.

{% parameters decrement %} {% parameter 'task' 'Yes' 'Must be set to decrement' 'Task to decrement the credits by the specified amount' %} {% parameter 'user' 'Yes' 'Subuser must be under your account' 'The subuser who will have their credits decremented' %} {% parameter 'credits' 'Yes' 'Unsigned integer' 'The total number of credits the subuser will be decremented by' %} {% endparameters %}

{% apiexample decrement POST https://api.sendgrid.com/apiv2/customer.limit api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=decrement&credits=200 %} {% response json %} { "message": "success" } {% endresponse %} {% response xml %} success

{% endresponse %} {% endapiexample %}

Jump to Line
Something went wrong with that request. Please try again.