# Misc › Migration API

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

> 6 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/misc/migration/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/misc/migration.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/misc/migration.json?format=openapi3

## Operations

- `GET /me/migration` — Retrieve all country migrations
- `GET /me/migration/{migrationId}` — Retrieve information about a country migration
- `GET /me/migration/{migrationId}/contract` — Retrieve all contracts for a billing country migration
- `GET /me/migration/{migrationId}/contract/{contractId}` — Retrieve detail about a contract for a billing country migration
- `POST /me/migration/{migrationId}/contract/{contractId}/accept` — Accept contract
- `GET /me/migration/{migrationId}/contract/{contractId}/agreement` — Retrieve agreement for this contract

## Retrieve all country migrations

`GET /1.0/me/migration`

Link: https://developers.eu.ovhcloud.com/reference/misc/migration/#get-me-migration

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/migration/get`

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/migration" \
  -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("/me/migration")

# 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("/me/migration");

print_r($result);
?>
```

## Retrieve information about a country migration

`GET /1.0/me/migration/{migrationId}`

Link: https://developers.eu.ovhcloud.com/reference/misc/migration/#get-me-migration-migrationid

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/migration/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `migrationId` | path | integer | yes | Migration ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.Migration | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | nichandle.OvhSubsidiaryEnum | read-only | Billing country to migrate from — one of `CZ`, `DE`, `ES`, `EU`, `FI`, `FR`, `GB`, `IE`, `IT`, `LT`, `MA`, `NL`, … |
| `id` | integer | read-only | Migration Id |
| `status` | me.migration.StatusEnum | read-only | Migration status — one of `CANCELED`, `CHECKED`, `DOING`, `MIGRATED`, `TODO`, `TO_CHECK` |
| `steps` | me.migration.Step[] | read-only | Migration steps |
| `steps[].contracts` | me.migration.step.Contracts | read-only | Contracts data |
| `steps[].contracts.agreements` | me.agreements.ContractAgreement[] | read-only | Array of contract agreements to accept |
| `steps[].debt` | me.migration.step.Debt | read-only | Debt data |
| `steps[].debt.balanceAmount` | order.Price | read-only | Balance amount |
| `steps[].debt.ovhAccountAmount` | order.Price | read-only | OVH Account amount |
| `steps[].name` | me.migration.step.NameEnum | read-only | Migration step name — one of `CONTRACTS`, `DEBT`, `NIC`, `ORDERS` |
| `steps[].orders` | me.migration.step.Orders | read-only | Orders data |
| `steps[].orders.pendingOperations` | boolean | read-only | Whether there is pending operations |
| `steps[].orders.pendingPromotions` | boolean | read-only | Whether there is pending promotions |
| `steps[].orders.pendingSubscriptions` | boolean | read-only | Whether there is pending subscriptions |
| `steps[].status` | me.migration.step.StatusEnum | read-only | Billing step status — one of `OK`, `PENDING` |
| `to` | nichandle.OvhSubsidiaryEnum | read-only | Billing country to migrate to — one of `CZ`, `DE`, `ES`, `EU`, `FI`, `FR`, `GB`, `IE`, `IT`, `LT`, `MA`, `NL`, … |

```json
{
  "from": "CZ",
  "id": 0,
  "status": "CANCELED",
  "steps": [
    {
      "contracts": {
        "agreements": [
          {
            "agreed": "ko",
            "contractId": 0,
            "date": "2024-01-01T12:00:00Z",
            "id": 0
          }
        ]
      },
      "debt": {
        "balanceAmount": {
          "currencyCode": "AUD",
          "priceInUcents": 0,
          "text": "string",
          "value": 0
        },
        "ovhAccountAmount": {
          "currencyCode": "AUD",
          "priceInUcents": 0,
          "text": "string",
          "value": 0
        }
      },
      "name": "CONTRACTS",
      "orders": {
        "pendingOperations": true,
        "pendingPromotions": true,
        "pendingSubscriptions": true
      },
      "status": "OK"
    }
  ],
  "to": "CZ"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/migration/{migrationId}" \
  -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("/me/migration/{migrationId}")

# 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("/me/migration/{migrationId}");

print_r($result);
?>
```

## Retrieve all contracts for a billing country migration

`GET /1.0/me/migration/{migrationId}/contract`

Link: https://developers.eu.ovhcloud.com/reference/misc/migration/#get-me-migration-migrationid-contract

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/migration/contract/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `migrationId` | path | integer | yes | Migration ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/migration/{migrationId}/contract" \
  -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("/me/migration/{migrationId}/contract")

# 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("/me/migration/{migrationId}/contract");

print_r($result);
?>
```

## Retrieve detail about a contract for a billing country migration

`GET /1.0/me/migration/{migrationId}/contract/{contractId}`

Link: https://developers.eu.ovhcloud.com/reference/misc/migration/#get-me-migration-migrationid-contract-contractid

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/migration/contract/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `contractId` | path | integer | yes | Contract ID |
| `migrationId` | path | integer | yes | Migration ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.migration.Contract | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `active` | boolean | read-only | Status |
| `date` | string (date) | read-only | Date |
| `id` | integer | read-only | ID |
| `name` | string | read-only | Name |
| `pdf` | string | read-only | PDF URL |
| `text` | string | read-only | Text of the contract |

```json
{
  "active": true,
  "date": "2024-01-01",
  "id": 0,
  "name": "string",
  "pdf": "string",
  "text": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/migration/{migrationId}/contract/{contractId}" \
  -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("/me/migration/{migrationId}/contract/{contractId}")

# 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("/me/migration/{migrationId}/contract/{contractId}");

print_r($result);
?>
```

## Accept contract

`POST /1.0/me/migration/{migrationId}/contract/{contractId}/accept`

Link: https://developers.eu.ovhcloud.com/reference/misc/migration/#post-me-migration-migrationid-contract-contractid-accept

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/migration/contract/accept`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `contractId` | path | integer | yes | Contract ID |
| `migrationId` | path | integer | yes | Migration ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.agreements.ContractAgreement | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agreed` | me.agreements.AgreementStatusEnum | read-only | State of the agreement — one of `ko`, `obsolete`, `ok`, `todo` |
| `contractId` | integer | read-only | Contract ID |
| `date` | string (date-time) | read-only | Date of creation if the agreement is not signed. Date of signature if the agreement is signed |
| `id` | integer | read-only | Contract Agreement ID |

```json
{
  "agreed": "ko",
  "contractId": 0,
  "date": "2024-01-01T12:00:00Z",
  "id": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/me/migration/{migrationId}/contract/{contractId}/accept" \
  -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.post("/me/migration/{migrationId}/contract/{contractId}/accept")

# 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->post("/me/migration/{migrationId}/contract/{contractId}/accept");

print_r($result);
?>
```

## Retrieve agreement for this contract

`GET /1.0/me/migration/{migrationId}/contract/{contractId}/agreement`

Link: https://developers.eu.ovhcloud.com/reference/misc/migration/#get-me-migration-migrationid-contract-contractid-agreement

**Status:** Beta version  
**IAM actions:** `account:apiovh:me/migration/contract/agreement/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `contractId` | path | integer | yes | Contract ID |
| `migrationId` | path | integer | yes | Migration ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | me.agreements.ContractAgreement | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agreed` | me.agreements.AgreementStatusEnum | read-only | State of the agreement — one of `ko`, `obsolete`, `ok`, `todo` |
| `contractId` | integer | read-only | Contract ID |
| `date` | string (date-time) | read-only | Date of creation if the agreement is not signed. Date of signature if the agreement is signed |
| `id` | integer | read-only | Contract Agreement ID |

```json
{
  "agreed": "ko",
  "contractId": 0,
  "date": "2024-01-01T12:00:00Z",
  "id": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/me/migration/{migrationId}/contract/{contractId}/agreement" \
  -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("/me/migration/{migrationId}/contract/{contractId}/agreement")

# 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("/me/migration/{migrationId}/contract/{contractId}/agreement");

print_r($result);
?>
```
