Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

640 lines (506 sloc) 14.704 kB
layout weight title seo navigation
page
0
Customer Subuser Account Limits
robots
NOINDEX, FOLLOW
show
true

{% warning %} This feature is deprecated, please go to the Version 2 Reseller Customer Subuser Account Limits page {% endwarning %}

Throttle your customer 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 customer subuser. If the API call response is empty that means the customer subuser has the limits removed.

Parameter Required Requirements Description
task Yes Must be set to retrieve Retrieve account limits
user Yes Customer subuser must be registered under your account The customer subuser who will have their account limits retrieved

XML Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.xml {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=retriev {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} 020002011-02-21</credits {% endcodeblock %}

Response: Error

{% codeblock lang:xml %} <?xml version="1.0" encoding="ISO-8859-1"?>

error ... error messages ...

{% endcodeblock %}

JSON Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.json {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=retriev {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} {"credit":"0","credit_remain":"2000","last_reset":"2011-02-21"} {% endcodeblock %}

Response: Error

{% codeblock lang:json %} { "message": "error", "errors": [ "...error messages..." ] } {% endcodeblock %}


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

Obtain a complete list of all customer subuser.

Parameter Required Requirements Description
task Yes Must be set to none Remove account limits
user Yes Customer subuser must be registered under your account The customer subuser who will have their account limits removed

XML Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.xml {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=non {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} result>success {% endcodeblock %}

Response: Error

{% codeblock lang:xml %} <?xml version="1.0" encoding="ISO-8859-1"?>

error ... error messages ...

{% endcodeblock %}

JSON Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.json {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=non {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock lang:json %} { "message": "success" } {% endcodeblock %}

Response: Error

{% codeblock lang:json %} { "message": "error", "errors": [ "...error messages..." ] } {% endcodeblock %}


{% 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.

Parameter Required Requirements Description
task Yes Must be set to recurring The task required to set the recurring reset
user Yes Customer subuser must be registered under your account The customer subuser you will be applying a recurring reset to
credits Yes Must be an integer and greater than 0 The number of credits the customer subuser will be reset to
period Yes Must be either daily, weekly, or monthly How often you want SendGrid to reset your customer subusers credits
startdate No Date must be in YYYY-mm-dd format The date you want to start resetting the customer subusers credits
enddate No Date must be in YYYY-mm-dd format The date you want to stop resetting the customer subusers credits
initial_credits No Must be an integer greater than 0 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

XML Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.xml {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=recurring&credits=200&period=dail {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} result>success {% endcodeblock %}

Response: Error

{% codeblock lang:xml %} <?xml version="1.0" encoding="ISO-8859-1"?>

error ... error messages ...

{% endcodeblock %}

JSON Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.json {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=recurring&credits=200&period=dail {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock lang:json %} { "message": "success" } {% endcodeblock %}

Response: Error

{% codeblock lang:json %} { "message": "error", "errors": [ "...error messages..." ] } {% endcodeblock %}


{% anchor h2 %} Total Credits {% endanchor %}

Set a subusers credits to a specified amount.

Parameter Required Requirements Description
task Yes Must be set to total Set the credits to the specified amount
user Yes Customer subuser must be registered under your account The customer subuser who will have their credits updated
credits Yes Must be an integer and greater than 0 The total number of credits the customer subuser will be reset to

XML Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.xml {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=total&credits=20 {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} result>success {% endcodeblock %}

Response: Error

{% codeblock lang:xml %} <?xml version="1.0" encoding="ISO-8859-1"?>

error ... error messages ...

{% endcodeblock %}

JSON Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.json {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=total&credits=20 {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock lang:json %} { "message": "success" } {% endcodeblock %}

Response: Error

{% codeblock lang:json %} { "message": "error", "errors": [ "...error messages..." ] } {% endcodeblock %}


{% anchor h2 %} Increment Credits {% endanchor %}

Increment a subusers credits by a specified amount.

Parameter Required Requirements Description
task Yes Must be set to increment Increment the credits by the specified amount
user Yes Customer subuser must be registered under your account The customer subuser who will have their credits incremented
credits Yes Must be an integer and greater than 0 The total number of credits the customer subuser will be incremented by

XML Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.xml {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=increment&credits=20 {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} result>success {% endcodeblock %}

Response: Error

{% codeblock lang:xml %} <?xml version="1.0" encoding="ISO-8859-1"?>

error ... error messages ...

{% endcodeblock %}

JSON Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.json {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=increment&credits=20 {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock lang:json %} { "message": "success" } {% endcodeblock %}

Response: Error

{% codeblock lang:json %} { "message": "error", "errors": [ "...error messages..." ] } {% endcodeblock %}


{% anchor h2 %} Decrement Credits {% endanchor %}

Decrement a subusers credits by a specified amount.

Parameter Required Requirements Description
task Yes Must be set to increment Decrement the credits by the specified amount
user Yes Customer subuser must be registered under your account The customer subuser who will have their credits decremented
credits Yes Must be an integer and greater than 0 The total number of credits the customer subuser will be decremented by

XML Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.xml {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=decrement&credits=20 {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock %} result>success {% endcodeblock %}

Response: Error

{% codeblock lang:xml %} <?xml version="1.0" encoding="ISO-8859-1"?>

error ... error messages ...

{% endcodeblock %}

JSON Call

{% requestblock %}

{% requesturl POST %}https://api.sendgrid.com/api/distributor.manageSubuser.json {% endrequesturl %}

{% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=decrement&credits=20 {% endrequestdata %}

{% endrequestblock %}

Response: Success

{% codeblock lang:json %} { "message": "success" } {% endcodeblock %}

Response: Error

{% codeblock lang:json %} { "message": "error", "errors": [ "...error messages..." ] } {% endcodeblock %}

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