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

Retrieve

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

URI Parameter Required Requirements Description
task Yes Must be set to retrieve Task to retrieve account limits
user Yes Subuser must be under your account The subuser who will have their account limits retrieved
Parameter Value Requirements Description

Call

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

Response

1
2
3
4
5
{
  "credit": "200",
  "credit_remain": "200",
  "last_reset": "2014-11-21"
}

Call

POST https://api.sendgrid.com/apiv2/customer.limit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=retrieve

Response

1
2
3
4
5
<credits>
   <credit>200</credit>
   <credit_remain>200</credit_remain>
   <last_reset>2014-11-21</last_reset>
</credits>

No Limit

Remove the limit for a subuser.

URI Parameter Required Requirements Description
task Yes Must be set to none Task to remove account limits
user Yes Subuser must be under your account The subuser who will have their credit limits removed
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/customer.limit.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=none

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/customer.limit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=none

Response

1
2
3
<result>
   <message>success</message>
</result>

Recurring Reset

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.

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

Call

POST https://api.sendgrid.com/apiv2/customer.limit.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=recurring&credits=200&period=daily

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/customer.limit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=recurring&credits=200&period=daily

Response

1
2
3
<result>
   <message>success</message>
</result>

Total Credits

Set a subusers credits to a specified amount.

URI Parameter Required Requirements Description
task Yes Must be set to total Task to set the credits to the specified amount
user Yes Subuser must be under your account The subuser who will have their credits updated
credits Yes Unsigned integer The total number of credits the subuser will be set to
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/customer.limit.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=total&credits=200

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/customer.limit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=total&credits=200

Response

1
2
3
<result>
   <message>success</message>
</result>

Increment Credits

Increment a subusers credits by a specified amount.

URI Parameter Required Requirements Description
task Yes Must be set to increment Task to increment the credits by the specified amount
user Yes Subuser must be under your account The subuser who will have their credits incremented
credits Yes Unsigned integer The total number of credits the subuser will be incremented by
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/customer.limit.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=increment&credits=20

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/customer.limit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=increment&credits=20

Response

1
2
3
<result>
   <message>success</message>
</result>

Decrement Credits

Decrement a subusers credits by a specified amount.

URI Parameter Required Requirements Description
task Yes Must be set to decrement Task to decrement the credits by the specified amount
user Yes Subuser must be under your account The subuser who will have their credits decremented
credits Yes Unsigned integer The total number of credits the subuser will be decremented by
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/customer.limit.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=decrement&credits=200

Response

1
2
3
{
  "message": "success"
}

Call

POST https://api.sendgrid.com/apiv2/customer.limit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=subuser_username&task=decrement&credits=200

Response

1
2
3
<result>
   <message>success</message>
</result>