# Web Cloud › OverTheBox › Remote Accesses 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/remote-accesses/

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

## Operations

- `GET /overTheBox/{serviceName}/remoteAccesses` — List the remote accesses of an OverTheBox service
- `POST /overTheBox/{serviceName}/remoteAccesses` — Create a remote access on an OverTheBox service
- `GET /overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}` — Get a remote access of an OverTheBox service
- `DELETE /overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}` — Delete a remote access of an OverTheBox service
- `POST /overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}/authorize` — Authorize a remote access of an OverTheBox service

## List the remote accesses of an OverTheBox service

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/remote-accesses/#get-overthebox-servicename-remoteaccesses

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

List the remote accesses of an OverTheBox service. Returns the IDs of the remote accesses created to reach 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}/remoteAccesses" \
  -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}/remoteAccesses")

# 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}/remoteAccesses");

print_r($result);
?>
```

## Create a remote access on an OverTheBox service

`POST /1.0/overTheBox/{serviceName}/remoteAccesses`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/remote-accesses/#post-overthebox-servicename-remoteaccesses

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

Create a remote access on an OverTheBox service. Exposes a port of the device for a remote user, until the expiration date (one day by default), from an allowed IP block.

### 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 |
| --- | --- | --- | --- |
| `allowedIp` | ipBlock |  | IP block from which the remote access will be allowed (the default value is the IP from which the call is made) |
| `expirationDate` | string (date-time) |  | The expirationDate of the remote access (default 1 day) |
| `exposedPort` | integer | yes | The port that the device will expose |
| `publicKey` | string |  | The remote user public key authorized on the device (for SSH purpose) |

```json
{
  "allowedIp": "192.0.2.0/24",
  "expirationDate": "2024-01-01T12:00:00Z",
  "exposedPort": 0,
  "publicKey": "string"
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accepted` | boolean | read-only | If the remote access was accepted by the remote user |
| `askDate` | string (date-time) | read-only | The date of the remote access demand |
| `authorizedBy` | string | read-only | The user that authorized the remote access |
| `connectionInfos` | overTheBox.RemoteAccessConnectionInfos | read-only | All the infos needed to connect yourself to your OTB |
| `connectionInfos.ip` | ip |  | IP to connect to when accessing the device remotely |
| `connectionInfos.port` | integer |  | Port to connect to when accessing the device remotely |
| `deletedAt` | string (date-time) | read-only | When the remote access was deleted |
| `dockerVersion` | string | read-only | Info about the docker version |
| `expirationDate` | string (date-time) | read-only | When the remote access will be automatically deleted |
| `exposedPort` | integer | read-only | The device's port which will be exposed |
| `remoteAccessId` | string | read-only | The id of the remote access |
| `remoteUserInfos` | overTheBox.RemoteAccessUserInfos | read-only | Infos about the remote user |
| `remoteUserInfos.ip` | ipBlock |  | IP from which the remote access will be allowed |
| `remoteUserInfos.publicKey` | string |  | The public key authorized on the device (for SSH purpose) |
| `remoteUserInfos.user` | string |  | The user that will access the device remotely |
| `status` | overTheBox.RemoteAccessStatusEnum | read-only | Status of the remote access — one of `active`, `creating`, `deleted`, `deleting`, `pendingValidation`, `recreating`, `toDelete`, `toRecreate` |

```json
{
  "accepted": true,
  "askDate": "2024-01-01T12:00:00Z",
  "authorizedBy": "string",
  "connectionInfos": {
    "ip": "192.0.2.0",
    "port": 0
  },
  "deletedAt": "2024-01-01T12:00:00Z",
  "dockerVersion": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "exposedPort": 0,
  "remoteAccessId": "string",
  "remoteUserInfos": {
    "ip": "192.0.2.0/24",
    "publicKey": "string",
    "user": "string"
  },
  "status": "active"
}
```

### Example

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

result = client.post("/overTheBox/{serviceName}/remoteAccesses",
	allowedIp = None, # IP block from which the remote access will be allowed (the default value is the IP from which the call is made) (type: ipBlock, nullable)
	expirationDate = None, # The expirationDate of the remote access (default 1 day) (type: datetime, nullable)
	exposedPort = None, # The port that the device will expose (type: long)
	publicKey = None, # The remote user public key authorized on the device (for SSH purpose) (type: string, nullable)
)

# 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}/remoteAccesses", array(
	allowedIp => null, // IP block from which the remote access will be allowed (the default value is the IP from which the call is made) (type: ipBlock, nullable)
	expirationDate => null, // The expirationDate of the remote access (default 1 day) (type: datetime, nullable)
	exposedPort => null, // The port that the device will expose (type: long)
	publicKey => null, // The remote user public key authorized on the device (for SSH purpose) (type: string, nullable)
));

print_r($result);
?>
```

## Get a remote access of an OverTheBox service

`GET /1.0/overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/remote-accesses/#get-overthebox-servicename-remoteaccesses-remoteaccessid

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

Get a remote access of an OverTheBox service. Returns the exposed port, status, acceptance, connection information, the user who authorized it and its expiration date.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accepted` | boolean | read-only | If the remote access was accepted by the remote user |
| `askDate` | string (date-time) | read-only | The date of the remote access demand |
| `authorizedBy` | string | read-only | The user that authorized the remote access |
| `connectionInfos` | overTheBox.RemoteAccessConnectionInfos | read-only | All the infos needed to connect yourself to your OTB |
| `connectionInfos.ip` | ip |  | IP to connect to when accessing the device remotely |
| `connectionInfos.port` | integer |  | Port to connect to when accessing the device remotely |
| `deletedAt` | string (date-time) | read-only | When the remote access was deleted |
| `dockerVersion` | string | read-only | Info about the docker version |
| `expirationDate` | string (date-time) | read-only | When the remote access will be automatically deleted |
| `exposedPort` | integer | read-only | The device's port which will be exposed |
| `remoteAccessId` | string | read-only | The id of the remote access |
| `remoteUserInfos` | overTheBox.RemoteAccessUserInfos | read-only | Infos about the remote user |
| `remoteUserInfos.ip` | ipBlock |  | IP from which the remote access will be allowed |
| `remoteUserInfos.publicKey` | string |  | The public key authorized on the device (for SSH purpose) |
| `remoteUserInfos.user` | string |  | The user that will access the device remotely |
| `status` | overTheBox.RemoteAccessStatusEnum | read-only | Status of the remote access — one of `active`, `creating`, `deleted`, `deleting`, `pendingValidation`, `recreating`, `toDelete`, `toRecreate` |

```json
{
  "accepted": true,
  "askDate": "2024-01-01T12:00:00Z",
  "authorizedBy": "string",
  "connectionInfos": {
    "ip": "192.0.2.0",
    "port": 0
  },
  "deletedAt": "2024-01-01T12:00:00Z",
  "dockerVersion": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "exposedPort": 0,
  "remoteAccessId": "string",
  "remoteUserInfos": {
    "ip": "192.0.2.0/24",
    "publicKey": "string",
    "user": "string"
  },
  "status": "active"
}
```

### Example

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

# 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}/remoteAccesses/{remoteAccessId}");

print_r($result);
?>
```

## Delete a remote access of an OverTheBox service

`DELETE /1.0/overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/remote-accesses/#delete-overthebox-servicename-remoteaccesses-remoteaccessid

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

Delete a remote access of an OverTheBox service. Removes the remote access, and the device port is no longer exposed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `remoteAccessId` | path | string | yes | The id of the remote access |
| `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}/remoteAccesses/{remoteAccessId}" \
  -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}/remoteAccesses/{remoteAccessId}")

# 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}/remoteAccesses/{remoteAccessId}");

print_r($result);
?>
```

## Authorize a remote access of an OverTheBox service

`POST /1.0/overTheBox/{serviceName}/remoteAccesses/{remoteAccessId}/authorize`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/remote-accesses/#post-overthebox-servicename-remoteaccesses-remoteaccessid-authorize

**Status:** Stable production version  
**IAM actions:** `overTheBox:apiovh:remoteAccesses/authorize`

Authorize a remote access of an OverTheBox service. Allows the remote access, so that the device exposes its port to the remote user.

### Parameters

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

### Responses

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

### Example

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

# 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}/remoteAccesses/{remoteAccessId}/authorize");

print_r($result);
?>
```
