These are the API endpoints to manage the Multiple Credentials feature.

get

Retrieve a list of all credentials, or permissions for a specific credential.

Parameter Required Requirements Description
username No alphanumeric If a username is supplied, the API returns the JSON permissions for that user
Parameter Value Requirements Description

Call

GET https://api.sendgrid.com/api/credentials/get.json?api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
  {
    "id": 4,
    "name": "johnsmith",
    "permissions": {
      "email": 0,
      "api": 1
    }
  },
  {
    "id": 15,
    "name": "joewrigley",
    "permissions": {
      "web": 1,
      "api": 0
    }
  }
]

Call

GET https://api.sendgrid.com/api/credentials/get.xml?api_user=your_sendgrid_username&api_key=your_sendgrid_password

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<credentials>
   <credential>
      <created_at>2013-01-21 16:52:01</created_at>
      <permissions>
         {"web": 1, "api": 0, "email": 0}
         <permissions>
            <id>13243</id>
            <name>John Smith</name>
            <updated_at>2013-01-21 16:52:01</updated_at>
         </permissions>
         <credential>
            <created_at>2013-01-21 16:52:01</created_at>
            <permissions>
               {"web": 1, "api": 1, "email": 0}
               <permissions>
                  <id>13243</id>
                  <name>Joe Wrigley</name>
                  <updated_at>2013-01-21 16:52:01</updated_at>
               </permissions>
            </permissions>
         </credential>
      </permissions>
   </credential>
</credentials>

Add

This API call allows user to add a new set of credentials to their account. Please see the SendGrid password requirements before proceeding.

Parameter Required Requirements Description
username Yes alphanumeric Enter a username for the new account
password Yes alphanumeric Enter a password for the new account
permissions No JSON array of bits Credentials are specified using a JSON object. There are three key names: email for access to SMTP, api for programmatic access, and web for administration. The values for each are a bit, 0 for off or 1 for on.The following example allows the specified username/password to log into the dashboard, but not send email or have access to any of the APIs:{"email": 0, "web": 1, "api": 0}
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/credentials/add.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=name&password=password&permissions={"email":

Response

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

Call

POST https://api.sendgrid.com/api/credentials/add.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=name&password=password&permissions={"email":

Response

1
2
3
<result>
   <count>4</count>
</result>

Edit

Please see the SendGrid password requirements before proceeding.

Parameter Required Requirements Description
username Yes alphanumeric The existing credentials to edit
password No alphanumeric Optionally update the password
permissions No JSON array of bits Credentials are specified using a JSON object. There are three key names: email for access to SMTP, api for programmatic access, and web for administration. The values for each are a bit, 0 for off or 1 for on.The following example allows the specified username/password to log into the dashboard, but not send email or have access to any of the APIs:{"email": 0, "web": 1, "api": 0}If you do not specify any additional parameters (i.e., email, web, api), then no permissions will be changed. This behavior allows you to change passwords without having to lookup the current applied permissions.
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/credentials/edit.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=name&password=password&permissions={"email":0,"web":1,"api":0}

Response

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

Call

POST https://api.sendgrid.com/api/credentials/edit.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=name&password=password&permissions={"email":0,"web":1,"api":0}

Response

1
2
3
<result>
   <count>4</count>
</result>

Delete

Parameter Required Requirements Description
username Yes alphanumeric The credential to remove
Parameter Value Requirements Description

Call

POST https://api.sendgrid.com/api/credentials/remove.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=name

Response

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

Call

POST https://api.sendgrid.com/api/credentials/remove.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=name

Response

1
2
3
<result>
   <count>4</count>
</result>