Receive a sample of an outgoing message by a specific customer subuser.

The first step is to create a Monitor Record. Once the monitor record has been created, a reseller can append a monitor record to a customer subuser. Multiple customer subuser can be appended to a single monitor record.

Create Monitor Record

Obtain a complete list of all customer subuser.

Parameter Required Requirements Description
task Yes Must be set to create Create a monitor record
name Yes Name must be unique. Can’t be more than 255 characters The unique name to identify this monitor record
email Yes Must be in email format The email destination to send the email sample to
frequency Yes Customer subuser must be registered under your account The frequency of emails to be sent out

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=monitor&task=create&name=myMonitor&email=example@example.com&frequency=1000

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=monitor&task=create&name=myMonitor&email=example@example.com&frequency=1000

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>

Edit Monitor Record

Make modifications to an existing Monitor record.

Parameter Required Requirements Description
task Yes Must be set to edit The task required to edit a monitor
name Yes The name of the previous monitor record The monitor record we are going to edit
new_name No New name must be unique and can’t be more than 255 characters The new monitor record name
new_email No Must be in email format The new email destination to send the email sample to
new_frequency No Must be an integer and greater than 0 The new frequency of emails to be sent out

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=monitor&task=edit&name=myMonitor&new_name=updatedMonitor&new_email=example@example.com&new_frequency=5

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=monitor&task=edit&name=myMonitor&new_name=updatedMonitor&new_email=example@example.com&new_frequency=5

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>

Delete Monitor Record

Deleting a monitor record will remove it from SendGrid’s system. Make sure no users are currently using the monitor record when removing, or removal will fail.

Parameter Required Requirements Description
task Yes Must be set to delete The task required to remove a monitor
name Yes Must be a monitor record to remove The unique name to identify this monitor record

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=monitor&task=delete&name=recordToDelet

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=monitor&task=delete&name=recordToDelet

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>

List All Monitor Records

List all available monitor records a reseller has.

Parameter Required Requirements Description
task Yes Must be set to list The task required to list all monitor records

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.json
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=monitor&task=list

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[
  {
    "name": "sampleNameA",
    "email": "example@example.com",
    "frequency": "1000",
    "users": [

    ]
  },
  {
    "name": "sampleNameB",
    "email": "example@example.com",
    "frequency": "10000",
    "users": [
      "user1@example.com",
      "user2@example.com"
    ]
  }
]

Call

POST https://api.sendgrid.com/apiv2/reseller.manageSubuser.xml
POST Data api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=monitor&task=list

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"?>

<monitors>
   <monitor>
      <name>sampleNameA</name>
      <email>example@example.com</email>
      <frequency>1000</frequency>
      <users/>
   </monitor>
   <monitor>
      <name>sampleNameB</name>
      <email>example@example.com</email>
      <frequency>10000</frequency>
      <users>
         <user>user1@example.com</user>
         <user>user2@example.com</user>
      </users>
   </monitor>
</monitors>

Append A Customer Subuser To A Monitor Record

Append a monitor record to a existing record onto a customer subuser.

Parameter Required Requirements Description
task Yes Must be set to append The task required to append a monitor record to a customer subuser
user Yes Customer subuser must be registered under your account The user we will append a monitor record to
name No Must be a valid monitor record The name of the monitor record we will be appending

Call

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

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=monitor&task=append&name=myMonitor&user=example@example.com

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>

Detach A Monitor Record From A Customer Subuser

Detach a customer subuser from a monitor record.

Parameter Required Requirements Description
task Yes Must be set to detach The task required to detach a monitor record to a customer subuser
user Yes Customer subuser must be registered under your account The customer subuser we will detach the monitor record from

Call

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

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=monitor&task=detach&user=example@example.com

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>