Menu

Expand
Rate this page:

Subusers API

For more information about Subusers, visit the longform Subusers documentation. You can also manage Subusers in the SendGrid console.

Update the Credits for a Subuser

PUT /v3/subusers/{subuser_name}/credits

Base url: https://api.sendgrid.com

This endpoint allows you to update the Credits for a Subuser.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Request Body

object
type
string

Type determines how credits are reset for a Subuser. unlimited indicates that there is no limit to the Subuser's credits. recurring indicates that the credits for the Subuser are reset according to the frequency determined by reset_frequency. nonrecurring indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis.

Allowed Values: unlimited, recurring, nonrecurring
required
reset_frequency
string

The frequency with which a Subuser's credits are reset if type is set to recurring. Do not include reset_frequency if you choose a reset type value of unlimited or nonrecurring.

Allowed Values: monthly, weekly, daily
total
integer

Total number of credits to which the Subuser is to be reset. If type is nonrecurring then the Subuser's credits will be reset to total on a one-time basis. If type is recurring then the Subuser's credits will be reset to total every time a reset is scheduled in accordance with the reset_frequency. Do not include total if you choose a reset type value of unlimited.

minimum: 1

Path Parameters

subuser_name
string

The username of the Subuser.

default: None
required

Responses

object
type
string

Type determines how credits are reset for a Subuser. unlimited indicates that there is no limit to the Subuser's credits. recurring indicates that the credits for the Subuser are reset according to the frequency determined by reset_frequency. nonrecurring indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis.

Allowed Values: unlimited, recurring, nonrecurring
required
reset_frequency
string or null

The frequency with which a Subuser's credits are reset if type is set to recurring, otherwise null.

Allowed Values: monthly, weekly, daily
required
remain
integer or null

Total number of remaining credits. remain is null if the reset type for the Subuser's credits is set to unlimited.

minimum: 0
required
total
integer or null

Total number of allowable credits. total is null if the reset type for the Subuser's credits is set to unlimited or nonrecurring.

minimum: 0
required
used
integer or null

Total number of used credits. used is null if the reset type for the Subuser's credits is set to unlimited or nonrecurring.

minimum: 0
required
{
  "type": "recurring",
  "reset_frequency": "monthly",
  "remain": 99,
  "total": 100,
  "used": 1
}
object
errors
array[object]
message
string

the error message

required
field
string or null

the field that generated the error

help
object

helper text or docs for troubleshooting

id
string
{
  "errors": [
    {
      "field": "type",
      "message": "Type should be set to 'recurring', 'nonrecurring', or 'unlimited'"
    }
  ]
}
Loading Code Sample...
        
        
        Reset the credits on a monthly basis

        Update the Credits for a Subuser (recurring)

        Reset the credits on a monthly basis
        Loading Code Sample...
              
              
              Reset the credits on a one-time basis

              Update the Credits for a Subuser (non-recurring)

              Reset the credits on a one-time basis
              Loading Code Sample...
                    
                    
                    Grant the Subuser unlimited credits

                    Update the Credits for a Subuser (unlimited)

                    Grant the Subuser unlimited credits
                    Rate this page:

                    Need some help?

                    We all do sometimes. Get help now from the Twilio SendGrid Support Team.

                    Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

                    Loading Code Sample...
                          
                          
                          

                          Thank you for your feedback!

                          Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                          Sending your feedback...
                          🎉 Thank you for your feedback!
                          Something went wrong. Please try again.

                          Thanks for your feedback!

                          thanks-feedback-gif