Add user credential

Notes: This API call allows SendGrid resellers to add a new set of credentials to a specified child account.

Parameter Required Requirements Description
user Yes The username must be be between 3 and 64 characters and cannot be completely numeric. The child account we are adding a credential to.
task Yes The task must be set to ‘add’. The task we are setting so we create a credential.
credential_name Yes The credential_name must be be between 3 and 64 characters and cannot be completely numeric. The credential we are creating under the child account.
credential_password Yes Must be at least 6 characters. The password used to authenticate the newly generated credential.

XML API Request

1
https://api.sendgrid.com/apiv2/reseller.credential.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=reseller_customer&task=add&credential_name=reseller_customer_credential&credential_password=reseller_customer_password

Return - Success

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

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

Return - Error

1
2
3
4
5
6
7
8
  <result>
    <message>error</message>
    <errors>
      ...
      <error>... error messages ...</error>
      ...
    </errors>
  </result>

JSON API Request

1
https://api.sendgrid.com/apiv2/reseller.credential.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=reseller_customer&task=add&credential_name=reseller_customer_credential&credential_password=reseller_customer_password

Return - Success

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

Return - Error

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

Edit user credential

Notes: This API call allows SendGrid resellers to edit an already existing credential password. Changing the credential name is not currently allowed.

Parameter Required Requirements Description
user Yes The username must be be between 3 and 64 characters and cannot be completely numeric. The username that we are checking against existing usernames.
task Yes The task must be set to ‘edit’. The task we are setting so we edit a credential password
credential_name Yes The credential_name must be be between 3 and 64 characters and cannot be completely numeric. The credential we want to modify
new_credential_password Yes Must be at least 6 characters The updated password

XML API Request

1
https://api.sendgrid.com/apiv2/reseller.credential.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=reseller_customer&task=edit&credential_name=reseller_customer_credential&new_credential_password=reseller_customer_password

Return - Success

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

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

Return - Error

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

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

JSON API Request

1
https://api.sendgrid.com/apiv2/reseller.credential.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=reseller_customer&task=edit&credential_name=reseller_customer_credential&new_credential_password=reseller_customer_password

Return - Success

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

Return - Error

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

Delete user credential

Notes: This API call allows SendGrid resellers to delete an existing credential under a child account.

Parameter Required Requirements Description
user Yes The username must be be between 3 and 64 characters and cannot be completely numeric. The username that we are checking against existing usernames.
task Yes The task must be set to ‘delete’. The task we are setting so we delete a credential
credential_name Yes The credential_name must be be between 3 and 64 characters and cannot be completely numeric. The credential we want to remove

XML API Request

1
https://api.sendgrid.com/apiv2/reseller.credential.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=reseller_customer&task=delete&credential_name=reseller_customer_credential

Return - Success

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

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

Return - Error

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

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

JSON API Request

1
https://api.sendgrid.com/apiv2/reseller.credential.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=reseller_customer&task=delete&credential_name=reseller_customer_credential

Return - Success

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

Return - Error

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