# Web Cloud › OverTheBox › Device › Backups 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

> 5 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/overthebox/device/backups/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/overthebox/device/backups.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/overthebox/device/backups.json?format=openapi3

## Operations

- `GET /overTheBox/{serviceName}/backups` — List the backups of an OverTheBox service
- `POST /overTheBox/{serviceName}/device/backup` — Back up an OverTheBox device
- `POST /overTheBox/{serviceName}/device/restoreBackup` — Restore a backup on an OverTheBox device
- `GET /overTheBox/{serviceName}/backups/{backupId}` — Get a backup of an OverTheBox service
- `DELETE /overTheBox/{serviceName}/backups/{backupId}` — Delete a backup of an OverTheBox service

## List the backups of an OverTheBox service

`GET /1.0/overTheBox/{serviceName}/backups`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/backups/#get-overthebox-servicename-backups

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:backups/get`

List the backups of an OverTheBox service. Returns the IDs of the configuration backups of the device of the service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

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

```json
[
  "string"
]
```

### Example

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

# 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("/overTheBox/{serviceName}/backups");

print_r($result);
?>
```

## Back up an OverTheBox device

`POST /1.0/overTheBox/{serviceName}/device/backup`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/backups/#post-overthebox-servicename-device-backup

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/backup/create`

Back up an OverTheBox device. Creates the device action that generates a configuration backup of the device, and returns that action.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.DeviceAction | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `actionId` | string | read-only | The id of the action |
| `createdAt` | string (date-time) | read-only | Date of creation of the action |
| `details` | string | read-only | The details of the action |
| `name` | string | read-only | The name of the action |
| `status` | overTheBox.ActionStatusEnum | read-only | The status of the action — one of `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Date of execution of the action |
| `updatedAt` | string (date-time) | read-only | Last time the action was updated |

```json
{
  "actionId": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "details": "string",
  "name": "string",
  "status": "doing",
  "todoDate": "2024-01-01T12:00:00Z",
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/backup" \
  -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("/overTheBox/{serviceName}/device/backup")

# 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("/overTheBox/{serviceName}/device/backup");

print_r($result);
?>
```

## Restore a backup on an OverTheBox device

`POST /1.0/overTheBox/{serviceName}/device/restoreBackup`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/backups/#post-overthebox-servicename-device-restorebackup

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:device/restoreBackup`

Restore a backup on an OverTheBox device. Creates the group of device actions that restore the given backup on the device, and returns them.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `backupId` | string | yes | The id of the backup to restore |

```json
{
  "backupId": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.DeviceAction[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `actionId` | string | read-only | The id of the action |
| `createdAt` | string (date-time) | read-only | Date of creation of the action |
| `details` | string | read-only | The details of the action |
| `name` | string | read-only | The name of the action |
| `status` | overTheBox.ActionStatusEnum | read-only | The status of the action — one of `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Date of execution of the action |
| `updatedAt` | string (date-time) | read-only | Last time the action was updated |

```json
[
  {
    "actionId": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "details": "string",
    "name": "string",
    "status": "doing",
    "todoDate": "2024-01-01T12:00:00Z",
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/device/restoreBackup" \
  -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: string
result = client.post("/overTheBox/{serviceName}/device/restoreBackup",
	backupId = None, # The id of the backup to restore (type: string)
)

# 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: string
$result = $ovh->post("/overTheBox/{serviceName}/device/restoreBackup", array(
	backupId => null, // The id of the backup to restore (type: string)
));

print_r($result);
?>
```

## Get a backup of an OverTheBox service

`GET /1.0/overTheBox/{serviceName}/backups/{backupId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/backups/#get-overthebox-servicename-backups-backupid

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:backups/get`

Get a backup of an OverTheBox service. Returns the creation date of a configuration backup and the ID of the device action that triggered it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupId` | path | string | yes | The id of the backup |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | overTheBox.Backup | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `backupId` | string | read-only | The id of the backup |
| `createdAt` | string (date-time) | read-only | Date of the creation of the backup |
| `deviceActionId` | string | read-only | The id of the device action that triggered the backup |

```json
{
  "backupId": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "deviceActionId": "string"
}
```

### Example

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

# 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("/overTheBox/{serviceName}/backups/{backupId}");

print_r($result);
?>
```

## Delete a backup of an OverTheBox service

`DELETE /1.0/overTheBox/{serviceName}/backups/{backupId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/device/backups/#delete-overthebox-servicename-backups-backupid

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:backups/delete`

Delete a backup of an OverTheBox service. Removes the configuration backup. It can no longer be restored on the device.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `backupId` | path | string | yes | The id of the backup |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/backups/{backupId}" \
  -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("/overTheBox/{serviceName}/backups/{backupId}")

# 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("/overTheBox/{serviceName}/backups/{backupId}");

print_r($result);
?>
```
