Skip to content
This repository
branch: develop
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 1049 lines (976 sloc) 29.704 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048
---
layout: page
weight: 0
title: Customer Management
navigation:
   show: true
---
<p>These are actions that directly affect your customer. We provide access via XML and JSON.</p>
<hr/>
{% anchor h2 %}
Create a Customer
{% endanchor %}
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>username</td>
    <td>Yes</td>
    <td>No more than 64 characters</td>
    <td>The customers new username</td>
  </tr>
  <tr>
    <td>password</td>
    <td>Yes</td>
    <td>Must be at least 6 characters</td>
    <td>New password of customer</td>
  </tr>
  <tr>
    <td>confirm_password</td>
    <td>Yes</td>
    <td>Must match password parameter, must be at
least 6 characters</td>
    <td>Confirm new password</td>
  </tr>
  <tr>
    <td>email</td>
    <td>Yes</td>
    <td>Must be in email format, no more than 64
characters</td>
    <td>Email address of new customer</td>
  </tr>
  <tr>
    <td>first_name</td>
    <td>Yes</td>
    <td>No more than 50 characters</td>
    <td>First name of new customer</td>
  </tr>
  <tr>
    <td>last_name</td>
    <td>Yes</td>
    <td>No more than 50 characters</td>
    <td>Last name of new customer</td>
  </tr>
  <tr>
    <td>address</td>
    <td>Yes</td>
    <td>No more than 100 characters</td>
    <td>Address of new customer</td>
  </tr>
  <tr>
    <td>city</td>
    <td>Yes</td>
    <td>No more than 100 characters</td>
    <td>City of new customer</td>
  </tr>
  <tr>
    <td>state</td>
    <td>Yes</td>
    <td>No more than 100 characters</td>
    <td>State of new customer</td>
  </tr>
  <tr>
    <td>zip</td>
    <td>Yes</td>
    <td>No more than 50 characters</td>
    <td>Zip of new customer. This field is not
validated for correct value. It's up to developer to check for valid
zip code.</td>
  </tr>
  <tr>
    <td>country</td>
    <td>Yes</td>
    <td>No more than 100 characters</td>
    <td>Country of new customer</td>
  </tr>
  <tr>
    <td>phone</td>
    <td>Yes</td>
    <td>No more than 50 characters</td>
    <td>Phone number of new customer</td>
  </tr>
  <tr>
    <td>website</td>
    <td>Yes</td>
    <td>No more than 255 characters</td>
    <td>Website of new customer</td>
  </tr>
  <tr>
    <td>company</td>
    <td>Yes</td>
    <td>No more than 255 characters</td>
    <td>Company of new customer</td>
  </tr>
  <tr>
    <td>package</td>
    <td>Yes</td>
    <td>No more than 255 characters</td>
    <td>Name of the Package to assign to customer</td>
  </tr>
  <tr>
    <td>whitelabel</td>
    <td>Yes</td>
    <td>No more than 255 characters</td>
    <td>The domain name for whitelabel</td>
  </tr>
  <tr>
    <td>ip_group[]</td>
    <td>No</td>
    <td>No more than 255 characters for each ip_group
name. It must belong to you.</td>
    <td>Name of the IP Group you wish to optionally
add.</td>
  </tr>
  <tr>
    <td>ip[]</td>
    <td>No</td>
    <td>Valid ip address that belongs to you.</td>
    <td>If package allows it, you can optionally add
additional IP addresses.</td>
  </tr>
  <tr>
    <td>free_user</td>
    <td>Maybe</td>
    <td>If the new customer is a free customer, you
need to specify this parameter. Either true or false.</td>
    <td>Create a free customer</td>
  </tr>
  <tr>
    <td>billing_date</td>
    <td>No</td>
    <td>If the new customer's billing anniversary date
is on a different date from the time you create the customer, you
need to specify this parameter. Must be in YYYY-mm-dd format. This
date must be within one billing cycle from the time you create this
customer. (e.g. if they sign up on 2/28/11, then the latest date you
can use is 3/28/11)</td>
    <td>If the new customer's billing anniversary date
is different from today (or when you execute this API call), you can
specify the first billing anniversary date</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.add.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=newcustomer@example.com&website=example.com&password=samplepassword&confirm_password=samplepassword&first_name=fname&last_name=lname&address=555_anystreet&city=any_city&state=CA&zip=91234&email=newcustomer@example.com&country=US&phone=555-555&free_user=tru{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.add.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&username=newcustomer@example.com&website=example.com&password=samplepassword&confirm_password=samplepassword&first_name=fname&last_name=lname&address=555_anystreet&city=any_city&state=CA&zip=91234&email=newcustomer@example.com&country=US&phone=555-55{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Delete a Customer
{% endanchor %}
<p>Remove a customer from your account. This is
  <strong>not</strong>
  the same as disabling a customer on our system. However, the removed user will still be stored within the system so that you cannot re-register a new user with this new username.</p>
<p>This is the same thing as closing out a customers account at the end of their billing cycle.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Parameter</th>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Must be a customer registered under your
account.</td>
    <td>The customers username you wish to delete.</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.delete.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.delete.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}
{% endcodeblock %}
<hr/>

<p>Retrieve Customers</p>
<p>Obtain a complete list of all customers.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>task</td>
    <td>Yes</td>
    <td>Must be set to
      <strong>get</strong>
      in order
to retrieve user information</td>
  </tr>
  <tr>
    <td>username</td>
    <td>No</td>
    <td>Search filter, customer that is registered
under you</td>
  </tr>
  <tr>
    <td>email</td>
    <td>No</td>
    <td>Search filter, email address customer was
registered with</td>
  </tr>
  <tr>
    <td>active</td>
    <td>No</td>
    <td>Search filter, whether or not the customer is
currently active</td>
  </tr>
  <tr>
    <td>first_name</td>
    <td>No</td>
    <td>Search filter, first name of customer</td>
  </tr>
  <tr>
    <td>last_name</td>
    <td>No</td>
    <td>Search filter, last name of customer</td>
  </tr>
  <tr>
    <td>address</td>
    <td>No</td>
    <td>Search filter, address of customer</td>
  </tr>
  <tr>
    <td>city</td>
    <td>No</td>
    <td>Search filter, city of customer</td>
  </tr>
  <tr>
    <td>state</td>
    <td>No</td>
    <td>Search filter, state of customer</td>
  </tr>
  <tr>
    <td>country</td>
    <td>No</td>
    <td>Search filter, country of customer</td>
  </tr>
  <tr>
    <td>zip</td>
    <td>No</td>
    <td>Search filter, zipcode of customer</td>
  </tr>
  <tr>
    <td>phone</td>
    <td>No</td>
    <td>Search filter, phone number of customer</td>
  </tr>
  <tr>
    <td>website</td>
    <td>No</td>
    <td>Search filter, website of customer</td>
  </tr>
  <tr>
    <td>company</td>
    <td>No</td>
    <td>Search filter, company of customer</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>profile</em>
    </td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=ge{% endrequestdata %}
      {% endrequestblock %}

<h3>Response</h3>
{% codeblock %} <users><user><username>user1</username><email>example1@example.com</email><active>true</active><first_name>john</first_name><last_name>doe</last_name><address>555 any street</address>
      <city>any city</city><state>CA</state><zip>91234</zip><country>US</country><phone>555-555-5555</phone><website>example.com</website></user><user><username>user2</username><email>example2@example.com</email><active>false</active><first_name>jane</first_name><last_name>doe</last_name><address>555 any street</address>
      <city>any city</city><state>CA</state><zip>91234</zip><country>US</country><phone>555-555-5555</phone><website>example.com</website></user></users
{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=ge{% endrequestdata %}
      {% endrequestblock %}

<h3>Response</h3>
{% codeblock %}
{"username":"username","email":"example1@example.com","active":"true","first_name":"john","last_name":"doe","address":"555 any street","city":"any city","state":"CA","zip":"91234","country":"US","phone":"555-555-5555","website":"example.com"},{"username":"username","email":"example2@example.com","active":"false","first_name":"jane","last_name":"doe","address":"555 any street","city":"any city","state":"CA","zip":"91234","country":"US","phone":"555-555-5555","website":"example.com"}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Enable a Customer
{% endanchor %}
<p>Enable a customer so they may start sending out emails again. This call will not enable website access.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Must be in email format</td>
    <td>The customer you are planning to enabling</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>enable</em>
    </td>
    <td>The customer you are planning to enabling</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=enable&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>User not found</message>
</result>

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=enable&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "User not found"
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Disable a Customer
{% endanchor %}
<p>This prevents them from sending out emails with SendGrid.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>username</td>
    <td>Yes</td>
    <td>Must be in email format</td>
    <td>The customer you are planning to disabling</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>disable</em>
    </td>
    <td>The customer you are planning to disabling</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=disable&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>User not found</message>
</result>

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=disabl{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "User not found"
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Enable Website Access To A Customer
{% endanchor %}
<p>Allow a customer to login to the SendGrid.com website. This call will not enable the customer from sending out emails.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Must be in email format</td>
    <td>The customer you are planning to grant
website access</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>website_enable</em>
    </td>
    <td>The customer you are planning to grant
website access</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=website_enable&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>User not found</message>
</result>

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=website_enable&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "User not found"
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Disable Website Access To A Customer
{% endanchor %}
<p>Disallow a customer to login to the SendGrid.com website. This call will not prevent them from sending out emails.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Must be in email format</td>
    <td>The customer you are planning to disallow
website access</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>website_disable</em>
    </td>
    <td>The customer you are planning to disallow
website access</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=website_disable&user=customer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

<result>
   <message>User not found</message>
</result>

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=website_disabl{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "User not found"
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Update Customer Profile
{% endanchor %}
<p>Allows you to update your customers profile information</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>task</td>
    <td>Yes</td>
    <td>Must be set to
      <strong>set</strong>
      in order
to update profile information</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>profile</em>
    </td>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Customer that is registered under you</td>
  </tr>
  <tr>
    <td>first_name</td>
    <td>No</td>
    <td>First name of customer</td>
  </tr>
  <tr>
    <td>last_name</td>
    <td>No</td>
    <td>Last name of customer</td>
  </tr>
  <tr>
    <td>address</td>
    <td>No</td>
    <td>Address of customer</td>
  </tr>
  <tr>
    <td>city</td>
    <td>No</td>
    <td>City of customer</td>
  </tr>
  <tr>
    <td>state</td>
    <td>No</td>
    <td>State of customer</td>
  </tr>
  <tr>
    <td>country</td>
    <td>No</td>
    <td>Country of customer</td>
  </tr>
  <tr>
    <td>zip</td>
    <td>No</td>
    <td>Zipcode of customer</td>
  </tr>
  <tr>
    <td>phone</td>
    <td>No</td>
    <td>Phone number of customer</td>
  </tr>
  <tr>
    <td>website</td>
    <td>No</td>
    <td>Website of customer</td>
  </tr>
  <tr>
    <td>company</td>
    <td>No</td>
    <td>Company of customer</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=set&user=customer@example.com&first_name=newFirstName&last_name=&newLastNam{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=set&user=customer@example.com&first_name=newFirstName&last_name=&newLastNam{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Update Customer Password
{% endanchor %}
<p>Passwords are encrypted by default and therefore cannot be retrieved; however, you can reset a customers password.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Customer must be registered under you</td>
    <td>The customer you are planning to reset the
password</td>
  </tr>
  <tr>
    <td>password</td>
    <td>Yes</td>
    <td>Must be at least 6 characters</td>
    <td>New password of customer</td>
  </tr>
  <tr>
    <td>confirm_password</td>
    <td>Yes</td>
    <td>Must match password parameter and be at least
6 characters</td>
    <td>Confirm new password</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>password</em>
    </td>
    <td>Allows you to access password functionality</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=password&user=customer@example.com&password=newPasword&confirm_password=newPasswor{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=password&user=customer@example.com&password=newPasword&confirm_password=newPasswor{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Update Customer Username
{% endanchor %}
<p>Note that your customer account username is used to login to our SMTP server
  <em>and</em>
  the website and changes take effect immediately.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>task</td>
    <td>Yes</td>
    <td>Must be set to
      <strong>setUsername</strong>
    </td>
    <td>This will let us know you want to update your customers username. This is the new username your customer will be authenticating with our SMTP servers
      <em>and</em>
      to access the website. This update takes effect immediately</td>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Customer must be registered under your account</td>
    <td>The user we will be updating their username
for</td>
  </tr>
  <tr>
    <td>username</td>
    <td>Yes</td>
    <td>Must be in email format, not more than 100 characters, cannot be already taken and cannot contain SendGrid.com in the domain name</td>
    <td>This is the new username we will be
authenticating with our SMTP servers
      <em>and</em>
      to access our site. This update takes effect immediately</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>profile</em>
    </td>
    <td>Allows you to access profile functionality</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=setUsername&user=customer@example.com&username=newcustomer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=setUsername&user=customer@example.com&username=newcustomer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}
{% endcodeblock %}
<hr/>

{% anchor h2 %}
Update Customer Email Address
{% endanchor %}
<p>This is the contact email we use for your customers. Changes take place immediately. It is your responsibility to validate the contact email.</p>
<table class="table table-bordered table-striped">
  <tr>
    <th>Parameter</th>
    <th>Required</th>
    <th>Requirements</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>task</td>
    <td>Yes</td>
    <td>Must be set to
      <strong>setEmail</strong>
    </td>
    <td>This will let us know you want to update your
customers email address. This update takes effect immediately</td>
  </tr>
  <tr>
    <td>user</td>
    <td>Yes</td>
    <td>Customer must be registered under your account</td>
    <td>The user we will be updating their username
for</td>
  </tr>
  <tr>
    <td>email</td>
    <td>Yes</td>
    <td>Must be in email format, not more than 100
characters</td>
    <td>This is the new email address we will use for
contacting customer. This update takes effect immediately</td>
  </tr>
  <tr>
    <td>method</td>
    <td>Yes</td>
    <td>Must be set to
      <em>password</em>
    </td>
    <td>Allows you to access password functionality</td>
  </tr>
</table><h3>XML Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.xml{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=setEmail&user=customer@example.com&email=newcustomer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:xml %}<?xml version="1.0" encoding="ISO-8859-1"?>

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

{% endcodeblock %}
<h3>JSON Call</h3>
      {% requestblock %}
        {% requesturl POST %}https://api.sendgrid.com/api/distributor.manage.json{% endrequesturl %}
        {% requestdata Data POST %}api_user=your_sendgrid_username&api_key=your_sendgrid_password&method=profile&task=setEmail&user=customer@example.com&email=newcustomer@example.com{% endrequestdata %}
      {% endrequestblock %}

<h3>Response: Success</h3>
{% codeblock lang:json %}{
  "message": "success"
}
{% endcodeblock %}
<h3>Response: Error</h3>
{% codeblock lang:json %}{
  "message": "error",
  "errors": [
    "...error messages..."
  ]
}
{% endcodeblock %}
Something went wrong with that request. Please try again.