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


Retrieve

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

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

XML Call

POST https://api.sendgrid.com/api/distributor.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=retriev

Response: Success

1
2
3
4
5
6
7
<?xml version="1.0" encoding="ISO-8859-1"?>

<credits>
   <credit>0</credit>
   <credit_remain>2000</credit_remain>
   <last_reset>2011-02-21</last_reset>
</credits>

Response: Error

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      <error>... error messages ...</error>
   </errors>
</result>

JSON Call

POST https://api.sendgrid.com/api/distributor.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=retriev

Response: Success

1
{"credit":"0","credit_remain":"2000","last_reset":"2011-02-21"}

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

No Limit

Obtain a complete list of all customer.

Parameter Required Requirements Description
task Yes Must be set to none Remove account limits
user Yes Customer must be registered under your account The customer who will have their account limits removed
method Yes Must be set to limit Allows you to access limit functionality

XML Call

POST https://api.sendgrid.com/api/distributor.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=non

Response: Success

1
result><message>success</message></result>

Response: Error

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      <error>... error messages ...</error>
   </errors>
</result>

JSON Call

POST https://api.sendgrid.com/api/distributor.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=non

Response: Success

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

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

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.

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

XML Call

POST https://api.sendgrid.com/api/distributor.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=recurring&credits=200&period=dail

Response: Success

1
result><message>success</message></result>

Response: Error

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      <error>... error messages ...</error>
   </errors>
</result>

JSON Call

POST https://api.sendgrid.com/api/distributor.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=recurring&credits=200&period=dail

Response: Success

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

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Total Credits

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 must be registered under your account The customer who will have their credits updated
credits Yes Must be an integer and greater than 0 The total number of credits the customer will be reset to
method Yes Must be set to limit Allows you to access account limit functionality

XML Call

POST https://api.sendgrid.com/api/distributor.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=total&credits=20

Response: Success

1
result><message>success</message></result>

Response: Error

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      <error>... error messages ...</error>
   </errors>
</result>

JSON Call

POST https://api.sendgrid.com/api/distributor.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=total&credits=20

Response: Success

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

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Increment Credits

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 must be registered under your account The customer who will have their credits incremented
credits Yes Must be an integer and greater than 0 The total number of credits the customer will be incremented by
method Yes Must be set to limit Allows you to access account limit functionality

XML Call

POST https://api.sendgrid.com/api/distributor.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=increment&credits=20

Response: Success

1
result><message>success</message></result>

Response: Error

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      <error>... error messages ...</error>
   </errors>
</result>

JSON Call

POST https://api.sendgrid.com/api/distributor.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=increment&credits=20

Response: Success

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

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Decrement Credits

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 must be registered under your account The customer who will have their credits decremented
credits Yes Must be an integer and greater than 0 The total number of credits the customer will be decremented by
method Yes Must be set to limit Allows you to access account limit functionality

XML Call

POST https://api.sendgrid.com/api/distributor.manage.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=decrement&credits=20

Response: Success

1
result><message>success</message></result>

Response: Error

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      <error>... error messages ...</error>
   </errors>
</result>

JSON Call

POST https://api.sendgrid.com/api/distributor.manage.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=customer@example.com&task=decrement&credits=20

Response: Success

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

Response: Error

1
2
3
4
5
6
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}