Subusers

Subusers belonging to a parent user.

List all Subusers for a parent [GET]

URI Parameter Required Requirements Description
limit No number Number of subusers to return.
Example: 20
offset No number Paging offset.
Example: 1
username No string The subuser to search for
Example: John

Request

1
GET https://api.sendgrid.com/v3/subusers?username={username}&limit={limit}&offset={offset} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
HTTP/1.1 200
[
  {
    "id": 1,
    "username": "Test@example.com",
    "email": "Test@example.com"
  },
  {
    "id": 2,
    "username": "John@example.com",
    "email": "John@example.com"
  }
]

Create Subuser [POST]

Request

1
POST https://api.sendgrid.com/v3/subusers HTTP/1.1
Request Body
1
2
3
4
5
6
7
8
9
{
  "username": "John@example.com",
  "email": "John@example.com",
  "password": "johns_password",
  "ips": [
    "1.1.1.1",
    "2.2.2.2"
  ]
}

Response

1
2
3
4
5
6
7
8
9
10
HTTP/1.1 201
{
  "username": "John@example.com",
  "email": "John@example.com",
  "password": "johns_password",
  "ips": [
    "1.1.1.1",
    "2.2.2.2"
  ]
}

Enable/disable a subuser [PATCH]

Request

1
PATCH https://api.sendgrid.com/v3/subusers/{subuser_name} HTTP/1.1
Request Body
1
2
3
{
  "disabled": false
}

Response

1
HTTP/1.1 204

Delete a subuser [DELETE]

Request

1
DELETE https://api.sendgrid.com/v3/subusers/{subuser_name} HTTP/1.1

Response

1
HTTP/1.1 204

Retrieve monitor settings [GET]

URI Parameter Required Requirements Description
subuser_name Yes string The subuser's username
Example: my_subuser

Request

1
GET https://api.sendgrid.com/v3/subusers/{subuser_name}/monitor HTTP/1.1

Response

1
2
3
4
5
HTTP/1.1 200
{
  "email": "test@example.com",
  "frequency": 500
}

Create monitor settings [POST]

URI Parameter Required Requirements Description
subuser_name Yes string The subuser's username
Example: my_subuser

Request

1
POST https://api.sendgrid.com/v3/subusers/{subuser_name}/monitor HTTP/1.1
Request Body
1
2
3
4
{
  "email": "test@example.com",
  "frequency": 500
}

Response

1
2
3
4
5
HTTP/1.1 200
{
  "email": "test@example.com",
  "frequency": 500
}

Update monitor settings [PUT]

URI Parameter Required Requirements Description
subuser_name Yes string The subuser's username
Example: my_subuser

Request

1
PUT https://api.sendgrid.com/v3/subusers/{subuser_name}/monitor HTTP/1.1
Request Body
1
2
3
4
{
  "email": "test@example.com",
  "frequency": 500
}

Response

1
2
3
4
5
HTTP/1.1 200
{
  "email": "test@example.com",
  "frequency": 500
}

Delete monitor settings [DELETE]

URI Parameter Required Requirements Description
subuser_name Yes string The subuser's username
Example: my_subuser

Request

1
DELETE https://api.sendgrid.com/v3/subusers/{subuser_name}/monitor HTTP/1.1

Response

1
HTTP/1.1 204

Retrieve Subuser Reputations [GET]

URI Parameter Required Requirements Description
usernames Yes string Array of string. The usernames of subusers to retrieve the reputations of.
Example: my_subuser

Request

1
GET https://api.sendgrid.com/v3/subusers/reputations?usernames={usernames} HTTP/1.1

Response

1
2
3
4
5
6
7
8
9
10
11
HTTP/1.1 200
[
  {
    "username": "user1",
    "reputation": 99.0
  },
  {
    "username": "user2",
    "reputation": 95.2
  }
]

Update IPs assigned to a subuser [PUT]

URI Parameter Required Requirements Description
subuser_name Yes string The subuser's username
Example: my_subuser

Request

1
PUT https://api.sendgrid.com/v3/subusers/{subuser_name}/ips HTTP/1.1
Request Body
1
2
3
4
[
  "127.0.0.1",
  "127.0.0.2"
]

Response

1
2
3
4
5
6
7
HTTP/1.1 200
{
  "ips": [
    "127.0.0.1",
    "127.0.0.2"
  ]
}