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

Retrieve

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
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=retrieve

Response

1
2
3
4
5
6
7
8
9
{"credit":"0","credit_remain":"2000","last_reset":"2011-02-21"}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=retrieve

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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>

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

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

No Limit

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
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=non

Response

1
2
3
4
5
6
7
8
9
10
11
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=non

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>error</message>
   <errors>
      ...
      <error>... error messages ...</error>
      ...
   </errors>
</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.

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
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=recurring&credits=200&period=daily

Response

1
2
3
4
5
6
7
8
9
10
11
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=limit&user=example@example.com&task=recurring&credits=200&period=daily

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

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

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 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
Parameter Value Requirements Description

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

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

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 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
Parameter Value Requirements Description

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

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

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 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
Parameter Value Requirements Description

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
{
  "message": "success"
}

//error
{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}

Call

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

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="ISO-8859-1"?>

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

<!-- error -->
<?xml version="1.0" encoding="ISO-8859-1"?>

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