# Web Cloud › Email and Collaborative Solutions › Zimbra › Redirections API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 4 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/redirections/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/zimbra/redirections.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/zimbra/redirections.json?format=openapi3

## Operations

- `GET /zimbra/platform/{platformId}/redirection` — List redirections
- `GET /zimbra/platform/{platformId}/redirection/{redirectionId}` — Get a redirection
- `POST /zimbra/platform/{platformId}/redirection` — Create a redirection
- `DELETE /zimbra/platform/{platformId}/redirection/{redirectionId}` — Delete a redirection

## List redirections

`GET /v2/zimbra/platform/{platformId}/redirection`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/redirections/#get-zimbra-platform-platformid-redirection

**Status:** Beta version  
**IAM actions:** `zimbra:apiovh:platform/redirection/get`

Returns the redirections of the platform with their current state. Filter them by `source`, `destination`, `domainId` or `organizationId`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `destination` | query | string |  | Filter by destination |
| `domainId` | query | string |  | Filter by domain id |
| `organizationId` | query | string |  | Filter by organization id |
| `platformId` | path | string (uuid) | yes | Platform ID |
| `source` | query | string |  | Filter by source |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.RedirectionResponse[] | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.Redirection | read-only | Object representing Redirection |
| `currentState.createdAt` | string (date-time) | read-only | Date of creation |
| `currentState.destination` | string | read-only | Destination email address to redirect to |
| `currentState.domainId` | string (uuid) | read-only | Identifier of the domain |
| `currentState.organizationId` | string (uuid) | read-only | Identifier of the organization |
| `currentState.organizationLabel` | string | read-only | Label of the organization this redirection belongs to |
| `currentState.source` | string | read-only | Source email address to redirect |
| `currentState.updatedAt` | string (date-time) | read-only | Date of update |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.RedirectionBase | read-only | Object representing Redirection Target Spec |
| `targetSpec.destination` | string | yes | Destination email address to redirect to |
| `targetSpec.source` | string | yes | Source email address to redirect |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "createdAt": "2024-01-01T12:00:00Z",
      "destination": "string",
      "domainId": "00000000-0000-0000-0000-000000000000",
      "organizationId": "00000000-0000-0000-0000-000000000000",
      "organizationLabel": "string",
      "source": "string",
      "updatedAt": "2024-01-01T12:00:00Z"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "destination": "string",
      "source": "string"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/redirection" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/zimbra/platform/{platformId}/redirection")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/zimbra/platform/{platformId}/redirection");

print_r($result);
?>
```

## Get a redirection

`GET /v2/zimbra/platform/{platformId}/redirection/{redirectionId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/redirections/#get-zimbra-platform-platformid-redirection-redirectionid

**Status:** Beta version  
**IAM actions:** `zimbra:apiovh:platform/redirection/get`

Returns the source and destination email addresses of the redirection, with its domain and organization.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `platformId` | path | string (uuid) | yes | Platform ID |
| `redirectionId` | path | string (uuid) | yes | Redirection ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.RedirectionResponse | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.Redirection | read-only | Object representing Redirection |
| `currentState.createdAt` | string (date-time) | read-only | Date of creation |
| `currentState.destination` | string | read-only | Destination email address to redirect to |
| `currentState.domainId` | string (uuid) | read-only | Identifier of the domain |
| `currentState.organizationId` | string (uuid) | read-only | Identifier of the organization |
| `currentState.organizationLabel` | string | read-only | Label of the organization this redirection belongs to |
| `currentState.source` | string | read-only | Source email address to redirect |
| `currentState.updatedAt` | string (date-time) | read-only | Date of update |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.RedirectionBase | read-only | Object representing Redirection Target Spec |
| `targetSpec.destination` | string | yes | Destination email address to redirect to |
| `targetSpec.source` | string | yes | Source email address to redirect |

```json
{
  "checksum": "string",
  "currentState": {
    "createdAt": "2024-01-01T12:00:00Z",
    "destination": "string",
    "domainId": "00000000-0000-0000-0000-000000000000",
    "organizationId": "00000000-0000-0000-0000-000000000000",
    "organizationLabel": "string",
    "source": "string",
    "updatedAt": "2024-01-01T12:00:00Z"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "destination": "string",
    "source": "string"
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/redirection/{redirectionId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/zimbra/platform/{platformId}/redirection/{redirectionId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/zimbra/platform/{platformId}/redirection/{redirectionId}");

print_r($result);
?>
```

## Create a redirection

`POST /v2/zimbra/platform/{platformId}/redirection`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/redirections/#post-zimbra-platform-platformid-redirection

**Status:** Beta version  
**IAM actions:** `zimbra:apiovh:platform/redirection/create`

Creates a redirection from a `source` email address to a `destination` email address.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `platformId` | path | string (uuid) | yes | Platform ID |

### Request body (required)

Type: `zimbra.RedirectionPostPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | zimbra.RedirectionBase | yes | Target redirection specification |
| `targetSpec.destination` | string | yes | Destination email address to redirect to |
| `targetSpec.source` | string | yes | Source email address to redirect |

```json
{
  "targetSpec": {
    "destination": "string",
    "source": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.RedirectionResponse | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.Redirection | read-only | Object representing Redirection |
| `currentState.createdAt` | string (date-time) | read-only | Date of creation |
| `currentState.destination` | string | read-only | Destination email address to redirect to |
| `currentState.domainId` | string (uuid) | read-only | Identifier of the domain |
| `currentState.organizationId` | string (uuid) | read-only | Identifier of the organization |
| `currentState.organizationLabel` | string | read-only | Label of the organization this redirection belongs to |
| `currentState.source` | string | read-only | Source email address to redirect |
| `currentState.updatedAt` | string (date-time) | read-only | Date of update |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.RedirectionBase | read-only | Object representing Redirection Target Spec |
| `targetSpec.destination` | string | yes | Destination email address to redirect to |
| `targetSpec.source` | string | yes | Source email address to redirect |

```json
{
  "checksum": "string",
  "currentState": {
    "createdAt": "2024-01-01T12:00:00Z",
    "destination": "string",
    "domainId": "00000000-0000-0000-0000-000000000000",
    "organizationId": "00000000-0000-0000-0000-000000000000",
    "organizationLabel": "string",
    "source": "string",
    "updatedAt": "2024-01-01T12:00:00Z"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "destination": "string",
    "source": "string"
  }
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/redirection" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: zimbra.RedirectionPostPayload
result = client.post("/v2/zimbra/platform/{platformId}/redirection",
	targetSpec = None, # Target redirection specification (type: zimbra.RedirectionBase)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: zimbra.RedirectionPostPayload
$result = $ovh->post("/v2/zimbra/platform/{platformId}/redirection", array(
	targetSpec => null, // Target redirection specification (type: zimbra.RedirectionBase)
));

print_r($result);
?>
```

## Delete a redirection

`DELETE /v2/zimbra/platform/{platformId}/redirection/{redirectionId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/redirections/#delete-zimbra-platform-platformid-redirection-redirectionid

**Status:** Beta version  
**IAM actions:** `zimbra:apiovh:platform/redirection/delete`

Deletes the redirection.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `platformId` | path | string (uuid) | yes | Platform ID |
| `redirectionId` | path | string (uuid) | yes | Redirection ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/redirection/{redirectionId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/zimbra/platform/{platformId}/redirection/{redirectionId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/zimbra/platform/{platformId}/redirection/{redirectionId}");

print_r($result);
?>
```
