<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://docs.hostway.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://docs.hostway.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bozhidar.mihaylov</id>
		<title>Hostway API Documentation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://docs.hostway.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bozhidar.mihaylov"/>
		<link rel="alternate" type="text/html" href="http://docs.hostway.com/index.php/Special:Contributions/Bozhidar.mihaylov"/>
		<updated>2026-04-07T11:47:04Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://docs.hostway.com/index.php/Accounts-account-email-domain-usernames-mailboxName-forwards:POST</id>
		<title>Accounts-account-email-domain-usernames-mailboxName-forwards:POST</title>
		<link rel="alternate" type="text/html" href="http://docs.hostway.com/index.php/Accounts-account-email-domain-usernames-mailboxName-forwards:POST"/>
				<updated>2014-06-24T15:30:53Z</updated>
		
		<summary type="html">&lt;p&gt;Bozhidar.mihaylov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= POST accounts/{account}/email/{domain}/usernames/{mailbox}/forwards =&lt;br /&gt;
Sets forwarding for specified mailbox,domain and account.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Request ==&lt;br /&gt;
&amp;lt;code&amp;gt;POST accounts/{account}/email/{domain}/usernames/{mailbox}/forwards&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== URI Parameters ===&lt;br /&gt;
; account - ''string''&lt;br /&gt;
: &lt;br /&gt;
; domain - ''string''&lt;br /&gt;
: &lt;br /&gt;
; mailbox - ''string''&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
=== Request Headers ===&lt;br /&gt;
{{Authorization}}&lt;br /&gt;
&lt;br /&gt;
; Content-Type&lt;br /&gt;
: Required. Set this header to &amp;lt;code&amp;gt;application/json; charset=UTF-8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Request Body ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;{target-email}&amp;quot;},&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;{target-email1}&amp;quot;},&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Parameters ====&lt;br /&gt;
; targets - ''list''&lt;br /&gt;
: List of target objects.&lt;br /&gt;
&lt;br /&gt;
; target - ''string''&lt;br /&gt;
: The target mailbox to forward to.&lt;br /&gt;
&lt;br /&gt;
== Response ==&lt;br /&gt;
&lt;br /&gt;
=== Status Code ===&lt;br /&gt;
; 204 No Content&lt;br /&gt;
: Success&lt;br /&gt;
&lt;br /&gt;
; 400 Bad Request&lt;br /&gt;
: The format of the request body is invalid or the username does not meet the requirements.&lt;br /&gt;
&lt;br /&gt;
; 401 Unauthorized&lt;br /&gt;
: The supplied credentials are invalid or do not provide permissions for this operation.&lt;br /&gt;
&lt;br /&gt;
; 404 Not Found&lt;br /&gt;
: The domain name does not exist.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Failure setting forwarding with missing required parameter ===&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{empty request body}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
400 Bad Request&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;targets&amp;quot;:&amp;quot;Required&amp;quot;}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Failure setting forwarding by not providing target ===&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;targets&amp;quot;:[]}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
400 Bad Request&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;targets&amp;quot;: &amp;quot;Shorter than minimum length 1&amp;quot;}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Success setting forwarding ===&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;test-fwd@test.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
204 No Content&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Success setting forwards ===&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;test-fwd@test.com&amp;quot;},&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;test-fwd1@test.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
204 No Content&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting forwarding with local storage ===&lt;br /&gt;
In order to have local storage for forwarding, target mailboxes have to be in the same local domain as the source mailbox.&amp;lt;br&amp;gt;&lt;br /&gt;
So the previous two examples of successful setup of forwarding are showing how to setup forwarding with local storage for respectively one and multiple target mailboxes.&lt;br /&gt;
=== Failure setting forwarding to a single mailbox with local storage by setting the source address as the target address ===&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/source_account/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;source-account@test.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
400 Bad Request&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;source-account@test.com&amp;quot;: &amp;quot;Is the same as current mailbox&amp;quot;}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Failure setting forwarding to a single mailbox with local storage by providing a non-existing target ===&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;not-existing-mailbox@test.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
400 Bad Request&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;not-existing-mailbox@test.com&amp;quot;: &amp;quot;Target not found&amp;quot;}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Failure setting forwarding to multiple mailboxes with local storage by providing a non-existing target ===&lt;br /&gt;
It is important to know that either '''all or none''' of the targets will be set-up for forwarding.&amp;lt;br&amp;gt;&lt;br /&gt;
That is: a single non-existant mailbox in the targets list will prevent all of the targets from being added irrespective of it's position in the targets list.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;existing-mailbox@test.com&amp;quot;},&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;not-existing-mailbox@test.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
400 Bad Request&lt;br /&gt;
&lt;br /&gt;
{&amp;quot;not-existing-mailbox@test.com&amp;quot;: &amp;quot;Target not found&amp;quot;}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Success setting forwarding to a single mailbox without local storage ===&lt;br /&gt;
Notice the '''different_domain''' in the request.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Request'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;test-fwd@different_domain.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
204 No Content&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Success setting forwarding to multiple mailboxes without local storage ===&lt;br /&gt;
'''Request'''&amp;lt;br&amp;gt;&lt;br /&gt;
Notice that '''different_domain_1.com''' and '''different_domain_2.com''' are both not test.com.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
POST accounts/{account}/email/test.com/usernames/test/forwards&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;targets&amp;quot;: [&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;test-fwd@different_domain_1.com&amp;quot;},&lt;br /&gt;
        {&amp;quot;target&amp;quot;: &amp;quot;test-fwd1@different_domain_2.com&amp;quot;}&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Response'''&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
204 No Content&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Email API|Email API]]&lt;br /&gt;
&lt;br /&gt;
{{disqus}}&lt;br /&gt;
[[Category:Hostway API]]&lt;br /&gt;
[[Category:Email API]]&lt;/div&gt;</summary>
		<author><name>Bozhidar.mihaylov</name></author>	</entry>

	</feed>