---
title: "Redirect update"
url: "https://help.internetx.com/en/api/core-redirect-update/"
lang: "en"
section: "API reference — API reference (XML/JSON)"
breadcrumb: "API documentation (JSON/XML) > Tasks > Redirect tasks"
updated: "2023-09-18"
---

# Redirect update

## Function

The _RedirectUpdate_ task updates the data of a redirect. For example, the target address (target), mode or the backup target addresses (backup) can be changed.

## Description

The structure for _RedirectUpdate_ is similar to that of _RedirectCreate_. The values "source" and "type" must not be changed during the update. The value "type" cannot be changed because URLs are usually not valid email addresses and email addresses are usually not valid URLs.

Route: PUT /redirect/{source}  

```
{
    "source": "example.com",
    "target": "example-target.com/test",
    "type": "DOMAIN",
    "mode": "HTTP"
}
```

```
{
    "stid": "20190701-app2-dev-15314",
    "status": {
        "code": "S0502",
        "text": "Redirect has been updated successfully.",
        "type": "SUCCESS"
    },
    "object": {
        "type": "Redirect",
        "summary": 1
    },
    "object": {
        "type": "Redirect",
        "value": "example.com",
        "data": {
            "created": "2014-10-24T09:43:47.000+0200",
            "updated": "2017-11-17T17:35:21.000+0100",
            "source": "example.com",
            "target": "example-target.com/test",
            "type": "DOMAIN",
            "mode": "HTTP",
            "domain": "example.com"
        }
    }
}
```

Task code: 0502  
Uses [Redirect](/en/api/core-redirect-object/) object

**Domain redirect update**

```
<request>
	<auth>
		<user>customer</user>
		<password>password</password>
		<context>4</context>
	</auth>
	<task>
		<code>0502</code>
		<redirect>
			<type>domain</type>
			<mode>frame</mode>
			<title>New title</title>
			<source>www.source-example.com</source>
			<target>www.target-domain.de/somewhere</target>
			<backup>www.target-example-backup.com/somewhere/else</backup>
		</redirect>
	</task>
</request>
```

```
<response>
	<result>
		<status>
			<code>S0502</code>
			<text>Redirect has been updated successfully.</text>
			<type>success</type>
		</status>
	</result>
</response>
```

**Email redirect update (single)**

```
<request>
	<auth>
		<user>customer</user>
		<password>password</password>
		<context>4</context>
	</auth>
	<task>
		<code>0502</code>
		<redirect>
			<type>email</type>
			<mode>single</mode>
			<source>source@email-address.de</source>
			<target>new_target@email-address.net</target>
		</redirect>
	</task>
</request>
```

```
<response>
	<result>
		<status>
			<code>S0502</code>
			<text>Redirect has been updated successfully.</text>
			<type>success</type>
		</status>
	</result>
</response>
```
